Skip to content

Commit dd05198

Browse files
sebmarkbageunstubbableeps1lon
committed
Patch Promise cycles and toString on Server Functions
[Flight] Move `react-server-dom-webpack/*.unbundled` to private `react-server-dom-unbundled` (#35290) Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de> Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
1 parent 0eeded6 commit dd05198

58 files changed

Lines changed: 3388 additions & 368 deletions

File tree

Some content is hidden

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

‎.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
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
path: |
4747
**/node_modules
48-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
48+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
4949
lookup-only: true
5050
- uses: actions/setup-node@v4
5151
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -59,10 +59,8 @@ jobs:
5959
with:
6060
path: |
6161
**/node_modules
62-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63-
restore-keys: |
64-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
65-
runtime-node_modules-v6-
62+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
6664
- run: yarn install --frozen-lockfile
6765
if: steps.node_modules.outputs.cache-hit != 'true'
6866
- name: Save cache
@@ -71,7 +69,7 @@ jobs:
7169
with:
7270
path: |
7371
**/node_modules
74-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
72+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
7573

7674
runtime_compiler_node_modules_cache:
7775
name: Cache Runtime, Compiler node_modules
@@ -86,7 +84,7 @@ jobs:
8684
with:
8785
path: |
8886
**/node_modules
89-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
87+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
9088
lookup-only: true
9189
- uses: actions/setup-node@v4
9290
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -102,10 +100,8 @@ jobs:
102100
with:
103101
path: |
104102
**/node_modules
105-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
106-
restore-keys: |
107-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
108-
runtime-and-compiler-node_modules-v6-
103+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
104+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
109105
- run: yarn install --frozen-lockfile
110106
if: steps.node_modules.outputs.cache-hit != 'true'
111107
- run: yarn --cwd compiler install --frozen-lockfile
@@ -116,7 +112,7 @@ jobs:
116112
with:
117113
path: |
118114
**/node_modules
119-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
115+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
120116

121117
# ----- FLOW -----
122118
discover_flow_inline_configs:
@@ -158,10 +154,8 @@ jobs:
158154
with:
159155
path: |
160156
**/node_modules
161-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
162-
restore-keys: |
163-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
164-
runtime-node_modules-v6-
157+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
158+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
165159
- name: Ensure clean build directory
166160
run: rm -rf build
167161
- run: yarn install --frozen-lockfile
@@ -188,10 +182,8 @@ jobs:
188182
with:
189183
path: |
190184
**/node_modules
191-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
192-
restore-keys: |
193-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
194-
runtime-node_modules-v6-
185+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
186+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
195187
- name: Ensure clean build directory
196188
run: rm -rf build
197189
- run: yarn install --frozen-lockfile
@@ -220,7 +212,7 @@ jobs:
220212
with:
221213
path: |
222214
**/node_modules
223-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
215+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
224216
- name: Ensure clean build directory
225217
run: rm -rf build
226218
- run: yarn install --frozen-lockfile
@@ -278,10 +270,8 @@ jobs:
278270
with:
279271
path: |
280272
**/node_modules
281-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
282-
restore-keys: |
283-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
284-
runtime-and-compiler-node_modules-v6-
273+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
274+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
285275
- name: Ensure clean build directory
286276
run: rm -rf build
287277
- run: yarn install --frozen-lockfile
@@ -310,7 +300,7 @@ jobs:
310300
with:
311301
path: |
312302
**/node_modules
313-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
303+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
314304
- name: Install runtime dependencies
315305
run: yarn install --frozen-lockfile
316306
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -353,10 +343,8 @@ jobs:
353343
with:
354344
path: |
355345
**/node_modules
356-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
357-
restore-keys: |
358-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
359-
runtime-and-compiler-node_modules-v6-
346+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
347+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
360348
- name: Ensure clean build directory
361349
run: rm -rf build
362350
- run: yarn install --frozen-lockfile
@@ -444,10 +432,8 @@ jobs:
444432
with:
445433
path: |
446434
**/node_modules
447-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
448-
restore-keys: |
449-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
450-
runtime-and-compiler-node_modules-v6-
435+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
436+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
451437
- name: Ensure clean build directory
452438
run: rm -rf build
453439
- run: yarn install --frozen-lockfile
@@ -487,10 +473,8 @@ jobs:
487473
with:
488474
path: |
489475
**/node_modules
490-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
491-
restore-keys: |
492-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
493-
runtime-node_modules-v6-
476+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
477+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
494478
- name: Ensure clean build directory
495479
run: rm -rf build
496480
- run: yarn install --frozen-lockfile
@@ -552,10 +536,8 @@ jobs:
552536
with:
553537
path: |
554538
**/node_modules
555-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
556-
restore-keys: |
557-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
558-
runtime-node_modules-v6-
539+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
540+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
559541
- name: Ensure clean build directory
560542
run: rm -rf build
561543
- run: yarn install --frozen-lockfile
@@ -592,10 +574,8 @@ jobs:
592574
with:
593575
path: |
594576
**/node_modules
595-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
596-
restore-keys: |
597-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
598-
runtime-node_modules-v6-
577+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
578+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
599579
- name: Ensure clean build directory
600580
run: rm -rf build
601581
- run: yarn install --frozen-lockfile
@@ -744,10 +724,8 @@ jobs:
744724
with:
745725
path: |
746726
**/node_modules
747-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
748-
restore-keys: |
749-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
750-
runtime-node_modules-v6-
727+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
728+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
751729
- name: Ensure clean build directory
752730
run: rm -rf build
753731
- run: yarn install --frozen-lockfile
@@ -806,10 +784,8 @@ jobs:
806784
with:
807785
path: |
808786
**/node_modules
809-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
810-
restore-keys: |
811-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
812-
runtime-node_modules-v6-
787+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
788+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
813789
- name: Ensure clean build directory
814790
run: rm -rf build
815791
- 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
loadasreactLoad,
44
getSourceasgetSourceImpl,
55
transformSourceasreactTransformSource,
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
constReact=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
constapp=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
constpath=require('path');
66
consturl=require('url');
77

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

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

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

135136
asyncfunctionprerenderApp(res,returnValue,formState,noCache){
136137
const{prerenderToNodeStream}=awaitimport(
137-
'react-server-dom-webpack/static'
138+
'react-server-dom-unbundled/static'
138139
);
139140
// const m = require('../src/App.js');
140141
constm=awaitimport('../src/App.js');
@@ -202,7 +203,7 @@ app.get('/', async function (req, res) {
202203
app.post('/',bodyParser.text(),asyncfunction(req,res){
203204
constnoCache=req.headers['cache-control']==='no-cache';
204205
const{decodeReply, decodeReplyFromBusboy, decodeAction, decodeFormState}=
205-
awaitimport('react-server-dom-webpack/server');
206+
awaitimport('react-server-dom-unbundled/server');
206207
constserverReference=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*asReactfrom'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",

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Patch Promise cycles and toString on Server Functions · react/react@dd05198 · GitHub
Skip to content

Commit dd05198

Browse files
sebmarkbageunstubbableeps1lon
committed
Patch Promise cycles and toString on Server Functions
[Flight] Move `react-server-dom-webpack/*.unbundled` to private `react-server-dom-unbundled` (#35290) Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de> Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
1 parent 0eeded6 commit dd05198

58 files changed

Lines changed: 3388 additions & 368 deletions

File tree

Some content is hidden

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

‎.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
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
path: |
4747
**/node_modules
48-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
48+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
4949
lookup-only: true
5050
- uses: actions/setup-node@v4
5151
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -59,10 +59,8 @@ jobs:
5959
with:
6060
path: |
6161
**/node_modules
62-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63-
restore-keys: |
64-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
65-
runtime-node_modules-v6-
62+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
6664
- run: yarn install --frozen-lockfile
6765
if: steps.node_modules.outputs.cache-hit != 'true'
6866
- name: Save cache
@@ -71,7 +69,7 @@ jobs:
7169
with:
7270
path: |
7371
**/node_modules
74-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
72+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
7573

7674
runtime_compiler_node_modules_cache:
7775
name: Cache Runtime, Compiler node_modules
@@ -86,7 +84,7 @@ jobs:
8684
with:
8785
path: |
8886
**/node_modules
89-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
87+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
9088
lookup-only: true
9189
- uses: actions/setup-node@v4
9290
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -102,10 +100,8 @@ jobs:
102100
with:
103101
path: |
104102
**/node_modules
105-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
106-
restore-keys: |
107-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
108-
runtime-and-compiler-node_modules-v6-
103+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
104+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
109105
- run: yarn install --frozen-lockfile
110106
if: steps.node_modules.outputs.cache-hit != 'true'
111107
- run: yarn --cwd compiler install --frozen-lockfile
@@ -116,7 +112,7 @@ jobs:
116112
with:
117113
path: |
118114
**/node_modules
119-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
115+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
120116

121117
# ----- FLOW -----
122118
discover_flow_inline_configs:
@@ -158,10 +154,8 @@ jobs:
158154
with:
159155
path: |
160156
**/node_modules
161-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
162-
restore-keys: |
163-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
164-
runtime-node_modules-v6-
157+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
158+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
165159
- name: Ensure clean build directory
166160
run: rm -rf build
167161
- run: yarn install --frozen-lockfile
@@ -188,10 +182,8 @@ jobs:
188182
with:
189183
path: |
190184
**/node_modules
191-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
192-
restore-keys: |
193-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
194-
runtime-node_modules-v6-
185+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
186+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
195187
- name: Ensure clean build directory
196188
run: rm -rf build
197189
- run: yarn install --frozen-lockfile
@@ -220,7 +212,7 @@ jobs:
220212
with:
221213
path: |
222214
**/node_modules
223-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
215+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
224216
- name: Ensure clean build directory
225217
run: rm -rf build
226218
- run: yarn install --frozen-lockfile
@@ -278,10 +270,8 @@ jobs:
278270
with:
279271
path: |
280272
**/node_modules
281-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
282-
restore-keys: |
283-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
284-
runtime-and-compiler-node_modules-v6-
273+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
274+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
285275
- name: Ensure clean build directory
286276
run: rm -rf build
287277
- run: yarn install --frozen-lockfile
@@ -310,7 +300,7 @@ jobs:
310300
with:
311301
path: |
312302
**/node_modules
313-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
303+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
314304
- name: Install runtime dependencies
315305
run: yarn install --frozen-lockfile
316306
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -353,10 +343,8 @@ jobs:
353343
with:
354344
path: |
355345
**/node_modules
356-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
357-
restore-keys: |
358-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
359-
runtime-and-compiler-node_modules-v6-
346+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
347+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
360348
- name: Ensure clean build directory
361349
run: rm -rf build
362350
- run: yarn install --frozen-lockfile
@@ -444,10 +432,8 @@ jobs:
444432
with:
445433
path: |
446434
**/node_modules
447-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
448-
restore-keys: |
449-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
450-
runtime-and-compiler-node_modules-v6-
435+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
436+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
451437
- name: Ensure clean build directory
452438
run: rm -rf build
453439
- run: yarn install --frozen-lockfile
@@ -487,10 +473,8 @@ jobs:
487473
with:
488474
path: |
489475
**/node_modules
490-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
491-
restore-keys: |
492-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
493-
runtime-node_modules-v6-
476+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
477+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
494478
- name: Ensure clean build directory
495479
run: rm -rf build
496480
- run: yarn install --frozen-lockfile
@@ -552,10 +536,8 @@ jobs:
552536
with:
553537
path: |
554538
**/node_modules
555-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
556-
restore-keys: |
557-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
558-
runtime-node_modules-v6-
539+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
540+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
559541
- name: Ensure clean build directory
560542
run: rm -rf build
561543
- run: yarn install --frozen-lockfile
@@ -592,10 +574,8 @@ jobs:
592574
with:
593575
path: |
594576
**/node_modules
595-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
596-
restore-keys: |
597-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
598-
runtime-node_modules-v6-
577+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
578+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
599579
- name: Ensure clean build directory
600580
run: rm -rf build
601581
- run: yarn install --frozen-lockfile
@@ -744,10 +724,8 @@ jobs:
744724
with:
745725
path: |
746726
**/node_modules
747-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
748-
restore-keys: |
749-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
750-
runtime-node_modules-v6-
727+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
728+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
751729
- name: Ensure clean build directory
752730
run: rm -rf build
753731
- run: yarn install --frozen-lockfile
@@ -806,10 +784,8 @@ jobs:
806784
with:
807785
path: |
808786
**/node_modules
809-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
810-
restore-keys: |
811-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
812-
runtime-node_modules-v6-
787+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
788+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
813789
- name: Ensure clean build directory
814790
run: rm -rf build
815791
- 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
loadasreactLoad,
44
getSourceasgetSourceImpl,
55
transformSourceasreactTransformSource,
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
constReact=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
constapp=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
constpath=require('path');
66
consturl=require('url');
77

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

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

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

135136
asyncfunctionprerenderApp(res,returnValue,formState,noCache){
136137
const{prerenderToNodeStream}=awaitimport(
137-
'react-server-dom-webpack/static'
138+
'react-server-dom-unbundled/static'
138139
);
139140
// const m = require('../src/App.js');
140141
constm=awaitimport('../src/App.js');
@@ -202,7 +203,7 @@ app.get('/', async function (req, res) {
202203
app.post('/',bodyParser.text(),asyncfunction(req,res){
203204
constnoCache=req.headers['cache-control']==='no-cache';
204205
const{decodeReply, decodeReplyFromBusboy, decodeAction, decodeFormState}=
205-
awaitimport('react-server-dom-webpack/server');
206+
awaitimport('react-server-dom-unbundled/server');
206207
constserverReference=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*asReactfrom'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",

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Patch Promise cycles and toString on Server Functions · react/react@dd05198 · GitHub
Skip to content

Commit dd05198

Browse files
sebmarkbageunstubbableeps1lon
committed
Patch Promise cycles and toString on Server Functions
[Flight] Move `react-server-dom-webpack/*.unbundled` to private `react-server-dom-unbundled` (#35290) Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de> Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
1 parent 0eeded6 commit dd05198

58 files changed

Lines changed: 3388 additions & 368 deletions

File tree

Some content is hidden

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

‎.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
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
path: |
4747
**/node_modules
48-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
48+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
4949
lookup-only: true
5050
- uses: actions/setup-node@v4
5151
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -59,10 +59,8 @@ jobs:
5959
with:
6060
path: |
6161
**/node_modules
62-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63-
restore-keys: |
64-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
65-
runtime-node_modules-v6-
62+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
6664
- run: yarn install --frozen-lockfile
6765
if: steps.node_modules.outputs.cache-hit != 'true'
6866
- name: Save cache
@@ -71,7 +69,7 @@ jobs:
7169
with:
7270
path: |
7371
**/node_modules
74-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
72+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
7573

7674
runtime_compiler_node_modules_cache:
7775
name: Cache Runtime, Compiler node_modules
@@ -86,7 +84,7 @@ jobs:
8684
with:
8785
path: |
8886
**/node_modules
89-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
87+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
9088
lookup-only: true
9189
- uses: actions/setup-node@v4
9290
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -102,10 +100,8 @@ jobs:
102100
with:
103101
path: |
104102
**/node_modules
105-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
106-
restore-keys: |
107-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
108-
runtime-and-compiler-node_modules-v6-
103+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
104+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
109105
- run: yarn install --frozen-lockfile
110106
if: steps.node_modules.outputs.cache-hit != 'true'
111107
- run: yarn --cwd compiler install --frozen-lockfile
@@ -116,7 +112,7 @@ jobs:
116112
with:
117113
path: |
118114
**/node_modules
119-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
115+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
120116

121117
# ----- FLOW -----
122118
discover_flow_inline_configs:
@@ -158,10 +154,8 @@ jobs:
158154
with:
159155
path: |
160156
**/node_modules
161-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
162-
restore-keys: |
163-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
164-
runtime-node_modules-v6-
157+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
158+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
165159
- name: Ensure clean build directory
166160
run: rm -rf build
167161
- run: yarn install --frozen-lockfile
@@ -188,10 +182,8 @@ jobs:
188182
with:
189183
path: |
190184
**/node_modules
191-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
192-
restore-keys: |
193-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
194-
runtime-node_modules-v6-
185+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
186+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
195187
- name: Ensure clean build directory
196188
run: rm -rf build
197189
- run: yarn install --frozen-lockfile
@@ -220,7 +212,7 @@ jobs:
220212
with:
221213
path: |
222214
**/node_modules
223-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
215+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
224216
- name: Ensure clean build directory
225217
run: rm -rf build
226218
- run: yarn install --frozen-lockfile
@@ -278,10 +270,8 @@ jobs:
278270
with:
279271
path: |
280272
**/node_modules
281-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
282-
restore-keys: |
283-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
284-
runtime-and-compiler-node_modules-v6-
273+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
274+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
285275
- name: Ensure clean build directory
286276
run: rm -rf build
287277
- run: yarn install --frozen-lockfile
@@ -310,7 +300,7 @@ jobs:
310300
with:
311301
path: |
312302
**/node_modules
313-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
303+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
314304
- name: Install runtime dependencies
315305
run: yarn install --frozen-lockfile
316306
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -353,10 +343,8 @@ jobs:
353343
with:
354344
path: |
355345
**/node_modules
356-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
357-
restore-keys: |
358-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
359-
runtime-and-compiler-node_modules-v6-
346+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
347+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
360348
- name: Ensure clean build directory
361349
run: rm -rf build
362350
- run: yarn install --frozen-lockfile
@@ -444,10 +432,8 @@ jobs:
444432
with:
445433
path: |
446434
**/node_modules
447-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
448-
restore-keys: |
449-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
450-
runtime-and-compiler-node_modules-v6-
435+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
436+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
451437
- name: Ensure clean build directory
452438
run: rm -rf build
453439
- run: yarn install --frozen-lockfile
@@ -487,10 +473,8 @@ jobs:
487473
with:
488474
path: |
489475
**/node_modules
490-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
491-
restore-keys: |
492-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
493-
runtime-node_modules-v6-
476+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
477+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
494478
- name: Ensure clean build directory
495479
run: rm -rf build
496480
- run: yarn install --frozen-lockfile
@@ -552,10 +536,8 @@ jobs:
552536
with:
553537
path: |
554538
**/node_modules
555-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
556-
restore-keys: |
557-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
558-
runtime-node_modules-v6-
539+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
540+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
559541
- name: Ensure clean build directory
560542
run: rm -rf build
561543
- run: yarn install --frozen-lockfile
@@ -592,10 +574,8 @@ jobs:
592574
with:
593575
path: |
594576
**/node_modules
595-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
596-
restore-keys: |
597-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
598-
runtime-node_modules-v6-
577+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
578+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
599579
- name: Ensure clean build directory
600580
run: rm -rf build
601581
- run: yarn install --frozen-lockfile
@@ -744,10 +724,8 @@ jobs:
744724
with:
745725
path: |
746726
**/node_modules
747-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
748-
restore-keys: |
749-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
750-
runtime-node_modules-v6-
727+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
728+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
751729
- name: Ensure clean build directory
752730
run: rm -rf build
753731
- run: yarn install --frozen-lockfile
@@ -806,10 +784,8 @@ jobs:
806784
with:
807785
path: |
808786
**/node_modules
809-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
810-
restore-keys: |
811-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
812-
runtime-node_modules-v6-
787+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
788+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
813789
- name: Ensure clean build directory
814790
run: rm -rf build
815791
- 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
loadasreactLoad,
44
getSourceasgetSourceImpl,
55
transformSourceasreactTransformSource,
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
constReact=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
constapp=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
constpath=require('path');
66
consturl=require('url');
77

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

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

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

135136
asyncfunctionprerenderApp(res,returnValue,formState,noCache){
136137
const{prerenderToNodeStream}=awaitimport(
137-
'react-server-dom-webpack/static'
138+
'react-server-dom-unbundled/static'
138139
);
139140
// const m = require('../src/App.js');
140141
constm=awaitimport('../src/App.js');
@@ -202,7 +203,7 @@ app.get('/', async function (req, res) {
202203
app.post('/',bodyParser.text(),asyncfunction(req,res){
203204
constnoCache=req.headers['cache-control']==='no-cache';
204205
const{decodeReply, decodeReplyFromBusboy, decodeAction, decodeFormState}=
205-
awaitimport('react-server-dom-webpack/server');
206+
awaitimport('react-server-dom-unbundled/server');
206207
constserverReference=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*asReactfrom'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",

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Patch Promise cycles and toString on Server Functions · react/react@dd05198 · GitHub
Skip to content

Commit dd05198

Browse files
sebmarkbageunstubbableeps1lon
committed
Patch Promise cycles and toString on Server Functions
[Flight] Move `react-server-dom-webpack/*.unbundled` to private `react-server-dom-unbundled` (#35290) Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de> Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
1 parent 0eeded6 commit dd05198

58 files changed

Lines changed: 3388 additions & 368 deletions

File tree

Some content is hidden

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

‎.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
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
path: |
4747
**/node_modules
48-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
48+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
4949
lookup-only: true
5050
- uses: actions/setup-node@v4
5151
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -59,10 +59,8 @@ jobs:
5959
with:
6060
path: |
6161
**/node_modules
62-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63-
restore-keys: |
64-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
65-
runtime-node_modules-v6-
62+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
6664
- run: yarn install --frozen-lockfile
6765
if: steps.node_modules.outputs.cache-hit != 'true'
6866
- name: Save cache
@@ -71,7 +69,7 @@ jobs:
7169
with:
7270
path: |
7371
**/node_modules
74-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
72+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
7573

7674
runtime_compiler_node_modules_cache:
7775
name: Cache Runtime, Compiler node_modules
@@ -86,7 +84,7 @@ jobs:
8684
with:
8785
path: |
8886
**/node_modules
89-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
87+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
9088
lookup-only: true
9189
- uses: actions/setup-node@v4
9290
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -102,10 +100,8 @@ jobs:
102100
with:
103101
path: |
104102
**/node_modules
105-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
106-
restore-keys: |
107-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
108-
runtime-and-compiler-node_modules-v6-
103+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
104+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
109105
- run: yarn install --frozen-lockfile
110106
if: steps.node_modules.outputs.cache-hit != 'true'
111107
- run: yarn --cwd compiler install --frozen-lockfile
@@ -116,7 +112,7 @@ jobs:
116112
with:
117113
path: |
118114
**/node_modules
119-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
115+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
120116

121117
# ----- FLOW -----
122118
discover_flow_inline_configs:
@@ -158,10 +154,8 @@ jobs:
158154
with:
159155
path: |
160156
**/node_modules
161-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
162-
restore-keys: |
163-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
164-
runtime-node_modules-v6-
157+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
158+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
165159
- name: Ensure clean build directory
166160
run: rm -rf build
167161
- run: yarn install --frozen-lockfile
@@ -188,10 +182,8 @@ jobs:
188182
with:
189183
path: |
190184
**/node_modules
191-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
192-
restore-keys: |
193-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
194-
runtime-node_modules-v6-
185+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
186+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
195187
- name: Ensure clean build directory
196188
run: rm -rf build
197189
- run: yarn install --frozen-lockfile
@@ -220,7 +212,7 @@ jobs:
220212
with:
221213
path: |
222214
**/node_modules
223-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
215+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
224216
- name: Ensure clean build directory
225217
run: rm -rf build
226218
- run: yarn install --frozen-lockfile
@@ -278,10 +270,8 @@ jobs:
278270
with:
279271
path: |
280272
**/node_modules
281-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
282-
restore-keys: |
283-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
284-
runtime-and-compiler-node_modules-v6-
273+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
274+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
285275
- name: Ensure clean build directory
286276
run: rm -rf build
287277
- run: yarn install --frozen-lockfile
@@ -310,7 +300,7 @@ jobs:
310300
with:
311301
path: |
312302
**/node_modules
313-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
303+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
314304
- name: Install runtime dependencies
315305
run: yarn install --frozen-lockfile
316306
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -353,10 +343,8 @@ jobs:
353343
with:
354344
path: |
355345
**/node_modules
356-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
357-
restore-keys: |
358-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
359-
runtime-and-compiler-node_modules-v6-
346+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
347+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
360348
- name: Ensure clean build directory
361349
run: rm -rf build
362350
- run: yarn install --frozen-lockfile
@@ -444,10 +432,8 @@ jobs:
444432
with:
445433
path: |
446434
**/node_modules
447-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
448-
restore-keys: |
449-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
450-
runtime-and-compiler-node_modules-v6-
435+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
436+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
451437
- name: Ensure clean build directory
452438
run: rm -rf build
453439
- run: yarn install --frozen-lockfile
@@ -487,10 +473,8 @@ jobs:
487473
with:
488474
path: |
489475
**/node_modules
490-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
491-
restore-keys: |
492-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
493-
runtime-node_modules-v6-
476+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
477+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
494478
- name: Ensure clean build directory
495479
run: rm -rf build
496480
- run: yarn install --frozen-lockfile
@@ -552,10 +536,8 @@ jobs:
552536
with:
553537
path: |
554538
**/node_modules
555-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
556-
restore-keys: |
557-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
558-
runtime-node_modules-v6-
539+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
540+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
559541
- name: Ensure clean build directory
560542
run: rm -rf build
561543
- run: yarn install --frozen-lockfile
@@ -592,10 +574,8 @@ jobs:
592574
with:
593575
path: |
594576
**/node_modules
595-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
596-
restore-keys: |
597-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
598-
runtime-node_modules-v6-
577+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
578+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
599579
- name: Ensure clean build directory
600580
run: rm -rf build
601581
- run: yarn install --frozen-lockfile
@@ -744,10 +724,8 @@ jobs:
744724
with:
745725
path: |
746726
**/node_modules
747-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
748-
restore-keys: |
749-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
750-
runtime-node_modules-v6-
727+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
728+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
751729
- name: Ensure clean build directory
752730
run: rm -rf build
753731
- run: yarn install --frozen-lockfile
@@ -806,10 +784,8 @@ jobs:
806784
with:
807785
path: |
808786
**/node_modules
809-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
810-
restore-keys: |
811-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
812-
runtime-node_modules-v6-
787+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
788+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
813789
- name: Ensure clean build directory
814790
run: rm -rf build
815791
- 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
loadasreactLoad,
44
getSourceasgetSourceImpl,
55
transformSourceasreactTransformSource,
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
constReact=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
constapp=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
constpath=require('path');
66
consturl=require('url');
77

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

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

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

135136
asyncfunctionprerenderApp(res,returnValue,formState,noCache){
136137
const{prerenderToNodeStream}=awaitimport(
137-
'react-server-dom-webpack/static'
138+
'react-server-dom-unbundled/static'
138139
);
139140
// const m = require('../src/App.js');
140141
constm=awaitimport('../src/App.js');
@@ -202,7 +203,7 @@ app.get('/', async function (req, res) {
202203
app.post('/',bodyParser.text(),asyncfunction(req,res){
203204
constnoCache=req.headers['cache-control']==='no-cache';
204205
const{decodeReply, decodeReplyFromBusboy, decodeAction, decodeFormState}=
205-
awaitimport('react-server-dom-webpack/server');
206+
awaitimport('react-server-dom-unbundled/server');
206207
constserverReference=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*asReactfrom'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",

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Patch Promise cycles and toString on Server Functions · react/react@dd05198 · GitHub
Skip to content

Commit dd05198

Browse files
sebmarkbageunstubbableeps1lon
committed
Patch Promise cycles and toString on Server Functions
[Flight] Move `react-server-dom-webpack/*.unbundled` to private `react-server-dom-unbundled` (#35290) Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de> Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
1 parent 0eeded6 commit dd05198

58 files changed

Lines changed: 3388 additions & 368 deletions

File tree

Some content is hidden

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

‎.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
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
path: |
4747
**/node_modules
48-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
48+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
4949
lookup-only: true
5050
- uses: actions/setup-node@v4
5151
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -59,10 +59,8 @@ jobs:
5959
with:
6060
path: |
6161
**/node_modules
62-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63-
restore-keys: |
64-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
65-
runtime-node_modules-v6-
62+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
6664
- run: yarn install --frozen-lockfile
6765
if: steps.node_modules.outputs.cache-hit != 'true'
6866
- name: Save cache
@@ -71,7 +69,7 @@ jobs:
7169
with:
7270
path: |
7371
**/node_modules
74-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
72+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
7573

7674
runtime_compiler_node_modules_cache:
7775
name: Cache Runtime, Compiler node_modules
@@ -86,7 +84,7 @@ jobs:
8684
with:
8785
path: |
8886
**/node_modules
89-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
87+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
9088
lookup-only: true
9189
- uses: actions/setup-node@v4
9290
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -102,10 +100,8 @@ jobs:
102100
with:
103101
path: |
104102
**/node_modules
105-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
106-
restore-keys: |
107-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
108-
runtime-and-compiler-node_modules-v6-
103+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
104+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
109105
- run: yarn install --frozen-lockfile
110106
if: steps.node_modules.outputs.cache-hit != 'true'
111107
- run: yarn --cwd compiler install --frozen-lockfile
@@ -116,7 +112,7 @@ jobs:
116112
with:
117113
path: |
118114
**/node_modules
119-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
115+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
120116

121117
# ----- FLOW -----
122118
discover_flow_inline_configs:
@@ -158,10 +154,8 @@ jobs:
158154
with:
159155
path: |
160156
**/node_modules
161-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
162-
restore-keys: |
163-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
164-
runtime-node_modules-v6-
157+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
158+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
165159
- name: Ensure clean build directory
166160
run: rm -rf build
167161
- run: yarn install --frozen-lockfile
@@ -188,10 +182,8 @@ jobs:
188182
with:
189183
path: |
190184
**/node_modules
191-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
192-
restore-keys: |
193-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
194-
runtime-node_modules-v6-
185+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
186+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
195187
- name: Ensure clean build directory
196188
run: rm -rf build
197189
- run: yarn install --frozen-lockfile
@@ -220,7 +212,7 @@ jobs:
220212
with:
221213
path: |
222214
**/node_modules
223-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
215+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
224216
- name: Ensure clean build directory
225217
run: rm -rf build
226218
- run: yarn install --frozen-lockfile
@@ -278,10 +270,8 @@ jobs:
278270
with:
279271
path: |
280272
**/node_modules
281-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
282-
restore-keys: |
283-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
284-
runtime-and-compiler-node_modules-v6-
273+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
274+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
285275
- name: Ensure clean build directory
286276
run: rm -rf build
287277
- run: yarn install --frozen-lockfile
@@ -310,7 +300,7 @@ jobs:
310300
with:
311301
path: |
312302
**/node_modules
313-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
303+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
314304
- name: Install runtime dependencies
315305
run: yarn install --frozen-lockfile
316306
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -353,10 +343,8 @@ jobs:
353343
with:
354344
path: |
355345
**/node_modules
356-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
357-
restore-keys: |
358-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
359-
runtime-and-compiler-node_modules-v6-
346+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
347+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
360348
- name: Ensure clean build directory
361349
run: rm -rf build
362350
- run: yarn install --frozen-lockfile
@@ -444,10 +432,8 @@ jobs:
444432
with:
445433
path: |
446434
**/node_modules
447-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
448-
restore-keys: |
449-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
450-
runtime-and-compiler-node_modules-v6-
435+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
436+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
451437
- name: Ensure clean build directory
452438
run: rm -rf build
453439
- run: yarn install --frozen-lockfile
@@ -487,10 +473,8 @@ jobs:
487473
with:
488474
path: |
489475
**/node_modules
490-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
491-
restore-keys: |
492-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
493-
runtime-node_modules-v6-
476+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
477+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
494478
- name: Ensure clean build directory
495479
run: rm -rf build
496480
- run: yarn install --frozen-lockfile
@@ -552,10 +536,8 @@ jobs:
552536
with:
553537
path: |
554538
**/node_modules
555-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
556-
restore-keys: |
557-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
558-
runtime-node_modules-v6-
539+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
540+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
559541
- name: Ensure clean build directory
560542
run: rm -rf build
561543
- run: yarn install --frozen-lockfile
@@ -592,10 +574,8 @@ jobs:
592574
with:
593575
path: |
594576
**/node_modules
595-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
596-
restore-keys: |
597-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
598-
runtime-node_modules-v6-
577+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
578+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
599579
- name: Ensure clean build directory
600580
run: rm -rf build
601581
- run: yarn install --frozen-lockfile
@@ -744,10 +724,8 @@ jobs:
744724
with:
745725
path: |
746726
**/node_modules
747-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
748-
restore-keys: |
749-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
750-
runtime-node_modules-v6-
727+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
728+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
751729
- name: Ensure clean build directory
752730
run: rm -rf build
753731
- run: yarn install --frozen-lockfile
@@ -806,10 +784,8 @@ jobs:
806784
with:
807785
path: |
808786
**/node_modules
809-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
810-
restore-keys: |
811-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
812-
runtime-node_modules-v6-
787+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
788+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
813789
- name: Ensure clean build directory
814790
run: rm -rf build
815791
- 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
loadasreactLoad,
44
getSourceasgetSourceImpl,
55
transformSourceasreactTransformSource,
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
constReact=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
constapp=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
constpath=require('path');
66
consturl=require('url');
77

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

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

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

135136
asyncfunctionprerenderApp(res,returnValue,formState,noCache){
136137
const{prerenderToNodeStream}=awaitimport(
137-
'react-server-dom-webpack/static'
138+
'react-server-dom-unbundled/static'
138139
);
139140
// const m = require('../src/App.js');
140141
constm=awaitimport('../src/App.js');
@@ -202,7 +203,7 @@ app.get('/', async function (req, res) {
202203
app.post('/',bodyParser.text(),asyncfunction(req,res){
203204
constnoCache=req.headers['cache-control']==='no-cache';
204205
const{decodeReply, decodeReplyFromBusboy, decodeAction, decodeFormState}=
205-
awaitimport('react-server-dom-webpack/server');
206+
awaitimport('react-server-dom-unbundled/server');
206207
constserverReference=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*asReactfrom'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",

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Patch Promise cycles and toString on Server Functions · react/react@dd05198 · GitHub
Skip to content

Commit dd05198

Browse files
sebmarkbageunstubbableeps1lon
committed
Patch Promise cycles and toString on Server Functions
[Flight] Move `react-server-dom-webpack/*.unbundled` to private `react-server-dom-unbundled` (#35290) Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de> Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
1 parent 0eeded6 commit dd05198

58 files changed

Lines changed: 3388 additions & 368 deletions

File tree

Some content is hidden

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

‎.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
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
path: |
4747
**/node_modules
48-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
48+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
4949
lookup-only: true
5050
- uses: actions/setup-node@v4
5151
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -59,10 +59,8 @@ jobs:
5959
with:
6060
path: |
6161
**/node_modules
62-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63-
restore-keys: |
64-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
65-
runtime-node_modules-v6-
62+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
6664
- run: yarn install --frozen-lockfile
6765
if: steps.node_modules.outputs.cache-hit != 'true'
6866
- name: Save cache
@@ -71,7 +69,7 @@ jobs:
7169
with:
7270
path: |
7371
**/node_modules
74-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
72+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
7573

7674
runtime_compiler_node_modules_cache:
7775
name: Cache Runtime, Compiler node_modules
@@ -86,7 +84,7 @@ jobs:
8684
with:
8785
path: |
8886
**/node_modules
89-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
87+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
9088
lookup-only: true
9189
- uses: actions/setup-node@v4
9290
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -102,10 +100,8 @@ jobs:
102100
with:
103101
path: |
104102
**/node_modules
105-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
106-
restore-keys: |
107-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
108-
runtime-and-compiler-node_modules-v6-
103+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
104+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
109105
- run: yarn install --frozen-lockfile
110106
if: steps.node_modules.outputs.cache-hit != 'true'
111107
- run: yarn --cwd compiler install --frozen-lockfile
@@ -116,7 +112,7 @@ jobs:
116112
with:
117113
path: |
118114
**/node_modules
119-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
115+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
120116

121117
# ----- FLOW -----
122118
discover_flow_inline_configs:
@@ -158,10 +154,8 @@ jobs:
158154
with:
159155
path: |
160156
**/node_modules
161-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
162-
restore-keys: |
163-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
164-
runtime-node_modules-v6-
157+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
158+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
165159
- name: Ensure clean build directory
166160
run: rm -rf build
167161
- run: yarn install --frozen-lockfile
@@ -188,10 +182,8 @@ jobs:
188182
with:
189183
path: |
190184
**/node_modules
191-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
192-
restore-keys: |
193-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
194-
runtime-node_modules-v6-
185+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
186+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
195187
- name: Ensure clean build directory
196188
run: rm -rf build
197189
- run: yarn install --frozen-lockfile
@@ -220,7 +212,7 @@ jobs:
220212
with:
221213
path: |
222214
**/node_modules
223-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
215+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
224216
- name: Ensure clean build directory
225217
run: rm -rf build
226218
- run: yarn install --frozen-lockfile
@@ -278,10 +270,8 @@ jobs:
278270
with:
279271
path: |
280272
**/node_modules
281-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
282-
restore-keys: |
283-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
284-
runtime-and-compiler-node_modules-v6-
273+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
274+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
285275
- name: Ensure clean build directory
286276
run: rm -rf build
287277
- run: yarn install --frozen-lockfile
@@ -310,7 +300,7 @@ jobs:
310300
with:
311301
path: |
312302
**/node_modules
313-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
303+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
314304
- name: Install runtime dependencies
315305
run: yarn install --frozen-lockfile
316306
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -353,10 +343,8 @@ jobs:
353343
with:
354344
path: |
355345
**/node_modules
356-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
357-
restore-keys: |
358-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
359-
runtime-and-compiler-node_modules-v6-
346+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
347+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
360348
- name: Ensure clean build directory
361349
run: rm -rf build
362350
- run: yarn install --frozen-lockfile
@@ -444,10 +432,8 @@ jobs:
444432
with:
445433
path: |
446434
**/node_modules
447-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
448-
restore-keys: |
449-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
450-
runtime-and-compiler-node_modules-v6-
435+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
436+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
451437
- name: Ensure clean build directory
452438
run: rm -rf build
453439
- run: yarn install --frozen-lockfile
@@ -487,10 +473,8 @@ jobs:
487473
with:
488474
path: |
489475
**/node_modules
490-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
491-
restore-keys: |
492-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
493-
runtime-node_modules-v6-
476+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
477+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
494478
- name: Ensure clean build directory
495479
run: rm -rf build
496480
- run: yarn install --frozen-lockfile
@@ -552,10 +536,8 @@ jobs:
552536
with:
553537
path: |
554538
**/node_modules
555-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
556-
restore-keys: |
557-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
558-
runtime-node_modules-v6-
539+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
540+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
559541
- name: Ensure clean build directory
560542
run: rm -rf build
561543
- run: yarn install --frozen-lockfile
@@ -592,10 +574,8 @@ jobs:
592574
with:
593575
path: |
594576
**/node_modules
595-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
596-
restore-keys: |
597-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
598-
runtime-node_modules-v6-
577+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
578+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
599579
- name: Ensure clean build directory
600580
run: rm -rf build
601581
- run: yarn install --frozen-lockfile
@@ -744,10 +724,8 @@ jobs:
744724
with:
745725
path: |
746726
**/node_modules
747-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
748-
restore-keys: |
749-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
750-
runtime-node_modules-v6-
727+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
728+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
751729
- name: Ensure clean build directory
752730
run: rm -rf build
753731
- run: yarn install --frozen-lockfile
@@ -806,10 +784,8 @@ jobs:
806784
with:
807785
path: |
808786
**/node_modules
809-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
810-
restore-keys: |
811-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
812-
runtime-node_modules-v6-
787+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
788+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
813789
- name: Ensure clean build directory
814790
run: rm -rf build
815791
- 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
loadasreactLoad,
44
getSourceasgetSourceImpl,
55
transformSourceasreactTransformSource,
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
constReact=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
constapp=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
constpath=require('path');
66
consturl=require('url');
77

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

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

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

135136
asyncfunctionprerenderApp(res,returnValue,formState,noCache){
136137
const{prerenderToNodeStream}=awaitimport(
137-
'react-server-dom-webpack/static'
138+
'react-server-dom-unbundled/static'
138139
);
139140
// const m = require('../src/App.js');
140141
constm=awaitimport('../src/App.js');
@@ -202,7 +203,7 @@ app.get('/', async function (req, res) {
202203
app.post('/',bodyParser.text(),asyncfunction(req,res){
203204
constnoCache=req.headers['cache-control']==='no-cache';
204205
const{decodeReply, decodeReplyFromBusboy, decodeAction, decodeFormState}=
205-
awaitimport('react-server-dom-webpack/server');
206+
awaitimport('react-server-dom-unbundled/server');
206207
constserverReference=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*asReactfrom'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",

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Patch Promise cycles and toString on Server Functions · react/react@dd05198 · GitHub
Skip to content

Commit dd05198

Browse files
sebmarkbageunstubbableeps1lon
committed
Patch Promise cycles and toString on Server Functions
[Flight] Move `react-server-dom-webpack/*.unbundled` to private `react-server-dom-unbundled` (#35290) Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de> Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
1 parent 0eeded6 commit dd05198

58 files changed

Lines changed: 3388 additions & 368 deletions

File tree

Some content is hidden

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

‎.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
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
path: |
4747
**/node_modules
48-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
48+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
4949
lookup-only: true
5050
- uses: actions/setup-node@v4
5151
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -59,10 +59,8 @@ jobs:
5959
with:
6060
path: |
6161
**/node_modules
62-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63-
restore-keys: |
64-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
65-
runtime-node_modules-v6-
62+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
6664
- run: yarn install --frozen-lockfile
6765
if: steps.node_modules.outputs.cache-hit != 'true'
6866
- name: Save cache
@@ -71,7 +69,7 @@ jobs:
7169
with:
7270
path: |
7371
**/node_modules
74-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
72+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
7573

7674
runtime_compiler_node_modules_cache:
7775
name: Cache Runtime, Compiler node_modules
@@ -86,7 +84,7 @@ jobs:
8684
with:
8785
path: |
8886
**/node_modules
89-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
87+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
9088
lookup-only: true
9189
- uses: actions/setup-node@v4
9290
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -102,10 +100,8 @@ jobs:
102100
with:
103101
path: |
104102
**/node_modules
105-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
106-
restore-keys: |
107-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
108-
runtime-and-compiler-node_modules-v6-
103+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
104+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
109105
- run: yarn install --frozen-lockfile
110106
if: steps.node_modules.outputs.cache-hit != 'true'
111107
- run: yarn --cwd compiler install --frozen-lockfile
@@ -116,7 +112,7 @@ jobs:
116112
with:
117113
path: |
118114
**/node_modules
119-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
115+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
120116

121117
# ----- FLOW -----
122118
discover_flow_inline_configs:
@@ -158,10 +154,8 @@ jobs:
158154
with:
159155
path: |
160156
**/node_modules
161-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
162-
restore-keys: |
163-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
164-
runtime-node_modules-v6-
157+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
158+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
165159
- name: Ensure clean build directory
166160
run: rm -rf build
167161
- run: yarn install --frozen-lockfile
@@ -188,10 +182,8 @@ jobs:
188182
with:
189183
path: |
190184
**/node_modules
191-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
192-
restore-keys: |
193-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
194-
runtime-node_modules-v6-
185+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
186+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
195187
- name: Ensure clean build directory
196188
run: rm -rf build
197189
- run: yarn install --frozen-lockfile
@@ -220,7 +212,7 @@ jobs:
220212
with:
221213
path: |
222214
**/node_modules
223-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
215+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
224216
- name: Ensure clean build directory
225217
run: rm -rf build
226218
- run: yarn install --frozen-lockfile
@@ -278,10 +270,8 @@ jobs:
278270
with:
279271
path: |
280272
**/node_modules
281-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
282-
restore-keys: |
283-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
284-
runtime-and-compiler-node_modules-v6-
273+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
274+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
285275
- name: Ensure clean build directory
286276
run: rm -rf build
287277
- run: yarn install --frozen-lockfile
@@ -310,7 +300,7 @@ jobs:
310300
with:
311301
path: |
312302
**/node_modules
313-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
303+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
314304
- name: Install runtime dependencies
315305
run: yarn install --frozen-lockfile
316306
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -353,10 +343,8 @@ jobs:
353343
with:
354344
path: |
355345
**/node_modules
356-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
357-
restore-keys: |
358-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
359-
runtime-and-compiler-node_modules-v6-
346+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
347+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
360348
- name: Ensure clean build directory
361349
run: rm -rf build
362350
- run: yarn install --frozen-lockfile
@@ -444,10 +432,8 @@ jobs:
444432
with:
445433
path: |
446434
**/node_modules
447-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
448-
restore-keys: |
449-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
450-
runtime-and-compiler-node_modules-v6-
435+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
436+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
451437
- name: Ensure clean build directory
452438
run: rm -rf build
453439
- run: yarn install --frozen-lockfile
@@ -487,10 +473,8 @@ jobs:
487473
with:
488474
path: |
489475
**/node_modules
490-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
491-
restore-keys: |
492-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
493-
runtime-node_modules-v6-
476+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
477+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
494478
- name: Ensure clean build directory
495479
run: rm -rf build
496480
- run: yarn install --frozen-lockfile
@@ -552,10 +536,8 @@ jobs:
552536
with:
553537
path: |
554538
**/node_modules
555-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
556-
restore-keys: |
557-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
558-
runtime-node_modules-v6-
539+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
540+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
559541
- name: Ensure clean build directory
560542
run: rm -rf build
561543
- run: yarn install --frozen-lockfile
@@ -592,10 +574,8 @@ jobs:
592574
with:
593575
path: |
594576
**/node_modules
595-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
596-
restore-keys: |
597-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
598-
runtime-node_modules-v6-
577+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
578+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
599579
- name: Ensure clean build directory
600580
run: rm -rf build
601581
- run: yarn install --frozen-lockfile
@@ -744,10 +724,8 @@ jobs:
744724
with:
745725
path: |
746726
**/node_modules
747-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
748-
restore-keys: |
749-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
750-
runtime-node_modules-v6-
727+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
728+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
751729
- name: Ensure clean build directory
752730
run: rm -rf build
753731
- run: yarn install --frozen-lockfile
@@ -806,10 +784,8 @@ jobs:
806784
with:
807785
path: |
808786
**/node_modules
809-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
810-
restore-keys: |
811-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
812-
runtime-node_modules-v6-
787+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
788+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
813789
- name: Ensure clean build directory
814790
run: rm -rf build
815791
- 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
loadasreactLoad,
44
getSourceasgetSourceImpl,
55
transformSourceasreactTransformSource,
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
constReact=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
constapp=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
constpath=require('path');
66
consturl=require('url');
77

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

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

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

135136
asyncfunctionprerenderApp(res,returnValue,formState,noCache){
136137
const{prerenderToNodeStream}=awaitimport(
137-
'react-server-dom-webpack/static'
138+
'react-server-dom-unbundled/static'
138139
);
139140
// const m = require('../src/App.js');
140141
constm=awaitimport('../src/App.js');
@@ -202,7 +203,7 @@ app.get('/', async function (req, res) {
202203
app.post('/',bodyParser.text(),asyncfunction(req,res){
203204
constnoCache=req.headers['cache-control']==='no-cache';
204205
const{decodeReply, decodeReplyFromBusboy, decodeAction, decodeFormState}=
205-
awaitimport('react-server-dom-webpack/server');
206+
awaitimport('react-server-dom-unbundled/server');
206207
constserverReference=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*asReactfrom'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",

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); Patch Promise cycles and toString on Server Functions · react/react@dd05198 · GitHub
Skip to content

Commit dd05198

Browse files
sebmarkbageunstubbableeps1lon
committed
Patch Promise cycles and toString on Server Functions
[Flight] Move `react-server-dom-webpack/*.unbundled` to private `react-server-dom-unbundled` (#35290) Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de> Co-authored-by: Sebastian "Sebbie" Silbermann <silbermann.sebastian@gmail.com>
1 parent 0eeded6 commit dd05198

58 files changed

Lines changed: 3388 additions & 368 deletions

File tree

Some content is hidden

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

‎.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
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
path: |
4747
**/node_modules
48-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
48+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
4949
lookup-only: true
5050
- uses: actions/setup-node@v4
5151
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -59,10 +59,8 @@ jobs:
5959
with:
6060
path: |
6161
**/node_modules
62-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63-
restore-keys: |
64-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
65-
runtime-node_modules-v6-
62+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
6664
- run: yarn install --frozen-lockfile
6765
if: steps.node_modules.outputs.cache-hit != 'true'
6866
- name: Save cache
@@ -71,7 +69,7 @@ jobs:
7169
with:
7270
path: |
7371
**/node_modules
74-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
72+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
7573

7674
runtime_compiler_node_modules_cache:
7775
name: Cache Runtime, Compiler node_modules
@@ -86,7 +84,7 @@ jobs:
8684
with:
8785
path: |
8886
**/node_modules
89-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
87+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
9088
lookup-only: true
9189
- uses: actions/setup-node@v4
9290
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -102,10 +100,8 @@ jobs:
102100
with:
103101
path: |
104102
**/node_modules
105-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
106-
restore-keys: |
107-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
108-
runtime-and-compiler-node_modules-v6-
103+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
104+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
109105
- run: yarn install --frozen-lockfile
110106
if: steps.node_modules.outputs.cache-hit != 'true'
111107
- run: yarn --cwd compiler install --frozen-lockfile
@@ -116,7 +112,7 @@ jobs:
116112
with:
117113
path: |
118114
**/node_modules
119-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
115+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
120116

121117
# ----- FLOW -----
122118
discover_flow_inline_configs:
@@ -158,10 +154,8 @@ jobs:
158154
with:
159155
path: |
160156
**/node_modules
161-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
162-
restore-keys: |
163-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
164-
runtime-node_modules-v6-
157+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
158+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
165159
- name: Ensure clean build directory
166160
run: rm -rf build
167161
- run: yarn install --frozen-lockfile
@@ -188,10 +182,8 @@ jobs:
188182
with:
189183
path: |
190184
**/node_modules
191-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
192-
restore-keys: |
193-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
194-
runtime-node_modules-v6-
185+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
186+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
195187
- name: Ensure clean build directory
196188
run: rm -rf build
197189
- run: yarn install --frozen-lockfile
@@ -220,7 +212,7 @@ jobs:
220212
with:
221213
path: |
222214
**/node_modules
223-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
215+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
224216
- name: Ensure clean build directory
225217
run: rm -rf build
226218
- run: yarn install --frozen-lockfile
@@ -278,10 +270,8 @@ jobs:
278270
with:
279271
path: |
280272
**/node_modules
281-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
282-
restore-keys: |
283-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
284-
runtime-and-compiler-node_modules-v6-
273+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
274+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
285275
- name: Ensure clean build directory
286276
run: rm -rf build
287277
- run: yarn install --frozen-lockfile
@@ -310,7 +300,7 @@ jobs:
310300
with:
311301
path: |
312302
**/node_modules
313-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
303+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
314304
- name: Install runtime dependencies
315305
run: yarn install --frozen-lockfile
316306
if: steps.node_modules.outputs.cache-hit != 'true'
@@ -353,10 +343,8 @@ jobs:
353343
with:
354344
path: |
355345
**/node_modules
356-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
357-
restore-keys: |
358-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
359-
runtime-and-compiler-node_modules-v6-
346+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
347+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
360348
- name: Ensure clean build directory
361349
run: rm -rf build
362350
- run: yarn install --frozen-lockfile
@@ -444,10 +432,8 @@ jobs:
444432
with:
445433
path: |
446434
**/node_modules
447-
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
448-
restore-keys: |
449-
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
450-
runtime-and-compiler-node_modules-v6-
435+
key: runtime-and-compiler-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
436+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
451437
- name: Ensure clean build directory
452438
run: rm -rf build
453439
- run: yarn install --frozen-lockfile
@@ -487,10 +473,8 @@ jobs:
487473
with:
488474
path: |
489475
**/node_modules
490-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
491-
restore-keys: |
492-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
493-
runtime-node_modules-v6-
476+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
477+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
494478
- name: Ensure clean build directory
495479
run: rm -rf build
496480
- run: yarn install --frozen-lockfile
@@ -552,10 +536,8 @@ jobs:
552536
with:
553537
path: |
554538
**/node_modules
555-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
556-
restore-keys: |
557-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
558-
runtime-node_modules-v6-
539+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
540+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
559541
- name: Ensure clean build directory
560542
run: rm -rf build
561543
- run: yarn install --frozen-lockfile
@@ -592,10 +574,8 @@ jobs:
592574
with:
593575
path: |
594576
**/node_modules
595-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
596-
restore-keys: |
597-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
598-
runtime-node_modules-v6-
577+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
578+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
599579
- name: Ensure clean build directory
600580
run: rm -rf build
601581
- run: yarn install --frozen-lockfile
@@ -744,10 +724,8 @@ jobs:
744724
with:
745725
path: |
746726
**/node_modules
747-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
748-
restore-keys: |
749-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
750-
runtime-node_modules-v6-
727+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
728+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
751729
- name: Ensure clean build directory
752730
run: rm -rf build
753731
- run: yarn install --frozen-lockfile
@@ -806,10 +784,8 @@ jobs:
806784
with:
807785
path: |
808786
**/node_modules
809-
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
810-
restore-keys: |
811-
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
812-
runtime-node_modules-v6-
787+
key: runtime-node_modules-v7-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
788+
# Don't use restore-keys here. Otherwise the cache grows indefinitely.
813789
- name: Ensure clean build directory
814790
run: rm -rf build
815791
- 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
loadasreactLoad,
44
getSourceasgetSourceImpl,
55
transformSourceasreactTransformSource,
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
constReact=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
constapp=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
constpath=require('path');
66
consturl=require('url');
77

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

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

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

135136
asyncfunctionprerenderApp(res,returnValue,formState,noCache){
136137
const{prerenderToNodeStream}=awaitimport(
137-
'react-server-dom-webpack/static'
138+
'react-server-dom-unbundled/static'
138139
);
139140
// const m = require('../src/App.js');
140141
constm=awaitimport('../src/App.js');
@@ -202,7 +203,7 @@ app.get('/', async function (req, res) {
202203
app.post('/',bodyParser.text(),asyncfunction(req,res){
203204
constnoCache=req.headers['cache-control']==='no-cache';
204205
const{decodeReply, decodeReplyFromBusboy, decodeAction, decodeFormState}=
205-
awaitimport('react-server-dom-webpack/server');
206+
awaitimport('react-server-dom-unbundled/server');
206207
constserverReference=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*asReactfrom'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",

0 commit comments

Comments
 (0)