react/packages/react-server-dom-webpack/npm/static.node.js
Josh Story 7cb356e862
[Flight] rename prerender to unstable_prerender and include in stable channel (#31724)
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.
2024-12-10 11:51:39 -08:00

13 lines
349 B
JavaScript

'use strict';
var s;
if (process.env.NODE_ENV === 'production') {
s = require('./cjs/react-server-dom-webpack-server.node.production.js');
} else {
s = require('./cjs/react-server-dom-webpack-server.node.development.js');
}
if (s.unstable_prerenderToNodeStream) {
exports.unstable_prerenderToNodeStream = s.unstable_prerenderToNodeStream;
}