Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

OpalHotReloader jQuery conflict with Bootstrap #28

Open
johansmitsnl opened this issue Aug 16, 2018 · 0 comments
Open

OpalHotReloader jQuery conflict with Bootstrap #28

johansmitsnl opened this issue Aug 16, 2018 · 0 comments
Assignees
Labels

Comments

@johansmitsnl
Copy link
Contributor

johansmitsnl commented Aug 16, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants