dai-shi / waku

⛩️ The minimal React framework
https://waku.gg
MIT License
4.44k stars 117 forks source link

Strict Mode in pages router #753

Closed aretrace closed 2 weeks ago

aretrace commented 2 months ago

react-compiler-healthcheck does not detect strict mode in the npm create waku@latest project template. It should be on by default, placing <StrictMode> tag on the root _layout works.

dai-shi commented 2 months ago

Thanks for reporting. Can anyone investigate it please?

dai-shi commented 2 months ago

755 might be related.

ojj1123 commented 2 months ago

This is the upstream issue. I've tested the case: Next.js project with reactStrictMode: true of next.config.js. But it also did shows StrictMode usage not found. As this PR https://github.com/facebook/react/pull/30099, react-compiler-healthcheck just check whether or not there is reactStrictMode: true option.

So If we want the healthcheck detects the strict mode in waku project, we need to open the PR that react-compiler-healthckeck can checks the strict mode in waku project. (But I don't think it is a good workaround.)

ojj1123 commented 2 months ago

react-compiler-healthcheck just checks whether or not js(x) files use <React.StrictMode /> component. As waku use <StrictMode /> component by default internally, the healthcheck couldn't detect StrictMode

https://github.com/facebook/react/blob/fcfbfc1d1e3e350e1ea3fbc4a2418f647dc28a31/compiler/packages/react-compiler-healthcheck/src/checks/strictMode.ts#L24-L26

dai-shi commented 1 month ago

So, it's not an issue on our end, and it's probably not fixable?

ojj1123 commented 1 month ago

Yeah, I think so. If you want to fix it, you maybe open the PR on React. And this healthcheck needs to depend on Waku internal. So I think it's good to remain as non-fixable.