Skip to content

Commit 3d568c7

Browse files
authored
refactor(rsc)!: remove deprecated features (#917)
1 parent 0ccfc44 commit 3d568c7

File tree

14 files changed

+6
-338
lines changed

14 files changed

+6
-338
lines changed

packages/plugin-rsc/examples/basic/src/framework/entry.rsc.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export async function handleRequest({
8585
}
8686

8787
// Delegate to SSR environment for html rendering.
88-
// The plugin provides `loadSsrModule` helper to allow loading SSR environment entry module
88+
// The plugin provides `loadModule` helper to allow loading SSR environment entry module
8989
// in RSC environment. however this can be customized by implementing own runtime communication
9090
// e.g. `@cloudflare/vite-plugin`'s service binding.
9191
const ssrEntryModule = await import.meta.viteRsc.loadModule<

packages/plugin-rsc/examples/e2e/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"@vitejs/plugin-rsc": "latest",
88
"babel-plugin-react-compiler": "19.1.0-rc.3",
99
"connect": "^3.7.0",
10+
"rsc-html-stream": "^0.0.7",
1011
"sirv": "^3.0.2"
1112
}
1213
}

packages/plugin-rsc/examples/starter/src/framework/entry.rsc.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default async function handler(request: Request): Promise<Response> {
8585
}
8686

8787
// Delegate to SSR environment for html rendering.
88-
// The plugin provides `loadSsrModule` helper to allow loading SSR environment entry module
88+
// The plugin provides `loadModule` helper to allow loading SSR environment entry module
8989
// in RSC environment. however this can be customized by implementing own runtime communication
9090
// e.g. `@cloudflare/vite-plugin`'s service binding.
9191
const ssrEntryModule = await import.meta.viteRsc.loadModule<

packages/plugin-rsc/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
"react": "^19.1.1",
6161
"react-dom": "^19.1.1",
6262
"react-server-dom-webpack": "^19.1.1",
63-
"rsc-html-stream": "^0.0.7",
6463
"tinyexec": "^1.0.1",
6564
"tsdown": "^0.15.6"
6665
},

packages/plugin-rsc/src/extra/browser.tsx

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

packages/plugin-rsc/src/extra/rsc.tsx

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

packages/plugin-rsc/src/extra/ssr.tsx

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

packages/plugin-rsc/src/plugin.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ export type RscPluginOptions = {
124124
*/
125125
entries?: Partial<Record<'client' | 'ssr' | 'rsc', string>>
126126

127-
/** @deprecated use `serverHandler: false` */
128-
disableServerHandler?: boolean
129-
130127
/** @default { enviornmentName: "rsc", entryName: "index" } */
131128
serverHandler?:
132129
| {
@@ -140,9 +137,6 @@ export type RscPluginOptions = {
140137

141138
rscCssTransform?: false | { filter?: (id: string) => boolean }
142139

143-
/** @deprecated use "DEBUG=vite-env:*" to see warnings. */
144-
ignoredPackageWarnings?: (string | RegExp)[]
145-
146140
/**
147141
* This option allows customizing how client build copies assets from server build.
148142
* By default, all assets are copied, but frameworks can establish server asset convention
@@ -502,7 +496,6 @@ export default function vitePluginRsc(
502496
return oldSend.apply(this, args as any)
503497
}
504498

505-
if (rscPluginOptions.disableServerHandler) return
506499
if (rscPluginOptions.serverHandler === false) return
507500
const options = rscPluginOptions.serverHandler ?? {
508501
environmentName: 'rsc',
@@ -539,7 +532,6 @@ export default function vitePluginRsc(
539532
}
540533
},
541534
async configurePreviewServer(server) {
542-
if (rscPluginOptions.disableServerHandler) return
543535
if (rscPluginOptions.serverHandler === false) return
544536
const options = rscPluginOptions.serverHandler ?? {
545537
environmentName: 'rsc',
@@ -701,18 +693,6 @@ export default function vitePluginRsc(
701693
},
702694
},
703695
},
704-
{
705-
// backward compat: `loadSsrModule(name)` implemented as `loadModule("ssr", name)`
706-
name: 'rsc:load-ssr-module',
707-
transform(code) {
708-
if (code.includes('import.meta.viteRsc.loadSsrModule(')) {
709-
return code.replaceAll(
710-
`import.meta.viteRsc.loadSsrModule(`,
711-
`import.meta.viteRsc.loadModule("ssr", `,
712-
)
713-
}
714-
},
715-
},
716696
{
717697
// allow loading entry module in other environment by
718698
// - (dev) rewriting to `server.environments[<env>].runner.import(<entry>)`

packages/plugin-rsc/src/rsc-html-stream/browser.ts

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

packages/plugin-rsc/src/rsc-html-stream/ssr.ts

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

0 commit comments

Comments
 (0)