-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add setting switch to disable assets compilation #244
Conversation
Thanks @n-rodriguez! I thought we had that already, but seems like we don't! I'm wondering if we should do it like Otherwise we should probably add the option to the |
I'd prefer to not touch CableReady::Config so let's do it à la Turbo :) |
@n-rodriguez Do you have any specific reason for that? |
to keep things simple |
Actually I don't use the Maybe this is better : # config/initializers/cable_ready.rb
CableReady.configure do |config|
config.precompile_assets = false # new configuration accessor
config.on_failed_sanity_checks = :ignore
config.add_operation_name :notify
config.add_operation_name :progress_bar
end but it may requires some tests. wdyt? |
FWIW : Turbo : https://github.com/hotwired/turbo-rails/blob/main/lib/turbo/engine.rb#L31 ActionCable and ActiveStorage wrap it in a |
@n-rodriguez I like the version where we have it in but we can also keep the For ActionText, ActionCable and ActiveStorage it makes sense that they do it that way because the already have their regular a config on |
One more thing: Would you mind adding it commented out to: cable_ready/lib/generators/cable_ready/templates/config/initializers/cable_ready.rb Line 3 in 29b7e06
Then we can merge this, imo 🚀 |
Like Turbo: https://github.com/hotwired/turbo-rails/blob/main/lib/turbo/engine.rb#L31 and ActionCable: https://github.com/rails/rails/blob/main/actioncable/lib/action_cable/engine.rb#L27 Useful when using Webpacker to manage static assets
Do you think it's possible to cut a new pre-release for both Ruby and JS? |
Yes, pre10 is going out this week! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @n-rodriguez!
Thanks! |
# Type of PR Enhancement ## Description This pull request ports over the changes introduced in stimulusreflex/cable_ready#244 This allows developers to disable the assets pre-compilation step, which previously happened automatically if the gem was included and sprockets was installed in the app. If the project is using esbuild/webpack/vite it's very likely that there's no need to precompile the StimulusReflex assets in your app. ## Why should this be added So that developers can turn off the pre-compilation step if they don't ship the StimulusReflex assets via the Asset pipeline.
Like ActionCable: https://github.com/rails/rails/blob/main/actioncable/lib/action_cable/engine.rb#L27
Useful when using Webpacker to manage static assets