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

OpalHotReloader jQuery conflict with Bootstrap #28

Description

@johansmitsnl

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions