This repository was archived by the owner on Oct 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
OpalHotReloader jQuery conflict with Bootstrap #28
Copy link
Copy link
Open
Labels
Description
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)
endand
# 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'
endThis is done by the generator at:
hyperloop/lib/generators/hyperloop/install_generator.rb
Lines 144 to 159 in f56d1ac
| 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 |