8000 [Flight] Emit start time before an await if one wasn't emitted already by sebmarkbage · Pull Request #33646 · facebook/react · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Flight] Emit start time before an await if one wasn't emitted already #33646

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 p 8000 rivacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025

Conversation

sebmarkbage
Copy link
Collaborator

There's a special case where if we create a new task, e.g. to serialize a promise like <div>{promise}</div> then that row doesn't have any start time emitted but it has a task.time inherited. We mostly don't need this because every other operation emits its own start time. E.g. when we started rendering a Server Component or the real start time of a real await.

For these implied awaits we don't have a start time. Ideally it would probably be when we started the serialization, like when we called .then() but we can't just emit that eagerly and we can't just advance the task.time because that time represents the last render or previous await and we use that to cut off awaits. However for this case we don't want to cut off any inner awaits inside the node we're serializing if they happened before the .then().

Therefore, I just use the time of the previous operation - which is likely either the resolution of a previous promise that blocked the <div> like the promise of the Server Component that rendered it, or just the start of the Server Component if it was sync.

@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Jun 25, 2025
@react-sizebot
Copy link

Comparing: 9b2a545...0a51593

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.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 530.57 kB 530.57 kB = 93.67 kB 93.67 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 651.66 kB 651.66 kB = 114.79 kB 114.79 kB
facebook-www/ReactDOM-prod.classic.js = 674.81 kB 674.81 kB = 118.78 kB 118.78 kB
facebook-www/ReactDOM-prod.modern.js = 665.30 kB 665.30 kB = 117.19 kB 117.19 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 0a51593

@sebmarkbage sebmarkbage merged commit 9406162 into facebook:main Jun 25, 2025
247 checks passed
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
0