cantonic
cantonic

Reputation: 1033

When upgrading from Hyperloop to Hyperstack, is "opal_hot_reloader" gem still necessary?

I am just upgrading a Rails app from Hyperloop to Hyperstack. Is the "opal_hot_reloader" gem obsolete since Hyperstack?

Upvotes: 1

Views: 57

Answers (1)

Mitch VanDuyn
Mitch VanDuyn

Reputation: 2878

Yes... a version of the hot-loader is built into hyperstack now.

In your hyperstack.rb initializer you want:

  Hyperstack.configuration do |config|
    ...
    config.import 'hyperstack/hotloader', client_only: true if Rails.env.development?
  end

The Procfile (for foreman) looks like this:

web:        bundle exec rails s -b 0.0.0.0
hot-loader: bundle exec hyperstack-hotloader -p 25222 -d app/hyperstack

assets/javascripts/application.js should end like this:

//= require jquery
//= require jquery_ujs
//= require hyperstack-loader

The hyperstack loader will (using the initializer) figure out what additional code to add to your assets including the hotloader.

Upvotes: 1

Related Questions