react/packages/react-server-dom-esm
Sebastian Markbåge e81fcfe3f2
[Flight] Expose registerServerReference from the client builds (#32534)
This is used to register Server References that exist in the current
environment but also exists in the server it might call into. Such as a
remote server.

If the value comes from the remote server in the first place then this
is called automatically to ensure that you can pass a reference back to
where it came from - even if the `serverModuleMap` option is used. This
was already the case when `serverModuleMap` wasn't passed. This is how
you can pass server references back to the server. However, when we
added `serverModuleMap` that pass was skipped because we were getting
real functions instead of proxies.

For functions that wasn't yet passed from the remote server to the
current server, we can register them eagerly just like we do for
`import('/server').registerServerReference()`. You can now also do this
with `import('/client').registerServerReference()`. We could make them
shared so you only have to do this once but it might not be possible to
pass to the remote server and the remote server might not even be the
same RSC renderer. Therefore I split them. It's up to the compiler
whether it should do that or not. It has to know that any function you
might call might be able to receive it. This is currently global to a
specific RSC renderer.
2025-03-05 22:16:56 -05:00
..
esm Don't minify symbols in production builds (#28881) 2024-04-20 11:23:46 -04:00
npm [Flight] rename prerender to unstable_prerender and include in stable channel (#31724) 2024-12-10 11:51:39 -08:00
src [Flight] Expose registerServerReference from the client builds (#32534) 2025-03-05 22:16:56 -05:00
client.browser.js [Flight] reorganize code for forked entrypoints (#30702) 2024-08-14 18:10:40 -07:00
client.js [Flight] Add bundler-less version of RSC using plain ESM (#26889) 2023-06-03 15:58:24 -04:00
client.node.js [Flight] reorganize code for forked entrypoints (#30702) 2024-08-14 18:10:40 -07:00
index.js [Flight] Add bundler-less version of RSC using plain ESM (#26889) 2023-06-03 15:58:24 -04:00
package.json Bump next prerelease version numbers (#31676) 2024-12-12 14:10:46 -05:00
README.md [Flight] Add bundler-less version of RSC using plain ESM (#26889) 2023-06-03 15:58:24 -04:00
server.js [Flight] Add bundler-less version of RSC using plain ESM (#26889) 2023-06-03 15:58:24 -04:00
server.node.js [Flight] reorganize code for forked entrypoints (#30702) 2024-08-14 18:10:40 -07:00
static.js [Flight] Implement prerender (#30686) 2024-08-15 14:28:28 -07:00
static.node.js [Flight] rename prerender to unstable_prerender and include in stable channel (#31724) 2024-12-10 11:51:39 -08:00

react-server-dom-esm

Experimental React Flight bindings for DOM using ESM.

Use it at your own risk.