Skip to content
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

feat: use entry hooks for injection in Webpack 5 #319

Merged
merged 5 commits into from
May 30, 2021
Merged

Conversation

pmmmwh
Copy link
Owner

@pmmmwh pmmmwh commented Feb 28, 2021

Fixes #293
Fixes #303
Fixes #346
Fixes #398

@amerllica
Copy link

@pmmmwh , Thanks mike, please bring for us Webpack 5 support, really world of ReactJS developers need this.

@pmmmwh
Copy link
Owner Author

pmmmwh commented Apr 10, 2021

@amerllica
Webpack 5 support is already there. This is just a quality of life improvement and try to stick to newer Webpack conventions. FYI I'm not prioritizing on this PR because it does not block usage.

@chang-ke
Copy link

Hi Michael~ I want to know when to release this PR? I really need it.

@pmmmwh
Copy link
Owner Author

pmmmwh commented Apr 12, 2021

@chang-ke why do you need it? Webpack 5 is already officially supported even without this PR. I'm not planning to finish this PR any time soon.

@chang-ke
Copy link

@chang-ke why do you need it? Webpack 5 is already officially supported even without this PR. I'm not planning to finish this PR any time soon.

Now i'm use dynamic entry, so without this pr, injectEntry doest not work

@pmmmwh
Copy link
Owner Author

pmmmwh commented Apr 12, 2021

Can you explain your use case further with the help of some examples?

@amerllica
Copy link

@pmmmwh , What do you mean:

Webpack 5 support is already there.

Webpack 5 is already officially supported

Webpack is a tool for bundling, ReactJS is a library, The Webpack developers haven't made it for specific library. why you said those?

@pmmmwh
Copy link
Owner Author

pmmmwh commented May 24, 2021

TODO:

  • Cleanup imports
  • Cleanup socket entry check
  • Document heuristic change

@pmmmwh
Copy link
Owner Author

pmmmwh commented May 24, 2021

Webpack is a tool for bundling, ReactJS is a library, The Webpack developers haven't made it for specific library. why you said those?

@amerllica

React Refresh is built on top of bundlers' native HMR capabilities. To support a specific bundler (version), we need to have the proper code to hook React Refresh into the HMR lifecycle.

Webpack 5 is supported means this plugin will allow you to have React Refresh capabilities if you use Webpack 5 as your bundler. However without this PR there is a small caveat that you cannot rely on Webpack 5's default entry point (./src) and have to manually specify your entry, because we rely on that to inject stuff for you.

@chang-ke

This should make it into the next beta, which will probably be the last one before 0.5.0 lands.

@pmmmwh pmmmwh changed the title [WIP] Use entry hooks for injection in Webpack 5 feat: use entry hooks for injection in Webpack 5 May 30, 2021
@pmmmwh pmmmwh merged commit ca31cb0 into main May 30, 2021
@pmmmwh pmmmwh deleted the fix/webpack-5-entry branch May 30, 2021 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment