-
Notifications
You must be signed in to change notification settings - Fork 47.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prerendering in flight is similar to prerendering in Fizz. Instead of receiving a result (the stream) immediately a promise is returned which resolves to the stream when the prerender is complete. The promise will reject if the flight render fatally errors otherwise it will resolve when the render is completed or is aborted.
- Loading branch information
Showing
59 changed files
with
1,174 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
throw new Error( | ||
'The React Server Writer cannot be used outside a react-server environment. ' + | ||
'You must configure Node.js using the `--conditions react-server` flag.' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
|
||
var s; | ||
if (process.env.NODE_ENV === 'production') { | ||
s = require('./cjs/react-server-dom-esm-server.node.production.js'); | ||
} else { | ||
s = require('./cjs/react-server-dom-esm-server.node.development.js'); | ||
} | ||
|
||
if (s.prerenderToNodeStream) { | ||
exports.prerenderToNodeStream = s.prerenderToNodeStream; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/react-server-dom-esm/src/server/react-flight-dom-server.node.stable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
export { | ||
renderToPipeableStream, | ||
decodeReplyFromBusboy, | ||
decodeReply, | ||
decodeAction, | ||
decodeFormState, | ||
registerServerReference, | ||
registerClientReference, | ||
createTemporaryReferenceSet, | ||
} from './ReactFlightDOMServerNode'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
throw new Error( | ||
'The React Server cannot be used outside a react-server environment. ' + | ||
'You must configure Node.js using the `--conditions react-server` flag.', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
export {prerenderToNodeStream} from './src/server/react-flight-dom-server.node'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
|
||
var s; | ||
if (process.env.NODE_ENV === 'production') { | ||
s = require('./cjs/react-server-dom-turbopack-server.browser.production.js'); | ||
} else { | ||
s = require('./cjs/react-server-dom-turbopack-server.browser.development.js'); | ||
} | ||
|
||
if (s.prerender) { | ||
exports.prerender = s.prerender; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
|
||
var s; | ||
if (process.env.NODE_ENV === 'production') { | ||
s = require('./cjs/react-server-dom-turbopack-server.edge.production.js'); | ||
} else { | ||
s = require('./cjs/react-server-dom-turbopack-server.edge.development.js'); | ||
} | ||
|
||
if (s.prerender) { | ||
exports.prerender = s.prerender; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
throw new Error( | ||
'The React Server Writer cannot be used outside a react-server environment. ' + | ||
'You must configure Node.js using the `--conditions react-server` flag.' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
|
||
var s; | ||
if (process.env.NODE_ENV === 'production') { | ||
s = require('./cjs/react-server-dom-turbopack-server.node.production.js'); | ||
} else { | ||
s = require('./cjs/react-server-dom-turbopack-server.node.development.js'); | ||
} | ||
|
||
if (s.prerenderToNodeStream) { | ||
exports.prerenderToNodeStream = s.prerenderToNodeStream; | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/react-server-dom-turbopack/npm/static.node.unbundled.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
|
||
var s; | ||
if (process.env.NODE_ENV === 'production') { | ||
s = require('./cjs/react-server-dom-turbopack-server.node.unbundled.production.js'); | ||
} else { | ||
s = require('./cjs/react-server-dom-turbopack-server.node.unbundled.development.js'); | ||
} | ||
|
||
if (s.prerenderToNodeStream) { | ||
exports.prerenderToNodeStream = s.prerenderToNodeStream; | ||
} |
Oops, something went wrong.