-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Summary of Changes to Support React on Rails #594
Comments
@gauravtiwari, React on Rails will handle compilation of files separately than the bin/webpack task. Instead, React on Rails needs the check if the bundle is created, per this line. So I have a lookup method that does not necessarily throw, and will trigger the loading of the instance. Please let me know your thoughts on this one. Maybe if the API changes are minimal, we can release a beta version of the Webpacker gem that works with React on Rails, and then we can assess the next step. In React on Rails. def stale_generated_webpack_files
manifest_needed = ReactOnRails::Utils.using_webpacker_lite? &&
!WebpackerLite::Manifest.exist?
return ["manifest.json"] if manifest_needed
most_recent_mtime = find_most_recent_mtime
all_compiled_assets.each_with_object([]) do |webpack_generated_file, stale_gen_list|
if !File.exist?(webpack_generated_file) ||
File.mtime(webpack_generated_file) < most_recent_mtime
stale_gen_list << webpack_generated_file
end
stale_gen_list
end
end |
@gauravtiwari @dhh, |
See rails/webpacker#594 From a long discussion on #464, this issue will summarize. I'll soon be posting proposed changes to the README.md. Summary of changes * Move base url out from manifest.json to manifest.rb * Assign env variables to dev server settings so it can be overridden at runtime. * The keys for dev_server should use same format as of now as documented in Paths on the README.md. Note that * hot is a new setting to indicate that the dev_server is used with hot reloading, which means that CSS should be inlined to be hot loaded. The presence of dev_server means that the webpack-dev-server is used for the given env. development: // put the created files to the /public/webpack/development directory public_output_path: webpack/development //# if dev_server is not provided, then dev_server is not used dev_server: hot: true # This is a new setting static: false host: localhost https: false
See rails/webpacker#594 From a long discussion on #464, this issue will summarize. I'll soon be posting proposed changes to the README.md. Summary of changes * Move base url out from manifest.json to manifest.rb * Assign env variables to dev server settings so it can be overridden at runtime. * The keys for dev_server should use same format as of now as documented in Paths on the README.md. Note that * hot is a new setting to indicate that the dev_server is used with hot reloading, which means that CSS should be inlined to be hot loaded. The presence of dev_server means that the webpack-dev-server is used for the given env. development: // put the created files to the /public/webpack/development directory public_output_path: webpack/development //# if dev_server is not provided, then dev_server is not used dev_server: hot: true # This is a new setting static: false host: localhost https: false
From a long discussion on #464, this issue will summarize. I'll soon be posting proposed changes to the README.md.
Demo: https://github.com/justin808/webpacker-demo-webpacker_lite-merge
Summary of changes
hot
is a new setting to indicate that the dev_server is used with hot reloading, which means that CSS should be inlined to be hot loaded.CC: @gauravtiwari
The text was updated successfully, but these errors were encountered: