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

Test ownerstack branches in ReactFlight-test #29761

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Jun 4, 2024

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 be string | null but received undefined.

How did you test this change?

@eps1lon eps1lon requested a review from sebmarkbage June 4, 2024 21:56
Copy link

vercel bot commented Jun 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 9:58pm

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jun 4, 2024
__DEV__ ? null : undefined,
__DEV__ ? null : undefined,
// validated
__DEV__ ? 1 : undefined,
Copy link
Collaborator Author

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?

@react-sizebot
Copy link

Comparing: eabb681...0f8bab7

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.66 kB 6.66 kB = 1.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 497.26 kB 497.26 kB = 89.11 kB 89.11 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 502.08 kB 502.08 kB = 89.80 kB 89.80 kB
facebook-www/ReactDOM-prod.classic.js = 594.56 kB 594.56 kB = 104.72 kB 104.72 kB
facebook-www/ReactDOM-prod.modern.js = 570.95 kB 570.95 kB = 101.13 kB 101.13 kB
test_utils/ReactAllWarnings.js Deleted 63.89 kB 0.00 kB Deleted 15.97 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-rc/react-server/cjs/react-server-flight.production.js +0.24% 52.47 kB 52.60 kB +0.11% 10.72 kB 10.73 kB
oss-stable-semver/react-server/cjs/react-server-flight.production.js +0.24% 52.47 kB 52.60 kB +0.11% 10.72 kB 10.73 kB
oss-stable/react-server/cjs/react-server-flight.production.js +0.24% 52.47 kB 52.60 kB +0.11% 10.72 kB 10.73 kB
oss-experimental/react-server/cjs/react-server-flight.production.js +0.22% 57.46 kB 57.59 kB +0.12% 11.46 kB 11.47 kB
test_utils/ReactAllWarnings.js Deleted 63.89 kB 0.00 kB Deleted 15.97 kB 0.00 kB

Generated by 🚫 dangerJS against 0f8bab7

__DEV__ ? null : undefined,
__DEV__ ? null : undefined,
// validated
__DEV__ ? 1 : undefined,
Copy link
Collaborator

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()};
};
Copy link
Collaborator

@sebmarkbage sebmarkbage Jun 4, 2024

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.

Copy link
Collaborator Author

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.

@eps1lon eps1lon marked this pull request as draft June 4, 2024 22:07
@eps1lon eps1lon changed the title Fix crash when parsing models with keyed fragments Test ownerstack branches in ReactFlight-test Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants