Open gaearon opened 4 years ago
I think webpack/webpack#10715 is kinda blocking invalidate
implementation (unless we're going full Webpack 5).
I've been using Fast Refresh in RN since the beta and the workflow is amazing. Hot Reloading is already a massive win for DX, and one of the reasons we're using React for most of our frontend going forward (desktop apps as well). It would be great to have Fast Refresh natively supported in the toolchain of CRA without any customization.
That's the plan.
Webpack is the foundation of several projects representing significant chunks the React ecosystem. Today, these are CRA, Next, and Gatsby. Although there are likely more.
Lately, we've been working on React features that work in integration with the compilation toolchain. Such as some of the data fetching / code splitting experiments that are in a very early stage. For those, we'll need to provide webpack plugins. Fast Refresh seems similar. There is a core experience we want to guarantee that in a way can be considered a part of the React brand.
We propose that this plugin be moved into the React monorepo as the canonical source. We've briefly discussed this with @pmmmwh and he doesn't have objections, so I'd like to raise this as a broader discussion. I think there's a few things that ideally need to happen before we do this:
module.hot.invalidate
API (https://github.com/webpack/webpack/pull/10714). This should let us remove some hacks.What do you think?