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

[Flight] Add initial readme to react-server package #31464

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Nov 8, 2024

This readme documents React Server Components from react-server package enough to get an implementer started. It's not comprehensive but it's a beginning point and crucially adds documentation for the prerender API for Flight.

Copy link

vercel bot commented Nov 8, 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 Nov 9, 2024 0:04am

@react-sizebot
Copy link

react-sizebot commented Nov 8, 2024

The size diff is too large to display in a single comment. The GitHub action for this pull request contains an artifact called 'sizebot-message.md' with the full message.

Generated by 🚫 dangerJS against 21a343b

packages/react-server/README.md Outdated Show resolved Hide resolved
packages/react-server/README.md Outdated Show resolved Hide resolved
@@ -5,3 +5,216 @@ This is an experimental package for creating custom React streaming server rende
**Its API is not as stable as that of React, React Native, or React DOM, and does not follow the common versioning scheme.**

**Use it at your own risk.**

## Usage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be cool to include a Reference section with the exports for flight and fizz (even with just the types).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a partial reference.

This readme documents React Server Components from `react-server` package enough to get an implementor started. It's not comphrensive but it's a beginning point and crucially adds documentation for the `prerender` API for Fligth.
@gnoff gnoff merged commit ff595de into facebook:main Nov 9, 2024
184 checks passed
@gnoff gnoff deleted the document-flight branch November 9, 2024 00:07

### `stopFlowing(request: Request): void`

If you need to pause or permanently end the writing of any additional serialized output for this request you can call `stopFlowing(request)`. You may start flowing again after you've stopped. This is how you would implement backpressure support for streams for instance. It's important to note that stopping flowing is not going to stop rendering it simply causes the request to buffer any serialized chunks until they are requested again with `startFlowing()`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an implementation detail though. E.g. Fizz doesn't just simply buffer serialized chunks. It's likely Flight also would become more lazy in that regard.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g. it would be the wrong take away that it would be better for a consumer to just manage its own buffer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

5 participants