Skip to content

Commit 9f123ca

Browse files
fix(dev/config): update default RSC entries to support formState for progressive enhanced actions (#14248)
chore(rsc): update default RSC entries to support formState for progressive enahnced actions chore (rsc): Remove rsc-parcel-framework tests. I'm not maintaining that and I don't want problems against it to slow down progress for library and (vite) framework modes. fix(rsc): decode each time `getPayload()` is called to allow for "in-context" decoding and hoisting of contextual assets chore(rsc): use `vite build` for rsc framework fixtures chore(rsc): Skip flaky RSC Framework Mode HMR test expectation --------- Co-authored-by: Mark Dalgleish <[email protected]>
1 parent 813a935 commit 9f123ca

Some content is hidden

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

60 files changed

+821
-1629
lines changed

.changeset/shiny-hotels-guess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
decode each time `getPayload()` is called to allow for "in-context" decoding and hoisting of contextual assets

integration/action-test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { type TemplateName, reactRouterConfig } from "./helpers/vite.js";
1111

1212
const templateNames = [
1313
"vite-5-template",
14-
"rsc-parcel-framework",
1514
"rsc-vite-framework",
1615
] as const satisfies TemplateName[];
1716

integration/catch-boundary-data-test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { reactRouterConfig, type TemplateName } from "./helpers/vite.js";
1111

1212
const templateNames = [
1313
"vite-5-template",
14-
"rsc-parcel-framework",
1514
"rsc-vite-framework",
1615
] as const satisfies TemplateName[];
1716

integration/helpers/create-fixture.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,6 @@ export async function createFixture(init: FixtureInit, mode?: ServerMode) {
205205
"Expected a default request handler function export in Vite RSC Framework Mode server build",
206206
);
207207
}
208-
} else if (templateName === "rsc-parcel-framework") {
209-
let serverBuild = await import(buildPath);
210-
handler = (serverBuild?.requestHandler ??
211-
serverBuild?.default?.requestHandler) as RequestHandler;
212-
if (typeof handler !== "function") {
213-
throw new Error(
214-
"Expected a 'requestHandler' function export in Parcel RSC Framework server build",
215-
);
216-
}
217208
} else {
218209
build = (await import(buildPath)) as ServerBuild;
219210
handler = createRequestHandler(build, mode || ServerMode.Production);
@@ -489,7 +480,12 @@ export async function createFixtureProject(
489480
if (templateName.includes("parcel")) {
490481
parcelBuild(projectDir, init.buildStdio, mode);
491482
} else {
492-
reactRouterBuild(projectDir, init.buildStdio, mode);
483+
reactRouterBuild(
484+
projectDir,
485+
init.buildStdio,
486+
mode,
487+
templateName.includes("rsc"),
488+
);
493489
}
494490

495491
return projectDir;
@@ -535,6 +531,7 @@ function reactRouterBuild(
535531
projectDir: string,
536532
buildStdio?: Writable,
537533
mode?: ServerMode,
534+
isRsc?: boolean,
538535
) {
539536
// We have a "require" instead of a dynamic import in readConfig gated
540537
// behind mode === ServerMode.Test to make jest happy, but that doesn't
@@ -544,8 +541,9 @@ function reactRouterBuild(
544541
mode = mode === ServerMode.Test ? ServerMode.Production : mode;
545542

546543
let reactRouterBin = "node_modules/@react-router/dev/dist/cli/index.js";
544+
let viteBin = "node_modules/vite/dist/node/cli.js";
547545

548-
let buildArgs: string[] = [reactRouterBin, "build"];
546+
let buildArgs: string[] = [isRsc ? viteBin : reactRouterBin, "build"];
549547

550548
let buildSpawn = spawnSync("node", buildArgs, {
551549
cwd: projectDir,

integration/helpers/rsc-parcel-framework/.gitignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

integration/helpers/rsc-parcel-framework/.parcelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

integration/helpers/rsc-parcel-framework/app/entry.browser.tsx

Lines changed: 0 additions & 41 deletions
This file was deleted.

integration/helpers/rsc-parcel-framework/app/entry.rsc.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

integration/helpers/rsc-parcel-framework/app/index.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

integration/helpers/rsc-parcel-framework/app/root.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)