Skip to content

Commit 656aa29

Browse files
feat(remix-dev/vite): remove unstable prefix from serverBundles (#8596)
1 parent ec21f5d commit 656aa29

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

integration/vite-adapter-test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ test.describe(async () => {
3232
pluginOptions: `
3333
{
3434
adapter: async ({ remixConfig }) => ({
35-
unstable_serverBundles(...args) {
35+
serverBundles(...args) {
3636
// This lets us assert that user options are passed to adapter options hook
37-
return remixConfig.unstable_serverBundles?.(...args) + "--adapter-options";
37+
return remixConfig.serverBundles?.(...args) + "--adapter-options";
3838
},
3939
async buildEnd(args) {
4040
let fs = await import("node:fs/promises");
@@ -53,7 +53,7 @@ test.describe(async () => {
5353
}
5454
}),
5555
56-
unstable_serverBundles() {
56+
serverBundles() {
5757
return "user-options";
5858
}
5959
},
@@ -64,7 +64,7 @@ test.describe(async () => {
6464
});
6565
test.afterAll(() => stop());
6666

67-
test("Vite / adapter / unstable_serverBundles and buildEnd hooks", async () => {
67+
test("Vite / adapter / serverBundles and buildEnd hooks", async () => {
6868
let { status } = viteBuild({ cwd });
6969
expect(status).toBe(0);
7070

integration/vite-server-bundles-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ test.describe(() => {
122122
port: devPort,
123123
pluginOptions: `{
124124
manifest: true,
125-
unstable_serverBundles: async ({ branch }) => {
125+
serverBundles: async ({ branch }) => {
126126
// Smoke test to ensure we can read the route files via 'route.file'
127127
await Promise.all(branch.map(async (route) => {
128128
const fs = await import("node:fs/promises");

packages/remix-dev/vite/build.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ async function getServerBuilds(ctx: RemixPluginContext): Promise<{
153153
),
154154
});
155155
if (typeof serverBundleId !== "string") {
156-
throw new Error(
157-
`The "unstable_serverBundles" function must return a string`
158-
);
156+
throw new Error(`The "serverBundles" function must return a string`);
159157
}
160158
buildManifest.routeIdToServerBundleId[route.id] = serverBundleId;
161159

packages/remix-dev/vite/plugin.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export type ServerBundlesBuildManifest = BaseBuildManifest & {
112112
export type BuildManifest = DefaultBuildManifest | ServerBundlesBuildManifest;
113113

114114
const adapterRemixConfigOverrideKeys = [
115-
"unstable_serverBundles",
115+
"serverBundles",
116116
] as const satisfies ReadonlyArray<keyof VitePluginConfig>;
117117

118118
type AdapterRemixConfigOverrideKey =
@@ -164,7 +164,7 @@ export type VitePluginConfig = RemixEsbuildUserConfigJsdocOverrides &
164164
* function should return a server bundle ID which will be used as the
165165
* bundle's directory name within the server build directory.
166166
*/
167-
unstable_serverBundles?: ServerBundlesFunction;
167+
serverBundles?: ServerBundlesFunction;
168168
/**
169169
* Enable server-side rendering for your application. Disable to use Remix in
170170
* "SPA Mode", which will request the `/` path at build-time and save it as
@@ -492,15 +492,14 @@ export const remixVitePlugin: RemixVitePlugin = (remixUserConfig = {}) => {
492492
resolvedRemixUserConfig.buildDirectory
493493
);
494494

495-
let { serverBuildFile, unstable_serverBundles: serverBundles } =
496-
resolvedRemixUserConfig;
495+
let { serverBuildFile, serverBundles } = resolvedRemixUserConfig;
497496

498497
// Log warning for incompatible vite config flags
499498
if (isSpaMode && serverBundles) {
500499
console.warn(
501500
colors.yellow(
502501
colors.bold("⚠️ SPA Mode: ") +
503-
"the `unstable_serverBundles` config is invalid with " +
502+
"the `serverBundles` config is invalid with " +
504503
"`unstable_ssr:false` and will be ignored`"
505504
)
506505
);

0 commit comments

Comments
 (0)