diff --git a/.changeset/slow-guests-wait.md b/.changeset/slow-guests-wait.md
new file mode 100644
index 00000000000..daa1eb032cb
--- /dev/null
+++ b/.changeset/slow-guests-wait.md
@@ -0,0 +1,5 @@
+---
+"@remix-run/dev": patch
+---
+
+Revert `future.v3_optimizeDeps` back to `future.unstable_optimizeDeps` as it was not intended to stabilize in Remix v2
diff --git a/docs/guides/dependency-optimization.md b/docs/guides/dependency-optimization.md
index a92f9b3733c..7d06dbb0f56 100644
--- a/docs/guides/dependency-optimization.md
+++ b/docs/guides/dependency-optimization.md
@@ -6,8 +6,7 @@ title: Dependency optimization
# Dependency optimization
-Remix introduced automatic dependency optimization in development behind the `future.v3_optimizeDeps` [Future Flag][future-flags].
-This allows you to opt-into this behavior which will become the default in the next major version of Remix - a.k.a. React Router v7 ([1][rr-v7], [2][rr-v7-2]).
+Remix introduced automatic dependency optimization in development behind the `future.unstable_optimizeDeps` [Future Flag][future-flags]. This allows you to opt-into this behavior which will eventually become the default in some future version of Remix - a.k.a. React Router ([1][rr-v7], [2][rr-v7-2]). This flag is intended to remain "unstable" into React Router v7 as there is some additional bundling-related work coming that will ease adoption of the flag. We plan to stabilize the flag once that work is completed in v7.
In development, Vite aims to [prebundle dependencies][prebundle-dependencies] so that it can efficiently serve up those dependencies on-demand.
To do this, Vite needs to know where to start crawling your app's module graph to look for dependencies.
diff --git a/docs/start/future-flags.md b/docs/start/future-flags.md
index 1356d4937d1..664388b602b 100644
--- a/docs/start/future-flags.md
+++ b/docs/start/future-flags.md
@@ -472,25 +472,9 @@ You shouldn't need to make any changes to your application code for this feature
You may find some usage for the new [``][discover-prop] API if you wish to disable eager route discovery on certain links.
-## v3_optimizeDeps
+## unstable_optimizeDeps
-**Background**
-
-This flag allows you to opt-into automatic [dependency optimization][dependency-optimization] during development when using Vite.
-
-👉 **Enable the Flag**
-
-```ts filename=vite.config.ts
-remix({
- future: {
- v3_optimizeDeps: true,
- },
-});
-```
-
-**Update your Code**
-
-You shouldn't need to make any changes to your application code for this feature to work.
+Opt into automatic [dependency optimization][dependency-optimization] during development. This flag will remain in an "unstable" state until React Router v7 so you do not need to adopt this in your Remix v2 app prior to upgrading to React Router v7.
[development-strategy]: ../guides/api-development-strategy
[fetcherpersist-rfc]: https://github.com/remix-run/remix/discussions/7698
diff --git a/packages/remix-dev/__tests__/readConfig-test.ts b/packages/remix-dev/__tests__/readConfig-test.ts
index bd06d50309f..f528c16f15e 100644
--- a/packages/remix-dev/__tests__/readConfig-test.ts
+++ b/packages/remix-dev/__tests__/readConfig-test.ts
@@ -36,9 +36,9 @@ describe("readConfig", () => {
"entryServerFile": "entry.server.tsx",
"entryServerFilePath": Any,
"future": {
+ "unstable_optimizeDeps": false,
"v3_fetcherPersist": false,
"v3_lazyRouteDiscovery": false,
- "v3_optimizeDeps": false,
"v3_relativeSplatPath": false,
"v3_singleFetch": false,
"v3_throwAbortReason": false,
diff --git a/packages/remix-dev/config.ts b/packages/remix-dev/config.ts
index b6cb6dd8f01..16065ff01af 100644
--- a/packages/remix-dev/config.ts
+++ b/packages/remix-dev/config.ts
@@ -39,7 +39,7 @@ interface FutureConfig {
v3_throwAbortReason: boolean;
v3_singleFetch: boolean;
v3_lazyRouteDiscovery: boolean;
- v3_optimizeDeps: boolean;
+ unstable_optimizeDeps: boolean;
}
type NodeBuiltinsPolyfillOptions = Pick<
@@ -605,7 +605,7 @@ export async function resolveConfig(
v3_throwAbortReason: appConfig.future?.v3_throwAbortReason === true,
v3_singleFetch: appConfig.future?.v3_singleFetch === true,
v3_lazyRouteDiscovery: appConfig.future?.v3_lazyRouteDiscovery === true,
- v3_optimizeDeps: appConfig.future?.v3_optimizeDeps === true,
+ unstable_optimizeDeps: appConfig.future?.unstable_optimizeDeps === true,
};
if (appConfig.future) {
diff --git a/packages/remix-dev/vite/plugin.ts b/packages/remix-dev/vite/plugin.ts
index c886f7fcbcf..53ce6400b57 100644
--- a/packages/remix-dev/vite/plugin.ts
+++ b/packages/remix-dev/vite/plugin.ts
@@ -1075,7 +1075,7 @@ export const remixVitePlugin: RemixVitePlugin = (remixUserConfig = {}) => {
: undefined,
},
optimizeDeps: {
- entries: ctx.remixConfig.future.v3_optimizeDeps
+ entries: ctx.remixConfig.future.unstable_optimizeDeps
? [
ctx.entryClientFilePath,
...Object.values(ctx.remixConfig.routes).map((route) =>