Closed justin808 closed 2 years ago
@guillaumebriday @dhh Should we remove all of React from rails/webpacker?
@guillaumebriday this is rebased on master.
I've got a draft NPM package that will make React with SSR and HMR a one-liner for rails/webpacker users: https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/pull/24
Here's the config that takes the docs change and puts it into the NPM module: https://github.com/shakacode/react-on-webpacker/blob/main/babel/preset.js
This commit removes React dependencies, replacing them with docs.
Here's what changes in my example project with this change:
https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/pull/21/files
I feel that if we're not going to support HMR, then it makes sense to let React configuration be outside of rails/webpacker.