reactjs / server-components-demo

Demo app of React Server Components.
https://reactjs.org/server-components
MIT License
4.25k stars 633 forks source link

RSC webpack 5 plugin #52

Closed michenly closed 2 years ago

michenly commented 2 years ago

get the same plugin from react-server-dom-webpack to be compatible with webpack 5

michenly commented 2 years ago

The problem I am running into for getting webpack 4 -> webpack 5

michenly commented 2 years ago

Found the issue. compliation.hooks.buildModule cannot be use to modify dependencies & blocks in webpack 5. Need to use hooks.parser instead https://github.com/webpack/webpack/issues/13361

michenly commented 2 years ago

This plug in is now working in webpack 5 with 1 small hack

michenly commented 2 years ago

Proper PR had been open https://github.com/facebook/react/pull/22739 and I will open a new PR to update the demo to use the new plugin when it is ready.