mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
We added an experimental `prerender` API to flight. This change exposes this API in stable channels prefixed as `unstable_prerender`. We have high confidence this API should exist but because we have not yet settled on how to handle resuming/replaying of RSC streams we may need to change the API contract to suit future needs. This release will allow us to get more usage out of the existing implemented functionality without requiring you to use experimental builds which will open up greater adoption and opportunity for feedback. the `prerender` implementation is documented in the `react-server` package. As with all RSC APIs implemented in bundler specific binding packages these aren't intended to be called by end users but instead be used by frameworks implementing React Server Components. Previously `prerender` was exposed unprefixed and only in the experimental channel. This PR renames the export across all channels to `unstable_prerender` so users of this previously unprefixed api will need to update to the unstable form. This isn't a breaking change because it was only exposed in the experimental channel which does not follow semver. The reason we don't expose it under both names is that users may feature detect the unprefixed form and then when we finally do ship it as unprefixed we may change the function signature and break this code. Changing the name now is much safer.
13 lines
353 B
JavaScript
13 lines
353 B
JavaScript
'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.unstable_prerenderToNodeStream) {
|
|
exports.unstable_prerenderToNodeStream = s.unstable_prerenderToNodeStream;
|
|
}
|