GeezerVison is showing github.com — [Flight] Allow values to be encoded by "reference" to a value rather than the value itself by sebmarkbage · Pull Request #20136 · react/react
Conversation
sebmarkbage
commented
Oct 30, 2020
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
These references are currently transformed into React.lazy values. We can use these in React positions like element type or node position.
This could be expanded to a more general concept like Suspensey Promises, asset references or JSResourceReferences.
For now it's only used in React Element type position.
The purpose of these is to let you suspend deeper in the tree.
"$1234" in the JSON gets replaced with the actual value of row/chunk number 1234.
"@1234" in the JSON gets replaced with a React.lazy object that when read either suspends or returns the actual value of row/chunk number 1234.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
NE-SmallTown reacted with eyes emoji
…value itself
These references are currently transformed into React.lazy values. We can use these in
React positions like element type or node position.
This could be expanded to a more general concept like Suspensey Promises, asset references or JSResourceReferences.
For now it's only used in React Element type position.
The purpose of these is to let you suspend deeper in the tree.
|
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 e87f38c:
| Sandbox |
Source |
| React |
Configuration |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Details of bundled changes.
Comparing: 39eb6d1...e87f38c
react-transport-dom-relay
| File |
Filesize Diff |
Gzip Diff |
Prev Size |
Current Size |
Prev Gzip |
Current Gzip |
ENV |
| ReactFlightDOMRelayServer-dev.js |
+2.0% |
+2.3% |
25.04 KB |
25.54 KB |
6.45 KB |
6.6 KB |
FB_WWW_DEV |
| ReactFlightDOMRelayServer-prod.js |
🔺+0.7% |
🔺+0.7% |
14.91 KB |
15.01 KB |
3.88 KB |
3.91 KB |
FB_WWW_PROD |
| ReactFlightDOMRelayClient-dev.js |
+4.5% |
+3.2% |
11.67 KB |
12.19 KB |
3.46 KB |
3.56 KB |
FB_WWW_DEV |
| ReactFlightDOMRelayClient-prod.js |
🔺+4.4% |
🔺+1.5% |
5.33 KB |
5.57 KB |
1.6 KB |
1.63 KB |
FB_WWW_PROD |
react-transport-dom-webpack
| File |
Filesize Diff |
Gzip Diff |
Prev Size |
Current Size |
Prev Gzip |
Current Gzip |
ENV |
| react-transport-dom-webpack-server-runtime.development.js |
0.0% |
-0.1% |
2.99 KB |
2.99 KB |
1.07 KB |
1.07 KB |
NODE_DEV |
| react-transport-dom-webpack-server-runtime.production.min.js |
0.0% |
-0.3% |
513 B |
513 B |
351 B |
350 B |
NODE_PROD |
| react-transport-dom-webpack.development.js |
+3.4% |
+2.2% |
18.19 KB |
18.81 KB |
5 KB |
5.11 KB |
UMD_DEV |
| react-transport-dom-webpack.production.min.js |
🔺+3.7% |
🔺+1.9% |
4.01 KB |
4.16 KB |
1.81 KB |
1.84 KB |
UMD_PROD |
| react-transport-dom-webpack.development.js |
+3.4% |
+2.3% |
16.97 KB |
17.55 KB |
4.88 KB |
4.99 KB |
NODE_DEV |
| react-transport-dom-webpack.production.min.js |
🔺+4.0% |
🔺+1.6% |
3.81 KB |
3.96 KB |
1.71 KB |
1.74 KB |
NODE_PROD |
| react-transport-dom-webpack-server.node.development.js |
+2.0% |
+2.2% |
24.82 KB |
25.32 KB |
6.73 KB |
6.88 KB |
NODE_DEV |
| react-transport-dom-webpack-server.browser.development.js |
+2.1% |
+2.3% |
25.45 KB |
25.98 KB |
6.6 KB |
6.75 KB |
UMD_DEV |
| react-transport-dom-webpack-server.node.production.min.js |
🔺+0.6% |
🔺+0.5% |
6.44 KB |
6.48 KB |
2.66 KB |
2.67 KB |
NODE_PROD |
| react-transport-dom-webpack-server.browser.production.min.js |
🔺+0.6% |
🔺+0.5% |
6.47 KB |
6.5 KB |
2.71 KB |
2.73 KB |
UMD_PROD |
| react-transport-dom-webpack-server.browser.development.js |
+2.1% |
+2.4% |
23.88 KB |
24.38 KB |
6.47 KB |
6.62 KB |
NODE_DEV |
| react-transport-dom-webpack-plugin.js |
0.0% |
-0.3% |
437 B |
437 B |
298 B |
297 B |
NODE_ES2015 |
| react-transport-dom-webpack-server.browser.production.min.js |
🔺+0.6% |
🔺+0.5% |
6.26 KB |
6.29 KB |
2.64 KB |
2.65 KB |
NODE_PROD |
react-client
| File |
Filesize Diff |
Gzip Diff |
Prev Size |
Current Size |
Prev Gzip |
Current Gzip |
ENV |
| react-client-flight.development.js |
+3.9% |
+2.5% |
14.95 KB |
15.53 KB |
4.37 KB |
4.48 KB |
NODE_DEV |
| react-client-flight.production.min.js |
🔺+4.4% |
🔺+1.6% |
3.4 KB |
3.55 KB |
1.54 KB |
1.57 KB |
NODE_PROD |
react-server
| File |
Filesize Diff |
Gzip Diff |
Prev Size |
Current Size |
Prev Gzip |
Current Gzip |
ENV |
| react-server-flight-server-runtime.development.js |
0.0% |
-0.2% |
2.98 KB |
2.98 KB |
1.06 KB |
1.06 KB |
NODE_DEV |
| react-server-flight-server-runtime.production.min.js |
0.0% |
-0.3% |
505 B |
505 B |
339 B |
338 B |
NODE_PROD |
| react-server-flight.development.js |
+2.1% |
+2.4% |
24.31 KB |
24.82 KB |
6.59 KB |
6.75 KB |
NODE_DEV |
| react-server-flight.production.min.js |
🔺+0.6% |
🔺+0.6% |
6.51 KB |
6.55 KB |
2.7 KB |
2.72 KB |
NODE_PROD |
| react-server.development.js |
0.0% |
-0.1% |
5.45 KB |
5.45 KB |
1.73 KB |
1.73 KB |
NODE_DEV |
| react-server.production.min.js |
0.0% |
-0.2% |
1.16 KB |
1.16 KB |
650 B |
649 B |
NODE_PROD |
Size changes (experimental)
Generated by 🚫 dangerJS against e87f38c
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Details of bundled changes.
Comparing: 39eb6d1...e87f38c
react-transport-dom-relay
| File |
Filesize Diff |
Gzip Diff |
Prev Size |
Current Size |
Prev Gzip |
Current Gzip |
ENV |
| ReactFlightDOMRelayServer-dev.js |
+2.0% |
+2.3% |
25.04 KB |
25.54 KB |
6.45 KB |
6.6 KB |
FB_WWW_DEV |
| ReactFlightDOMRelayServer-prod.js |
🔺+0.7% |
🔺+0.7% |
14.91 KB |
15.01 KB |
3.88 KB |
3.91 KB |
FB_WWW_PROD |
| ReactFlightDOMRelayClient-dev.js |
+4.5% |
+3.2% |
11.67 KB |
12.19 KB |
3.46 KB |
3.56 KB |
FB_WWW_DEV |
| ReactFlightDOMRelayClient-prod.js |
🔺+4.4% |
🔺+1.5% |
5.33 KB |
5.57 KB |
1.6 KB |
1.63 KB |
FB_WWW_PROD |
react-transport-dom-webpack
| File |
Filesize Diff |
Gzip Diff |
Prev Size |
Current Size |
Prev Gzip |
Current Gzip |
ENV |
| react-transport-dom-webpack-server-runtime.development.js |
0.0% |
-0.1% |
2.98 KB |
2.98 KB |
1.07 KB |
1.07 KB |
NODE_DEV |
| react-transport-dom-webpack-server-runtime.production.min.js |
0.0% |
-0.3% |
500 B |
500 B |
341 B |
340 B |
NODE_PROD |
| react-transport-dom-webpack.development.js |
+3.4% |
+2.3% |
18.18 KB |
18.8 KB |
4.99 KB |
5.1 KB |
UMD_DEV |
| react-transport-dom-webpack.production.min.js |
🔺+3.8% |
🔺+1.9% |
4 KB |
4.15 KB |
1.8 KB |
1.83 KB |
UMD_PROD |
| react-transport-dom-webpack.development.js |
+3.4% |
+2.2% |
16.96 KB |
17.54 KB |
4.87 KB |
4.98 KB |
NODE_DEV |
| react-transport-dom-webpack.production.min.js |
🔺+4.0% |
🔺+1.7% |
3.8 KB |
3.95 KB |
1.7 KB |
1.73 KB |
NODE_PROD |
| react-transport-dom-webpack-server.node.development.js |
+2.0% |
+2.2% |
24.8 KB |
25.31 KB |
6.72 KB |
6.88 KB |
NODE_DEV |
| react-transport-dom-webpack-server.browser.development.js |
+2.1% |
+2.3% |
25.44 KB |
25.96 KB |
6.59 KB |
6.75 KB |
UMD_DEV |
| react-transport-dom-webpack-server.node.production.min.js |
🔺+0.6% |
🔺+0.5% |
6.43 KB |
6.47 KB |
2.65 KB |
2.67 KB |
NODE_PROD |
| react-transport-dom-webpack-server.browser.production.min.js |
🔺+0.6% |
🔺+0.6% |
6.45 KB |
6.49 KB |
2.7 KB |
2.72 KB |
UMD_PROD |
| react-transport-dom-webpack-server.browser.development.js |
+2.1% |
+2.4% |
23.86 KB |
24.37 KB |
6.46 KB |
6.61 KB |
NODE_DEV |
| react-transport-dom-webpack-server.browser.production.min.js |
🔺+0.6% |
🔺+0.5% |
6.25 KB |
6.28 KB |
2.63 KB |
2.64 KB |
NODE_PROD |
react-client
| File |
Filesize Diff |
Gzip Diff |
Prev Size |
Current Size |
Prev Gzip |
Current Gzip |
ENV |
| react-client-flight.development.js |
+3.9% |
+2.5% |
14.93 KB |
15.51 KB |
4.37 KB |
4.47 KB |
NODE_DEV |
| react-client-flight.production.min.js |
🔺+4.4% |
🔺+1.7% |
3.38 KB |
3.53 KB |
1.54 KB |
1.56 KB |
NODE_PROD |
react-server
| File |
Filesize Diff |
Gzip Diff |
Prev Size |
Current Size |
Prev Gzip |
Current Gzip |
ENV |
| react-server-flight-server-runtime.development.js |
0.0% |
-0.1% |
2.97 KB |
2.97 KB |
1.06 KB |
1.05 KB |
NODE_DEV |
| react-server-flight-server-runtime.production.min.js |
0.0% |
-0.6% |
492 B |
492 B |
331 B |
329 B |
NODE_PROD |
| react-server-flight.development.js |
+2.1% |
+2.4% |
24.3 KB |
24.8 KB |
6.58 KB |
6.74 KB |
NODE_DEV |
| react-server-flight.production.min.js |
🔺+0.6% |
🔺+0.6% |
6.5 KB |
6.53 KB |
2.7 KB |
2.71 KB |
NODE_PROD |
| react-server.development.js |
0.0% |
-0.1% |
5.43 KB |
5.43 KB |
1.72 KB |
1.72 KB |
NODE_DEV |
| react-server.production.min.js |
0.0% |
-0.2% |
1.15 KB |
1.15 KB |
642 B |
641 B |
NODE_PROD |
Size changes (stable)
Generated by 🚫 dangerJS against e87f38c
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
const moduleId = request.nextChunkId++;
|
|
|
emitModuleChunk(request, moduleId, moduleMetaData);
|
|
|
return serializeIDRef(moduleId);
|
|
|
if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
|
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.
What does 1 mean here? Is this because it's a tuple?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
koto
pushed a commit
to koto/react
that referenced
this pull request
Jun 15, 2021
…value itself (react#20136)
These references are currently transformed into React.lazy values. We can use these in
React positions like element type or node position.
This could be expanded to a more general concept like Suspensey Promises, asset references or JSResourceReferences.
For now it's only used in React Element type position.
The purpose of these is to let you suspend deeper in the tree.
mrizwanashiq
pushed a commit
to mrizwanashiq/react
that referenced
this pull request
Jun 25, 2026
…value itself (react#20136)
These references are currently transformed into React.lazy values. We can use these in
React positions like element type or node position.
This could be expanded to a more general concept like Suspensey Promises, asset references or JSResourceReferences.
For now it's only used in React Element type position.
The purpose of these is to let you suspend deeper in the tree.
hanzo-dev
pushed a commit
to hanzoai/react
that referenced
this pull request
Sep 9, 2026
…value itself (react#20136)
These references are currently transformed into React.lazy values. We can use these in
React positions like element type or node position.
This could be expanded to a more general concept like Suspensey Promises, asset references or JSResourceReferences.
For now it's only used in React Element type position.
The purpose of these is to let you suspend deeper in the tree.
Reviewers
gaearon
gaearon approved these changes
lunaruan
Awaiting requested review from lunaruan
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.
|