pmmmwh / react-refresh-webpack-plugin

A Webpack plugin to enable "Fast Refresh" (also previously known as Hot Reloading) for React components.
MIT License
3.15k stars 193 forks source link

Upstreaming the plugin into the React monorepo #75

Open gaearon opened 4 years ago

gaearon commented 4 years ago

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:

What do you think?

pmmmwh commented 4 years ago

I think webpack/webpack#10715 is kinda blocking invalidate implementation (unless we're going full Webpack 5).

lukevp commented 4 years ago

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.

gaearon commented 4 years ago

That's the plan.