From a4b38297ed3b6f0b292633a938bb9531a343b93b Mon Sep 17 00:00:00 2001 From: Brooks Lybrand Date: Wed, 16 Oct 2024 17:01:56 -0500 Subject: [PATCH] Enable all stable future flags in templates (#10125) --- templates/cloudflare-workers/app/root.tsx | 2 +- templates/cloudflare-workers/app/routes/_index.tsx | 2 +- templates/cloudflare-workers/vite.config.ts | 8 ++++++++ templates/cloudflare/vite.config.ts | 8 ++++++++ templates/express/vite.config.ts | 8 ++++++++ templates/remix-javascript/vite.config.js | 2 ++ templates/remix/vite.config.ts | 8 ++++++++ templates/spa/vite.config.ts | 8 ++++++++ 8 files changed, 44 insertions(+), 2 deletions(-) diff --git a/templates/cloudflare-workers/app/root.tsx b/templates/cloudflare-workers/app/root.tsx index 61c8b983d28..20aa6c7cb5f 100644 --- a/templates/cloudflare-workers/app/root.tsx +++ b/templates/cloudflare-workers/app/root.tsx @@ -5,7 +5,7 @@ import { Scripts, ScrollRestoration, } from "@remix-run/react"; -import type { LinksFunction } from "@remix-run/node"; +import type { LinksFunction } from "@remix-run/cloudflare"; import "./tailwind.css"; diff --git a/templates/cloudflare-workers/app/routes/_index.tsx b/templates/cloudflare-workers/app/routes/_index.tsx index 13a5c00468c..afdf49c446e 100644 --- a/templates/cloudflare-workers/app/routes/_index.tsx +++ b/templates/cloudflare-workers/app/routes/_index.tsx @@ -1,4 +1,4 @@ -import type { MetaFunction } from "@remix-run/node"; +import type { MetaFunction } from "@remix-run/cloudflare"; export const meta: MetaFunction = () => { return [ diff --git a/templates/cloudflare-workers/vite.config.ts b/templates/cloudflare-workers/vite.config.ts index 1419d99e9e8..f4ff5f65862 100644 --- a/templates/cloudflare-workers/vite.config.ts +++ b/templates/cloudflare-workers/vite.config.ts @@ -5,6 +5,12 @@ import { } from "@remix-run/dev"; import tsconfigPaths from "vite-tsconfig-paths"; +declare module "@remix-run/cloudflare" { + interface Future { + v3_singleFetch: true; + } +} + export default defineConfig({ plugins: [ cloudflareDevProxyVitePlugin(), @@ -13,6 +19,8 @@ export default defineConfig({ v3_fetcherPersist: true, v3_relativeSplatPath: true, v3_throwAbortReason: true, + v3_singleFetch: true, + v3_lazyRouteDiscovery: true, }, }), tsconfigPaths(), diff --git a/templates/cloudflare/vite.config.ts b/templates/cloudflare/vite.config.ts index 8c8a052d9af..198f5f5e30a 100644 --- a/templates/cloudflare/vite.config.ts +++ b/templates/cloudflare/vite.config.ts @@ -5,6 +5,12 @@ import { import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; +declare module "@remix-run/cloudflare" { + interface Future { + v3_singleFetch: true; + } +} + export default defineConfig({ plugins: [ remixCloudflareDevProxy(), @@ -13,6 +19,8 @@ export default defineConfig({ v3_fetcherPersist: true, v3_relativeSplatPath: true, v3_throwAbortReason: true, + v3_singleFetch: true, + v3_lazyRouteDiscovery: true, }, }), tsconfigPaths(), diff --git a/templates/express/vite.config.ts b/templates/express/vite.config.ts index 54066fb7ad8..e4e8cefc3ba 100644 --- a/templates/express/vite.config.ts +++ b/templates/express/vite.config.ts @@ -2,6 +2,12 @@ import { vitePlugin as remix } from "@remix-run/dev"; import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; +declare module "@remix-run/node" { + interface Future { + v3_singleFetch: true; + } +} + export default defineConfig({ plugins: [ remix({ @@ -9,6 +15,8 @@ export default defineConfig({ v3_fetcherPersist: true, v3_relativeSplatPath: true, v3_throwAbortReason: true, + v3_singleFetch: true, + v3_lazyRouteDiscovery: true, }, }), tsconfigPaths(), diff --git a/templates/remix-javascript/vite.config.js b/templates/remix-javascript/vite.config.js index c7eff5b1f2f..3f35644be29 100644 --- a/templates/remix-javascript/vite.config.js +++ b/templates/remix-javascript/vite.config.js @@ -8,6 +8,8 @@ export default defineConfig({ v3_fetcherPersist: true, v3_relativeSplatPath: true, v3_throwAbortReason: true, + v3_singleFetch: true, + v3_lazyRouteDiscovery: true, }, }), ], diff --git a/templates/remix/vite.config.ts b/templates/remix/vite.config.ts index 54066fb7ad8..e4e8cefc3ba 100644 --- a/templates/remix/vite.config.ts +++ b/templates/remix/vite.config.ts @@ -2,6 +2,12 @@ import { vitePlugin as remix } from "@remix-run/dev"; import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; +declare module "@remix-run/node" { + interface Future { + v3_singleFetch: true; + } +} + export default defineConfig({ plugins: [ remix({ @@ -9,6 +15,8 @@ export default defineConfig({ v3_fetcherPersist: true, v3_relativeSplatPath: true, v3_throwAbortReason: true, + v3_singleFetch: true, + v3_lazyRouteDiscovery: true, }, }), tsconfigPaths(), diff --git a/templates/spa/vite.config.ts b/templates/spa/vite.config.ts index ba7e285aa1e..282510dd8f0 100644 --- a/templates/spa/vite.config.ts +++ b/templates/spa/vite.config.ts @@ -2,6 +2,12 @@ import { vitePlugin as remix } from "@remix-run/dev"; import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; +declare module "@remix-run/node" { + interface Future { + v3_singleFetch: true; + } +} + export default defineConfig({ plugins: [ remix({ @@ -10,6 +16,8 @@ export default defineConfig({ v3_fetcherPersist: true, v3_relativeSplatPath: true, v3_throwAbortReason: true, + v3_singleFetch: true, + v3_lazyRouteDiscovery: true, }, }), tsconfigPaths(),