From 315ea3cea2a433d9c987c883e772d32d29635d48 Mon Sep 17 00:00:00 2001 From: Rhys Sullivan <39114868+RhysSullivan@users.noreply.github.com> Date: Sun, 20 Sep 2026 04:05:55 -0700 Subject: [PATCH 1/2] Preload console route chunks on sidebar link hover. (#2081) Co-authored-by: Cursor --- apps/cloud/src/router.tsx | 4 ++-- apps/host-cloudflare/web/router.tsx | 4 ++-- apps/host-selfhost/web/router.tsx | 4 ++-- packages/app/src/router.tsx | 4 ++-- packages/react/package.json | 1 + packages/react/src/console-router-options.ts | 11 +++++++++++ 6 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 packages/react/src/console-router-options.ts diff --git a/apps/cloud/src/router.tsx b/apps/cloud/src/router.tsx index 4c74669727..2ce679a7c4 100644 --- a/apps/cloud/src/router.tsx +++ b/apps/cloud/src/router.tsx @@ -1,10 +1,10 @@ import { createRouter } from "@tanstack/react-router"; +import { sharedConsoleRouterOptions } from "@executor-js/react/console-router-options"; import { routeTree } from "./routeTree.gen"; export const getRouter = () => { return createRouter({ routeTree, - scrollRestoration: true, - defaultPreloadStaleTime: 0, + ...sharedConsoleRouterOptions, }); }; diff --git a/apps/host-cloudflare/web/router.tsx b/apps/host-cloudflare/web/router.tsx index 0d1f426510..d98c640b2a 100644 --- a/apps/host-cloudflare/web/router.tsx +++ b/apps/host-cloudflare/web/router.tsx @@ -1,10 +1,10 @@ import { createRouter } from "@tanstack/react-router"; +import { sharedConsoleRouterOptions } from "@executor-js/react/console-router-options"; import { routeTree } from "./routeTree.gen"; export const getRouter = () => createRouter({ routeTree, - scrollRestoration: true, - defaultPreloadStaleTime: 0, + ...sharedConsoleRouterOptions, }); diff --git a/apps/host-selfhost/web/router.tsx b/apps/host-selfhost/web/router.tsx index 0d1f426510..d98c640b2a 100644 --- a/apps/host-selfhost/web/router.tsx +++ b/apps/host-selfhost/web/router.tsx @@ -1,10 +1,10 @@ import { createRouter } from "@tanstack/react-router"; +import { sharedConsoleRouterOptions } from "@executor-js/react/console-router-options"; import { routeTree } from "./routeTree.gen"; export const getRouter = () => createRouter({ routeTree, - scrollRestoration: true, - defaultPreloadStaleTime: 0, + ...sharedConsoleRouterOptions, }); diff --git a/packages/app/src/router.tsx b/packages/app/src/router.tsx index 4c74669727..2ce679a7c4 100644 --- a/packages/app/src/router.tsx +++ b/packages/app/src/router.tsx @@ -1,10 +1,10 @@ import { createRouter } from "@tanstack/react-router"; +import { sharedConsoleRouterOptions } from "@executor-js/react/console-router-options"; import { routeTree } from "./routeTree.gen"; export const getRouter = () => { return createRouter({ routeTree, - scrollRestoration: true, - defaultPreloadStaleTime: 0, + ...sharedConsoleRouterOptions, }); }; diff --git a/packages/react/package.json b/packages/react/package.json index 62e41b5c4b..12c1c28144 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -9,6 +9,7 @@ "bun": "./src/console-routes.ts", "default": "./dist/console-routes.js" }, + "./console-router-options": "./src/console-router-options.ts", "./api/oauth-popup": "./src/api/oauth-popup.ts", "./api/shell-host": "./src/api/shell-host.ts", "./api/*": "./src/api/*.tsx", diff --git a/packages/react/src/console-router-options.ts b/packages/react/src/console-router-options.ts new file mode 100644 index 0000000000..ba2e565b88 --- /dev/null +++ b/packages/react/src/console-router-options.ts @@ -0,0 +1,11 @@ +// Shared TanStack Router options for every Executor console host (desktop app, +// cloud, self-host, Cloudflare). Keep navigation snappy: code-split route +// chunks preload on link hover so clicking a sidebar tab does not suspend on +// an empty outlet while the chunk downloads. + +export const sharedConsoleRouterOptions = { + scrollRestoration: true, + defaultPreload: "intent" as const, + // Effect atoms own their own cache; we do not use route loaders for data. + defaultPreloadStaleTime: 0, +}; From d27e6737edf010d1b4ce915668e3a42cf5358196 Mon Sep 17 00:00:00 2001 From: Rhys Sullivan <39114868+RhysSullivan@users.noreply.github.com> Date: Sun, 20 Sep 2026 04:15:13 -0700 Subject: [PATCH 2/2] Revert "Preload console route chunks on sidebar link hover. (#2081)" (#2082) This reverts commit 315ea3cea2a433d9c987c883e772d32d29635d48. --- apps/cloud/src/router.tsx | 4 ++-- apps/host-cloudflare/web/router.tsx | 4 ++-- apps/host-selfhost/web/router.tsx | 4 ++-- packages/app/src/router.tsx | 4 ++-- packages/react/package.json | 1 - packages/react/src/console-router-options.ts | 11 ----------- 6 files changed, 8 insertions(+), 20 deletions(-) delete mode 100644 packages/react/src/console-router-options.ts diff --git a/apps/cloud/src/router.tsx b/apps/cloud/src/router.tsx index 2ce679a7c4..4c74669727 100644 --- a/apps/cloud/src/router.tsx +++ b/apps/cloud/src/router.tsx @@ -1,10 +1,10 @@ import { createRouter } from "@tanstack/react-router"; -import { sharedConsoleRouterOptions } from "@executor-js/react/console-router-options"; import { routeTree } from "./routeTree.gen"; export const getRouter = () => { return createRouter({ routeTree, - ...sharedConsoleRouterOptions, + scrollRestoration: true, + defaultPreloadStaleTime: 0, }); }; diff --git a/apps/host-cloudflare/web/router.tsx b/apps/host-cloudflare/web/router.tsx index d98c640b2a..0d1f426510 100644 --- a/apps/host-cloudflare/web/router.tsx +++ b/apps/host-cloudflare/web/router.tsx @@ -1,10 +1,10 @@ import { createRouter } from "@tanstack/react-router"; -import { sharedConsoleRouterOptions } from "@executor-js/react/console-router-options"; import { routeTree } from "./routeTree.gen"; export const getRouter = () => createRouter({ routeTree, - ...sharedConsoleRouterOptions, + scrollRestoration: true, + defaultPreloadStaleTime: 0, }); diff --git a/apps/host-selfhost/web/router.tsx b/apps/host-selfhost/web/router.tsx index d98c640b2a..0d1f426510 100644 --- a/apps/host-selfhost/web/router.tsx +++ b/apps/host-selfhost/web/router.tsx @@ -1,10 +1,10 @@ import { createRouter } from "@tanstack/react-router"; -import { sharedConsoleRouterOptions } from "@executor-js/react/console-router-options"; import { routeTree } from "./routeTree.gen"; export const getRouter = () => createRouter({ routeTree, - ...sharedConsoleRouterOptions, + scrollRestoration: true, + defaultPreloadStaleTime: 0, }); diff --git a/packages/app/src/router.tsx b/packages/app/src/router.tsx index 2ce679a7c4..4c74669727 100644 --- a/packages/app/src/router.tsx +++ b/packages/app/src/router.tsx @@ -1,10 +1,10 @@ import { createRouter } from "@tanstack/react-router"; -import { sharedConsoleRouterOptions } from "@executor-js/react/console-router-options"; import { routeTree } from "./routeTree.gen"; export const getRouter = () => { return createRouter({ routeTree, - ...sharedConsoleRouterOptions, + scrollRestoration: true, + defaultPreloadStaleTime: 0, }); }; diff --git a/packages/react/package.json b/packages/react/package.json index 12c1c28144..62e41b5c4b 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -9,7 +9,6 @@ "bun": "./src/console-routes.ts", "default": "./dist/console-routes.js" }, - "./console-router-options": "./src/console-router-options.ts", "./api/oauth-popup": "./src/api/oauth-popup.ts", "./api/shell-host": "./src/api/shell-host.ts", "./api/*": "./src/api/*.tsx", diff --git a/packages/react/src/console-router-options.ts b/packages/react/src/console-router-options.ts deleted file mode 100644 index ba2e565b88..0000000000 --- a/packages/react/src/console-router-options.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Shared TanStack Router options for every Executor console host (desktop app, -// cloud, self-host, Cloudflare). Keep navigation snappy: code-split route -// chunks preload on link hover so clicking a sidebar tab does not suspend on -// an empty outlet while the chunk downloads. - -export const sharedConsoleRouterOptions = { - scrollRestoration: true, - defaultPreload: "intent" as const, - // Effect atoms own their own cache; we do not use route loaders for data. - defaultPreloadStaleTime: 0, -};