-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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(gatsby): use production React for dev-ssr when CI=true #28728
Conversation
Could this mean that we miss errors, as we're testing something different from users? |
Probably will not miss errors (tho wording might be different), but warnings on CI wouldn't show, but it doesn't seem like we are testing for those right now. If there are worries about using generic check testing if we are in CI - maybe this should not care about CI env and instead should be setting for DEV_SSR (wether to use prod or dev |
@ascorbic this isn't for testing — it's for people running preview servers w/ |
We could check if we're running through Cypress, which is what I'm concerned about. |
Just to be clear - this is for SSR not browser bundle. At the compile time we also have no ability to know if we will run through cypress. We can add some toggle to disable using Prod react for dev SSR for our tests, but so far we don't have any tests for dev ssr that would actually check for warnings (thought we should add some at some point) |
Even when using gatsby/packages/gatsby/src/utils/webpack.config.js Lines 638 to 655 in abdb8d6
In particular Unless we make those not externals anymore I don't see a way to address it without hooking into node.js module loading and making overwrites there too (but that seem messy ...). In any case - it doesn't seem to cause problems in my testing. The fact remains that it will load react module twice (dev and prod) and it will use dev react for some thing and prod for most of things |
To add to above - funnily enough - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this in as-is. Main benefit is from using prod version of react-dom/server
renderToString
- we possibly can squeeze more - but this is good enough for now
Published in |
We don't need React's dev hints & we want SSR to be as fast as possible on CI