-
Notifications
You must be signed in to change notification settings - Fork 30.5k
[react-dom] Add renderToPipeableStream and renderToReadableStream
#59748
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
[react-dom] Add renderToPipeableStream and renderToReadableStream
#59748
Conversation
https://github.com/facebook/react/blob/main/packages/react-dom/server.node.js https://github.com/facebook/react/blob/v18.0.0/packages/react-dom/src/server/ReactDOMFizzServerNode.js https://github.com/facebook/react/blob/v18.0.0/packages/react-dom/server.browser.js https://github.com/facebook/react/blob/v18.0.0/packages/react-dom/src/server/ReactDOMFizzServerBrowser.js
| * an HTML string. The HTML output by this stream is exactly equal to what | ||
| * `ReactDOMServer.renderToString()` would return. | ||
| * | ||
| * @deprecated |
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.
|
Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files. react-dom (unpkg)was missing the following properties:
|
|
@eps1lon Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 59748,
"author": "eps1lon",
"headCommitOid": "ef79a845efad2b2878f7faa848f404223ed09023",
"mergeBaseOid": "55dc209ceb6dbcd59c4c68cc8dfb77faadd9de12",
"lastPushDate": "2022-04-07T18:50:33.000Z",
"lastActivityDate": "2022-04-14T21:02:59.000Z",
"mergeOfferDate": "2022-04-14T21:00:26.000Z",
"mergeRequestDate": "2022-04-14T21:02:59.000Z",
"mergeRequestUser": "eps1lon",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "react-dom",
"kind": "edit",
"files": [
{
"path": "types/react-dom/server.d.ts",
"kind": "definition"
},
{
"path": "types/react-dom/test/react-dom-tests.tsx",
"kind": "test"
}
],
"owners": [
"MartynasZilinskas",
"theruther4d",
"Jessidhia",
"eps1lon"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "jakebailey",
"date": "2022-04-14T20:59:46.000Z",
"isMaintainer": true
},
{
"type": "approved",
"reviewer": "sebmarkbage",
"date": "2022-04-07T19:36:42.000Z",
"isMaintainer": false
}
],
"mainBotCommentID": 1092100770,
"ciResult": "pass"
} |
|
🔔 @MartynasZilinskas @theruther4d @Jessidhia — please review this PR in the next few days. Be sure to explicitly select |
|
@MartynasZilinskas @theruther4d @Jessidhia up) We need these types) |
|
Ready to merge |
|
It looks like this hasn't been released yet? https://unpkg.com/@types/react-dom/server.d.ts |
|
Ah, it has been released as 18.0.1 (source), but for some reason npm thinks that 18.0.0 is the latest version. |
Nice catch! Seems like the types publisher did not point $ npm dist-tag @types/react-dom
latest: 18.0.0 |
|
Tracking outdated distribution tag in microsoft/DefinitelyTyped-tools#443 |
renderToPipeableStreamdocsrenderToReadableStreamdocsrenderToPipeableStreamentrypoint points to https://github.com/facebook/react/blob/v18.0.0/packages/react-dom/src/server/ReactDOMFizzServerNode.jsrenderToReadableStreamentrypoint points tohttps://github.com/facebook/react/blob/v18.0.0/packages/react-dom/src/server/ReactDOMFizzServerBrowser.js
/cc @sebmarkbage