Skip to content

Commit f949099

Browse files
author
Robert Mosolgo
committed
Merge pull request #187 from rmosolgo/initialize-all-groups
fix(Railtie) make sure initializers always run
2 parents ac4320e + 0baaff7 commit f949099

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/react/rails/railtie.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,19 @@ class Railtie < ::Rails::Railtie
1616
config.react.component_filenames = ['components.js']
1717

1818
# Watch .jsx files for changes in dev, so we can reload the JS VMs with the new JS code.
19-
initializer "react_rails.add_watchable_files" do |app|
19+
initializer "react_rails.add_watchable_files", group: :all do |app|
2020
app.config.watchable_files.concat Dir["#{app.root}/app/assets/javascripts/**/*.jsx*"]
2121
end
2222

2323
# Include the react-rails view helper lazily
24-
initializer "react_rails.setup_view_helpers" do |app|
24+
initializer "react_rails.setup_view_helpers", group: :all do |app|
2525
React::JSX.transform_options = app.config.react.jsx_transform_options
2626
ActiveSupport.on_load(:action_view) do
2727
include ::React::Rails::ViewHelper
2828
end
2929
end
3030

31-
# run after all initializers to allow sprockets to pick up react.js and
32-
# jsxtransformer.js from end-user to override ours if needed
33-
initializer "react_rails.setup_vendor", :after => "sprockets.environment", group: :all do |app|
31+
initializer "react_rails.setup_vendor", group: :all do |app|
3432
# Mimic behavior of ember-rails...
3533
# We want to include different files in dev/prod. The unminified builds
3634
# contain console logging for invariants and logging to help catch

0 commit comments

Comments
 (0)