GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Flight] Serialize pending server components by reference (lazy component) by sebmarkbage · Pull Request #20137 · react/react

Conversation

@sebmarkbage

@sebmarkbage sebmarkbage commented Oct 30, 2020

Copy link
Copy Markdown
Contributor

This now means that if a server component suspends, its value becomes a React.lazy object. I.e. the element that rendered the server component gets replaced with a lazy node.

As of #19033 lazy objects can be rendered in the node position. This allows us to suspend at the location of the server component while we're waiting on its content.

Now server components has the same capabilities as Blocks to progressively reveal its content.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sebmarkbage
Serialize pending server components by reference (lazy component)
4cf2540
This now means that if a server component suspends, its value becomes a
React.lazy object. I.e. the element that rendered the server component
gets replaced with a lazy node.

As of react#19033 lazy objects can be rendered in the node position. This allows
us to suspend at the location of the server component while we're waiting
on its content.

Now server components has the same capabilities as Blocks to progressively
reveal its content.
@sebmarkbage
sebmarkbage requested a review from gaearon October 30, 2020 23:50
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Oct 30, 2020
sebmarkbage
sebmarkbage commented Oct 30, 2020
View reviewed changes
Comment thread packages/react-server/src/ReactFlightServer.js
break;
}
}
moduleChunks.splice(0, i);

@sebmarkbage sebmarkbage Oct 30, 2020

Copy link
Copy Markdown
Contributor Author

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.

This is a bug fix that this test revealed. This causes the connection to close to early because we keep emitting module chunks over and over since they don't get deleted.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@codesandbox-ci

codesandbox-ci Bot commented Oct 30, 2020

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4cf2540:

Sandbox Source
React Configuration
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sizebot

sizebot commented Oct 30, 2020

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 4cf2540

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sizebot

sizebot commented Oct 30, 2020

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against 4cf2540

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gaearon
gaearon approved these changes Oct 31, 2020
View reviewed changes

@gaearon gaearon left a comment

Copy link
Copy Markdown
Collaborator

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.

beautiful

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

NE-SmallTown reacted with laugh emoji
All reactions
  • 😄 1 reaction
@sebmarkbage
sebmarkbage merged commit 3fbd47b into react:master Oct 31, 2020
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Nov 9, 2020
@sebmarkbage @facebook-github-bot
React Native sync for revisions 4e5d7fa...454c221
69ade59
Summary:
Base sync before adding Flight files.

This sync includes the following changes:
- **[454c221](react/react@454c2211c )**: Refactor SchedulerHostConfigs ([#20025](react/react#20025)) //<Ricky>//
- **[56e9fee](react/react@56e9feead )**: Remove Blocks ([#20138](react/react#20138)) //<Sebastian Markbåge>//
- **[3fbd47b](react/react@3fbd47b86 )**: Serialize pending server components by reference (lazy component) ([#20137](react/react#20137)) //<Sebastian Markbåge>//
- **[930ce7c](react/react@930ce7c15 )**: Allow values to be encoded by "reference" to a value rather than the value itself ([#20136](react/react#20136)) //<Sebastian Markbåge>//
- **[39eb6d1](react/react@39eb6d176 )**: Rename ([#20134](react/react#20134)) //<Sebastian Markbåge>//
- **[ffd8423](react/react@ffd842335 )**: [Flight] Add support for Module References in transport protocol ([#20121](react/react#20121)) //<Sebastian Markbåge>//
- **[343d7a4](react/react@343d7a4a7 )**: Fast Refresh: Don't block DevTools commit hook ([#20129](react/react#20129)) //<Brian Vaughn>//
- **[779a472](react/react@779a472b0 )**: Prevent inlining into recursive commit functions ([#20105](react/react#20105)) //<Andrew Clark>//
- **[25b18d3](react/react@25b18d31c )**: Traverse commit phase effects iteratively ([#20094](react/react#20094)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 4e5d7fa...454c221

Reviewed By: rickhanlonii

Differential Revision: D24698701

fbshipit-source-id: dfaf692b1051150355dece1657764a484b7ae603
koto pushed a commit to koto/react that referenced this pull request Jun 15, 2021
@sebmarkbage @koto
Serialize pending server components by reference (lazy component) (re…
9d5cc12
…act#20137)

This now means that if a server component suspends, its value becomes a
React.lazy object. I.e. the element that rendered the server component
gets replaced with a lazy node.

As of react#19033 lazy objects can be rendered in the node position. This allows
us to suspend at the location of the server component while we're waiting
on its content.

Now server components has the same capabilities as Blocks to progressively
reveal its content.
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
@sebmarkbage
Serialize pending server components by reference (lazy component) (re…
8fccc6a
…act#20137)

This now means that if a server component suspends, its value becomes a
React.lazy object. I.e. the element that rendered the server component
gets replaced with a lazy node.

As of react#19033 lazy objects can be rendered in the node position. This allows
us to suspend at the location of the server component while we're waiting
on its content.

Now server components has the same capabilities as Blocks to progressively
reveal its content.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@sebmarkbage
Serialize pending server components by reference (lazy component) (re…
4a2d0c0
…act#20137)

This now means that if a server component suspends, its value becomes a
React.lazy object. I.e. the element that rendered the server component
gets replaced with a lazy node.

As of react#19033 lazy objects can be rendered in the node position. This allows
us to suspend at the location of the server component while we're waiting
on its content.

Now server components has the same capabilities as Blocks to progressively
reveal its content.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gaearon gaearon gaearon approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@sebmarkbage @sizebot @gaearon @facebook-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.