Skip to content

Commit 378973b

Browse files
eps1lonunstubbable
andauthored
[Flight] Move react-server-dom-webpack/*.unbundled to private react-server-dom-unbundled (#35290)
Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de>
1 parent 3016ff8 commit 378973b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2908
-137
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ module.exports = {
331331
'packages/react-server-dom-turbopack/**/*.js',
332332
'packages/react-server-dom-parcel/**/*.js',
333333
'packages/react-server-dom-fb/**/*.js',
334+
'packages/react-server-dom-unbundled/**/*.js',
334335
'packages/react-test-renderer/**/*.js',
335336
'packages/react-debug-tools/**/*.js',
336337
'packages/react-devtools-extensions/**/*.js',

.github/workflows/runtime_build_and_test.yml

Lines changed: 30 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
path: |
4343
**/node_modules
44-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
44+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
4545
lookup-only: true
4646
- uses: actions/setup-node@v4
4747
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -55,10 +55,8 @@ jobs:
5555
with:
5656
path: |
5757
**/node_modules
58-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
59-
restore-keys: |
60-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
61-
runtime-node_modules-v6-
58+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
59+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
6260
- run: yarn install --frozen-lockfile
6361
if: steps.node_modules.outputs.cache-hit != 'true'
6462
- name: Save cache
@@ -67,7 +65,7 @@ jobs:
6765
with:
6866
path: |
6967
**/node_modules
70-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
68+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
7169

7270
runtime_compiler_node_modules_cache:
7371
name: Cache Runtime, Compiler node_modules
@@ -82,7 +80,7 @@ jobs:
8280
with:
8381
path: |
8482
**/node_modules
85-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
83+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
8684
lookup-only: true
8785
- uses: actions/setup-node@v4
8886
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -98,10 +96,8 @@ jobs:
9896
with:
9997
path: |
10098
**/node_modules
101-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
102-
restore-keys: |
103-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
104-
runtime-and-compiler-node_modules-v6-
99+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
100+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
105101
- run: yarn install --frozen-lockfile
106102
if: steps.node_modules.outputs.cache-hit != 'true'
107103
- run: yarn --cwd compiler install --frozen-lockfile
@@ -112,7 +108,7 @@ jobs:
112108
with:
113109
path: |
114110
**/node_modules
115-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
111+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
116112

117113
# ----- FLOW -----
118114
discover_flow_inline_configs:
@@ -154,10 +150,8 @@ jobs:
154150
with:
155151
path: |
156152
**/node_modules
157-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
158-
restore-keys: |
159-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
160-
runtime-node_modules-v6-
153+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
154+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
161155
- name: Ensure clean build directory
162156
run: rm -rf build
163157
- run: yarn install --frozen-lockfile
@@ -184,10 +178,8 @@ jobs:
184178
with:
185179
path: |
186180
**/node_modules
187-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
188-
restore-keys: |
189-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
190-
runtime-node_modules-v6-
181+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
182+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
191183
- name: Ensure clean build directory
192184
run: rm -rf build
193185
- run: yarn install --frozen-lockfile
@@ -216,7 +208,7 @@ jobs:
216208
with:
217209
path: |
218210
**/node_modules
219-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
211+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
220212
- name: Ensure clean build directory
221213
run: rm -rf build
222214
- run: yarn install --frozen-lockfile
@@ -274,10 +266,8 @@ jobs:
274266
with:
275267
path: |
276268
**/node_modules
277-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
278-
restore-keys: |
279-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
280-
runtime-and-compiler-node_modules-v6-
269+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
270+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
281271
- name: Ensure clean build directory
282272
run: rm -rf build
283273
- run: yarn install --frozen-lockfile
@@ -306,7 +296,7 @@ jobs:
306296
with:
307297
path: |
308298
**/node_modules
309-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
299+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
310300
- name: Install runtime dependencies
311301
run: yarn install --frozen-lockfile
312302
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -349,10 +339,8 @@ jobs:
349339
with:
350340
path: |
351341
**/node_modules
352-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
353-
restore-keys: |
354-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
355-
runtime-and-compiler-node_modules-v6-
342+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
343+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
356344
- name: Ensure clean build directory
357345
run: rm -rf build
358346
- run: yarn install --frozen-lockfile
@@ -440,10 +428,8 @@ jobs:
440428
with:
441429
path: |
442430
**/node_modules
443-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
444-
restore-keys: |
445-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
446-
runtime-and-compiler-node_modules-v6-
431+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
432+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
447433
- name: Ensure clean build directory
448434
run: rm -rf build
449435
- run: yarn install --frozen-lockfile
@@ -483,10 +469,8 @@ jobs:
483469
with:
484470
path: |
485471
**/node_modules
486-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
487-
restore-keys: |
488-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
489-
runtime-node_modules-v6-
472+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
473+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
490474
- name: Ensure clean build directory
491475
run: rm -rf build
492476
- run: yarn install --frozen-lockfile
@@ -548,10 +532,8 @@ jobs:
548532
with:
549533
path: |
550534
**/node_modules
551-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
552-
restore-keys: |
553-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
554-
runtime-node_modules-v6-
535+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
536+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
555537
- name: Ensure clean build directory
556538
run: rm -rf build
557539
- run: yarn install --frozen-lockfile
@@ -588,10 +570,8 @@ jobs:
588570
with:
589571
path: |
590572
**/node_modules
591-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
592-
restore-keys: |
593-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
594-
runtime-node_modules-v6-
573+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
574+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
595575
- name: Ensure clean build directory
596576
run: rm -rf build
597577
- run: yarn install --frozen-lockfile
@@ -740,10 +720,8 @@ jobs:
740720
with:
741721
path: |
742722
**/node_modules
743-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
744-
restore-keys: |
745-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
746-
runtime-node_modules-v6-
723+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
724+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
747725
- name: Ensure clean build directory
748726
run: rm -rf build
749727
- run: yarn install --frozen-lockfile
@@ -802,10 +780,8 @@ jobs:
802780
with:
803781
path: |
804782
**/node_modules
805-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
806-
restore-keys: |
807-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
808-
runtime-node_modules-v6-
783+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
784+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
809785
- name: Ensure clean build directory
810786
run: rm -rf build
811787
- run: yarn install --frozen-lockfile

fixtures/flight/loader/region.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
load as reactLoad,
44
getSource as getSourceImpl,
55
transformSource as reactTransformSource,
6-
} from 'react-server-dom-webpack/node-loader';
6+
} from 'react-server-dom-unbundled/node-loader';
77

88
export {resolve};
99

fixtures/flight/server/global.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const http = require('http');
3636
const React = require('react');
3737

3838
const {renderToPipeableStream} = require('react-dom/server');
39-
const {createFromNodeStream} = require('react-server-dom-webpack/client');
39+
const {createFromNodeStream} = require('react-server-dom-unbundled/client');
4040
const {PassThrough} = require('stream');
4141

4242
const app = express();

fixtures/flight/server/region.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
const path = require('path');
66
const url = require('url');
77

8-
const register = require('react-server-dom-webpack/node-register');
8+
const register = require('react-server-dom-unbundled/node-register');
9+
// TODO: This seems to have no effect anymore. Remove?
910
register();
1011

1112
const babelRegister = require('@babel/register');
@@ -76,7 +77,7 @@ function getDebugChannel(req) {
7677

7778
async function renderApp(res, returnValue, formState, noCache, debugChannel) {
7879
const {renderToPipeableStream} = await import(
79-
'react-server-dom-webpack/server'
80+
'react-server-dom-unbundled/server'
8081
);
8182
// const m = require('../src/App.js');
8283
const m = await import('../src/App.js');
@@ -134,7 +135,7 @@ async function renderApp(res, returnValue, formState, noCache, debugChannel) {
134135

135136
async function prerenderApp(res, returnValue, formState, noCache) {
136137
const {prerenderToNodeStream} = await import(
137-
'react-server-dom-webpack/static'
138+
'react-server-dom-unbundled/static'
138139
);
139140
// const m = require('../src/App.js');
140141
const m = await import('../src/App.js');
@@ -202,7 +203,7 @@ app.get('/', async function (req, res) {
202203
app.post('/', bodyParser.text(), async function (req, res) {
203204
const noCache = req.headers['cache-control'] === 'no-cache';
204205
const {decodeReply, decodeReplyFromBusboy, decodeAction, decodeFormState} =
205-
await import('react-server-dom-webpack/server');
206+
await import('react-server-dom-unbundled/server');
206207
const serverReference = req.get('rsc-action');
207208
if (serverReference) {
208209
// This is the client-side case

fixtures/flight/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import {renderToReadableStream} from 'react-server-dom-webpack/server';
2+
import {renderToReadableStream} from 'react-server-dom-unbundled/server';
33
import {createFromReadableStream} from 'react-server-dom-webpack/client';
44
import {PassThrough, Readable} from 'stream';
55

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"build-for-devtools": "cross-env yarn build react/index,react/jsx,react/compiler-runtime,react-dom/index,react-dom/client,react-dom/unstable_testing,react-dom/test-utils,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE --release-channel=experimental",
127127
"build-for-devtools-dev": "yarn build-for-devtools --type=NODE_DEV",
128128
"build-for-devtools-prod": "yarn build-for-devtools --type=NODE_PROD",
129-
"build-for-flight-dev": "cross-env RELEASE_CHANNEL=experimental node ./scripts/rollup/build.js react/index,react/jsx,react.react-server,react-dom/index,react-dom/client,react-dom/server,react-dom.react-server,react-dom-server.node,react-dom-server-legacy.node,scheduler,react-server-dom-webpack/ --type=NODE_DEV,ESM_PROD,NODE_ES2015 && mv ./build/node_modules ./build/oss-experimental",
129+
"build-for-flight-dev": "cross-env RELEASE_CHANNEL=experimental node ./scripts/rollup/build.js react/index,react/jsx,react.react-server,react-dom/index,react-dom/client,react-dom/server,react-dom.react-server,react-dom-server.node,react-dom-server-legacy.node,scheduler,react-server-dom-webpack/,react-server-dom-unbundled/ --type=NODE_DEV,ESM_PROD,NODE_ES2015 && mv ./build/node_modules ./build/oss-experimental",
130130
"build-for-vt-dev": "cross-env RELEASE_CHANNEL=experimental node ./scripts/rollup/build.js react/index,react/jsx,react-dom/index,react-dom/client,react-dom/server,react-dom-server.node,react-dom-server-legacy.node,scheduler --type=NODE_DEV && mv ./build/node_modules ./build/oss-experimental",
131131
"flow-typed-install": "yarn flow-typed install --skip --skipFlowRestart --ignore-deps=dev",
132132
"linc": "node ./scripts/tasks/linc.js",

packages/react-client/src/forks/ReactFlightClientConfig.dom-node-webpack.js renamed to packages/react-client/src/forks/ReactFlightClientConfig.dom-node-unbundled.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
*
77
* @flow
88
*/
9+
910
export {default as rendererVersion} from 'shared/ReactVersion';
10-
export const rendererPackageName = 'react-server-dom-webpack';
11+
export const rendererPackageName = 'react-server-dom-unbundled';
1112

1213
export * from 'react-client/src/ReactFlightClientStreamConfigNode';
1314
export * from 'react-client/src/ReactClientConsoleConfigServer';
14-
export * from 'react-server-dom-webpack/src/client/ReactFlightClientConfigBundlerWebpack';
15-
export * from 'react-server-dom-webpack/src/client/ReactFlightClientConfigBundlerWebpackServer';
16-
export * from 'react-server-dom-webpack/src/client/ReactFlightClientConfigTargetWebpackServer';
15+
export * from 'react-server-dom-unbundled/src/client/ReactFlightClientConfigBundlerNode';
16+
export * from 'react-server-dom-unbundled/src/client/ReactFlightClientConfigTargetNodeServer';
1717
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';
1818
export const usedWithSSR = true;

packages/react-client/src/forks/ReactFlightClientConfig.dom-node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
*
77
* @flow
88
*/
9-
109
export {default as rendererVersion} from 'shared/ReactVersion';
1110
export const rendererPackageName = 'react-server-dom-webpack';
1211

1312
export * from 'react-client/src/ReactFlightClientStreamConfigNode';
1413
export * from 'react-client/src/ReactClientConsoleConfigServer';
15-
export * from 'react-server-dom-webpack/src/client/ReactFlightClientConfigBundlerNode';
14+
export * from 'react-server-dom-webpack/src/client/ReactFlightClientConfigBundlerWebpack';
15+
export * from 'react-server-dom-webpack/src/client/ReactFlightClientConfigBundlerWebpackServer';
1616
export * from 'react-server-dom-webpack/src/client/ReactFlightClientConfigTargetWebpackServer';
1717
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';
1818
export const usedWithSSR = true;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# react-server-dom-unbundled
2+
3+
Test-only React Flight bindings for DOM using Node.js.
4+
5+
This only exists for internal testing.

0 commit comments

Comments
 (0)