Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/cloud/src/router.tsx
Original file line number Diff line number Diff line change
@@ -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,
});
};
4 changes: 2 additions & 2 deletions apps/host-cloudflare/web/router.tsx
Original file line number Diff line number Diff line change
@@ -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,
});
4 changes: 2 additions & 2 deletions apps/host-selfhost/web/router.tsx
Original file line number Diff line number Diff line change
@@ -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,
});
4 changes: 2 additions & 2 deletions packages/app/src/router.tsx
Original file line number Diff line number Diff line change
@@ -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,
});
};
1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions packages/react/src/console-router-options.ts
Original file line number Diff line number Diff line change
@@ -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,
};
Loading