-
Notifications
You must be signed in to change notification settings - Fork 46.4k
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
Test ownerstack branches in ReactFlight-test #29761
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
__DEV__ ? null : undefined, | ||
__DEV__ ? null : undefined, | ||
// validated | ||
__DEV__ ? 1 : undefined, |
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.
Was the absence of this field also causing the "missing key" warnings in https://github.com/vercel/next.js/actions/runs/9368979535/job/25792391746?pr=66533#step:28:430?
Comparing: eabb681...0f8bab7 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
__DEV__ ? null : undefined, | ||
__DEV__ ? null : undefined, | ||
// validated | ||
__DEV__ ? 1 : undefined, |
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.
Because RSC can encode undefined
this is not equivalent to missing properties. This will show up in prod. Even if it was we should have consistent internal types on the server too that doesn't use extra fields.
|
||
describe('ReactFlight', () => { | ||
beforeEach(() => { | ||
jest.resetModules(); | ||
console.createTask = function fakeCreateTask(name) { | ||
return {run: fn => fn()}; | ||
}; |
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.
We should think through a way to test these properly which might be dependent on what the public API for getting the owner stacks is.
We could maybe also polyfill it with by appending to console.error so that our existing tests pass. Then enable in some variant.
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.
Yeah, this was a quick mock to reveal the error. Once we land #29762, I'll clean this up.
Summary
We expect that every tuple for elements has 7 items in DEV. However, we had some optimizations for fragments that only added the 4 items you need in prod. If we parse that model in a dev client, in environments with
createTask
, we crash because we only expect a stack to bestring | null
but receivedundefined
.How did you test this change?
createTask
inReactFlight-test
causing multiple tests to fail with the same error we're seeing in Next.js: https://github.com/vercel/next.js/actions/runs/9368979535/job/25792391746?pr=66533#step:28:406