The OpalHotReloader is added to the Javascript the default jQuery for Bootstrap stops working.
When it is installed in the app/hyperloop/components/opal_hot_reloader.rb location with the content below works as expected.
if Hyperloop.env.development?
OpalHotReloader.listen(25222, false)
end
and
# config/initializers/hyperloop.rb
# If you are not using ActionCable, see http://ruby-hyperloop.io/docs/models/configuring-transport/
Hyperloop.configuration do |config|
config.transport = :action_cable # or :pusher or :simpler_poller or :none
config.prerendering = :off # or :on
config.import 'reactrb/auto-import' # will automatically bridge js components to hyperloop components
config.import 'opal_hot_reloader' if Rails.env.development?
config.cancel_import 'react'
config.cancel_import 'react-dom'
config.cancel_import 'react-number-format'
end
This is done by the generator at:
|
def add_opal_hot_reloader |
|
return if options['skip-hot-reloader'] |
|
create_file 'Procfile', <<-TEXT |
|
web: bundle exec rails s -b 0.0.0.0 |
|
hot-loader: bundle exec opal-hot-reloader -d app/hyperloop |
|
TEXT |
|
append_file 'app/assets/javascripts/application.js' do |
|
<<-RUBY |
|
Opal.OpalHotReloader.$listen() // optional (port, false, poll_seconds) i.e. (8081, false, 1) |
|
RUBY |
|
end |
|
gem_group :development do |
|
gem 'opal_hot_reloader' |
|
gem 'foreman' |
|
end |
|
end |
The OpalHotReloader is added to the Javascript the default jQuery for Bootstrap stops working.
When it is installed in the
app/hyperloop/components/opal_hot_reloader.rblocation with the content below works as expected.and
This is done by the generator at:
hyperloop/lib/generators/hyperloop/install_generator.rb
Lines 144 to 159 in f56d1ac