From b3af7f39b3262c471e5641d47ea7c1d2de436378 Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Thu, 20 Feb 2025 22:09:50 -0700
Subject: [PATCH 001/155] fix: global middleware
Fixes global middleware with a solution to ensuring registerGlobalMiddleware runs on both the client and server no matter what
---
docs/start/framework/react/middleware.md | 8 +-
.../react/start-basic/app/server-functions.ts | 8 ++
packages/react-start-plugin/src/index.ts | 124 +++++++++++-------
packages/start-config/src/index.ts | 9 +-
packages/start-config/src/schema.ts | 2 +-
5 files changed, 98 insertions(+), 53 deletions(-)
create mode 100644 examples/react/start-basic/app/server-functions.ts
diff --git a/docs/start/framework/react/middleware.md b/docs/start/framework/react/middleware.md
index c908f5b895..5d0f0d67d1 100644
--- a/docs/start/framework/react/middleware.md
+++ b/docs/start/framework/react/middleware.md
@@ -296,13 +296,13 @@ Middleware can be used in two different ways:
Global middleware runs automatically for every server function in your application. This is useful for functionality like authentication, logging, and monitoring that should apply to all requests.
-To use global middleware, create a `global-middleware.ts` file in your project (typically at `app/global-middleware.ts`). This file runs in both client and server environments and is where you register global middleware.
+To use global middleware, create a `server-functions.ts` file in your project (typically at `app/server-functions.ts`). This file runs in both client and server environments and is where you register global middleware.
Here's how to register global middleware:
```tsx
-// app/global-middleware.ts
-import { registerGlobalMiddleware } from '@tanstack/react-start'
+// app/server-functions.ts
+import { registerGlobalMiddleware } from '@tanstack/start'
import { authMiddleware } from './middleware'
registerGlobalMiddleware({
@@ -315,7 +315,7 @@ registerGlobalMiddleware({
Global middleware types are inherently **detached** from server functions themselves. This means that if a global middleware supplies additional context to server functions or other server function specific middleware, the types will not be automatically passed through to the server function or other server function specific middleware.
```tsx
-// app/global-middleware.ts
+// app/server-functions.ts
registerGlobalMiddleware({
middleware: [authMiddleware],
})
diff --git a/examples/react/start-basic/app/server-functions.ts b/examples/react/start-basic/app/server-functions.ts
new file mode 100644
index 0000000000..3896ec3143
--- /dev/null
+++ b/examples/react/start-basic/app/server-functions.ts
@@ -0,0 +1,8 @@
+import { registerGlobalMiddleware } from '@tanstack/start'
+import { logMiddleware } from './utils/loggingMiddleware'
+
+registerGlobalMiddleware({
+ middleware: [logMiddleware],
+})
+
+console.log('hello')
diff --git a/packages/react-start-plugin/src/index.ts b/packages/react-start-plugin/src/index.ts
index 6ab529afca..963b1b5d9f 100644
--- a/packages/react-start-plugin/src/index.ts
+++ b/packages/react-start-plugin/src/index.ts
@@ -1,16 +1,17 @@
import { fileURLToPath, pathToFileURL } from 'node:url'
import path from 'node:path'
-import { existsSync } from 'node:fs'
import { logDiff } from '@tanstack/router-utils'
import { compileStartOutput } from './compilers'
+
import type { Plugin } from 'vite'
const debug =
process.env.TSR_VITE_DEBUG &&
- ['true', 'react-start-plugin'].includes(process.env.TSR_VITE_DEBUG)
+ ['true', 'start-plugin'].includes(process.env.TSR_VITE_DEBUG)
export type TanStackStartViteOptions = {
- globalMiddlewareEntry: string
+ manifestVirtualImportId: string
+ serverFnEntry: string
}
const transformFuncs = [
@@ -30,54 +31,89 @@ export function createTanStackStartPlugin(opts: TanStackStartViteOptions): {
ssr: Array
server: Array
} {
- const globalMiddlewarePlugin = (): Plugin => {
- let entry: string | null = null
- let resolvedGlobalMiddlewareEntry: string | null = null
- let globalMiddlewareEntryExists = false
- let ROOT: string = process.cwd()
- return {
- name: 'vite-plugin-tanstack-start-ensure-global-middleware',
- enforce: 'pre',
- configResolved: (config) => {
- ROOT = config.root
- entry = path.resolve(ROOT, (config as any).router.handler)
- resolvedGlobalMiddlewareEntry = path.resolve(
- ROOT,
- opts.globalMiddlewareEntry,
- )
- globalMiddlewareEntryExists = existsSync(resolvedGlobalMiddlewareEntry)
-
- if (!entry) {
- throw new Error(
- '@tanstack/react-start-plugin: No server entry found!',
- )
- }
- },
- transform(code, id) {
- if (entry && id.includes(entry)) {
- if (globalMiddlewareEntryExists) {
- return {
- code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
- map: null,
- }
- }
- }
- return null
- },
- }
- }
-
return {
client: [
- globalMiddlewarePlugin(),
+ (() => {
+ let entry: string | null = null
+ let ROOT: string = process.cwd()
+ return {
+ name: 'vite-plugin-tanstack-start-server-entry-client',
+ enforce: 'pre',
+ configResolved: (config) => {
+ ROOT = config.root
+ entry = path.resolve(ROOT, (config as any).router.handler)
+
+ if (!entry) {
+ throw new Error('@tanstack/start-plugin: No server entry found!')
+ }
+ },
+ transform(code, id) {
+ if (entry && id.includes(entry)) {
+ return {
+ code: `${code}\n\nimport '${path.resolve(ROOT, opts.serverFnEntry)}'`,
+ map: null,
+ }
+ }
+ return null
+ },
+ }
+ })(),
TanStackStartServerFnsAndMiddleware({ ...opts, env: 'client' }),
],
ssr: [
- globalMiddlewarePlugin(),
+ (() => {
+ let entry: string | null = null
+ let ROOT: string = process.cwd()
+ return {
+ name: 'vite-plugin-tanstack-start-server-entry-ssr',
+ enforce: 'pre',
+ configResolved: (config) => {
+ ROOT = config.root
+ entry = path.resolve(ROOT, (config as any).router.handler)
+
+ if (!entry) {
+ throw new Error('@tanstack/start-plugin: No server entry found!')
+ }
+ },
+ transform(code, id) {
+ if (entry && id.includes(entry)) {
+ return {
+ code: `${code}\n\nimport '${path.resolve(ROOT, opts.serverFnEntry)}'`,
+ map: null,
+ }
+ }
+ return null
+ },
+ }
+ })(),
TanStackStartServerFnsAndMiddleware({ ...opts, env: 'ssr' }),
],
server: [
- globalMiddlewarePlugin(),
+ (() => {
+ let entry: string | null = null
+ let ROOT: string = process.cwd()
+ return {
+ name: 'vite-plugin-tanstack-start-server-entry-server',
+ enforce: 'pre',
+ configResolved: (config) => {
+ ROOT = config.root
+ entry = path.resolve(ROOT, (config as any).router.handler)
+
+ if (!entry) {
+ throw new Error('@tanstack/start-plugin: No server entry found!')
+ }
+ },
+ transform(code, id) {
+ if (entry && id.includes(entry)) {
+ return {
+ code: `${code}\n\nimport '${path.resolve(ROOT, opts.serverFnEntry)}'`,
+ map: null,
+ }
+ }
+ return null
+ },
+ }
+ })(),
TanStackStartServerFnsAndMiddleware({ ...opts, env: 'server' }),
],
}
@@ -112,7 +148,7 @@ export function TanStackStartServerFnsAndMiddleware(opts: {
if (code.includes('@react-refresh')) {
throw new Error(
- `We detected that the '@vitejs/plugin-react' was passed before '@tanstack/react-start-plugin'. Please make sure that '@tanstack/router-vite-plugin' is passed before '@vitejs/plugin-react' and try again:
+ `We detected that the '@vitejs/plugin-react' was passed before '@tanstack/start-plugin'. Please make sure that '@tanstack/router-vite-plugin' is passed before '@vitejs/plugin-react' and try again:
e.g.
plugins: [
diff --git a/packages/start-config/src/index.ts b/packages/start-config/src/index.ts
index f2d1d06d1a..3fd5a46664 100644
--- a/packages/start-config/src/index.ts
+++ b/packages/start-config/src/index.ts
@@ -110,9 +110,9 @@ export async function defineConfig(
const ssrEntry =
opts.routers?.ssr?.entry || path.join(appDirectory, 'ssr.tsx')
const apiEntry = opts.routers?.api?.entry || path.join(appDirectory, 'api.ts')
- const globalMiddlewareEntry =
- opts.routers?.server?.globalMiddlewareEntry ||
- path.join(appDirectory, 'global-middleware.ts')
+ const serverFnEntry =
+ opts.routers?.server?.entry ||
+ path.join(appDirectory, 'server-functions.ts')
const apiEntryExists = existsSync(apiEntry)
const viteConfig = getUserViteConfig(opts.vite)
@@ -141,7 +141,8 @@ export async function defineConfig(
})
const TanStackStartPlugin = createTanStackStartPlugin({
- globalMiddlewareEntry,
+ serverFnEntry,
+ manifestVirtualImportId: 'tsr:start-manifest',
})
// Create a dummy nitro app to get the resolved public output path
diff --git a/packages/start-config/src/schema.ts b/packages/start-config/src/schema.ts
index 516e4e86fa..5dc171bdd9 100644
--- a/packages/start-config/src/schema.ts
+++ b/packages/start-config/src/schema.ts
@@ -158,7 +158,7 @@ const routersSchema = z.object({
server: z
.object({
base: z.string().optional(),
- globalMiddlewareEntry: z.string().optional(),
+ entry: z.string().optional(),
middleware: z.string().optional(),
vite: viteSchema.optional(),
})
From 346174a1550dd0f27e5bb808cfe849f9091434ba Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Fri, 21 Feb 2025 09:51:41 -0700
Subject: [PATCH 002/155] fix: rename to global-middleware.ts
---
docs/start/framework/react/middleware.md | 6 +++---
examples/react/start-basic/app/server-functions.ts | 8 --------
packages/react-start-plugin/src/index.ts | 9 ++++-----
packages/start-config/src/index.ts | 9 ++++-----
packages/start-config/src/schema.ts | 2 +-
5 files changed, 12 insertions(+), 22 deletions(-)
delete mode 100644 examples/react/start-basic/app/server-functions.ts
diff --git a/docs/start/framework/react/middleware.md b/docs/start/framework/react/middleware.md
index 5d0f0d67d1..a8e71d26b1 100644
--- a/docs/start/framework/react/middleware.md
+++ b/docs/start/framework/react/middleware.md
@@ -296,12 +296,12 @@ Middleware can be used in two different ways:
Global middleware runs automatically for every server function in your application. This is useful for functionality like authentication, logging, and monitoring that should apply to all requests.
-To use global middleware, create a `server-functions.ts` file in your project (typically at `app/server-functions.ts`). This file runs in both client and server environments and is where you register global middleware.
+To use global middleware, create a `global-middleware.ts` file in your project (typically at `app/global-middleware.ts`). This file runs in both client and server environments and is where you register global middleware.
Here's how to register global middleware:
```tsx
-// app/server-functions.ts
+// app/global-middleware.ts
import { registerGlobalMiddleware } from '@tanstack/start'
import { authMiddleware } from './middleware'
@@ -315,7 +315,7 @@ registerGlobalMiddleware({
Global middleware types are inherently **detached** from server functions themselves. This means that if a global middleware supplies additional context to server functions or other server function specific middleware, the types will not be automatically passed through to the server function or other server function specific middleware.
```tsx
-// app/server-functions.ts
+// app/global-middleware.ts
registerGlobalMiddleware({
middleware: [authMiddleware],
})
diff --git a/examples/react/start-basic/app/server-functions.ts b/examples/react/start-basic/app/server-functions.ts
deleted file mode 100644
index 3896ec3143..0000000000
--- a/examples/react/start-basic/app/server-functions.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { registerGlobalMiddleware } from '@tanstack/start'
-import { logMiddleware } from './utils/loggingMiddleware'
-
-registerGlobalMiddleware({
- middleware: [logMiddleware],
-})
-
-console.log('hello')
diff --git a/packages/react-start-plugin/src/index.ts b/packages/react-start-plugin/src/index.ts
index 963b1b5d9f..4d08a9d165 100644
--- a/packages/react-start-plugin/src/index.ts
+++ b/packages/react-start-plugin/src/index.ts
@@ -10,8 +10,7 @@ const debug =
['true', 'start-plugin'].includes(process.env.TSR_VITE_DEBUG)
export type TanStackStartViteOptions = {
- manifestVirtualImportId: string
- serverFnEntry: string
+ globalMiddlewareEntry: string
}
const transformFuncs = [
@@ -50,7 +49,7 @@ export function createTanStackStartPlugin(opts: TanStackStartViteOptions): {
transform(code, id) {
if (entry && id.includes(entry)) {
return {
- code: `${code}\n\nimport '${path.resolve(ROOT, opts.serverFnEntry)}'`,
+ code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
map: null,
}
}
@@ -78,7 +77,7 @@ export function createTanStackStartPlugin(opts: TanStackStartViteOptions): {
transform(code, id) {
if (entry && id.includes(entry)) {
return {
- code: `${code}\n\nimport '${path.resolve(ROOT, opts.serverFnEntry)}'`,
+ code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
map: null,
}
}
@@ -106,7 +105,7 @@ export function createTanStackStartPlugin(opts: TanStackStartViteOptions): {
transform(code, id) {
if (entry && id.includes(entry)) {
return {
- code: `${code}\n\nimport '${path.resolve(ROOT, opts.serverFnEntry)}'`,
+ code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
map: null,
}
}
diff --git a/packages/start-config/src/index.ts b/packages/start-config/src/index.ts
index 3fd5a46664..f2d1d06d1a 100644
--- a/packages/start-config/src/index.ts
+++ b/packages/start-config/src/index.ts
@@ -110,9 +110,9 @@ export async function defineConfig(
const ssrEntry =
opts.routers?.ssr?.entry || path.join(appDirectory, 'ssr.tsx')
const apiEntry = opts.routers?.api?.entry || path.join(appDirectory, 'api.ts')
- const serverFnEntry =
- opts.routers?.server?.entry ||
- path.join(appDirectory, 'server-functions.ts')
+ const globalMiddlewareEntry =
+ opts.routers?.server?.globalMiddlewareEntry ||
+ path.join(appDirectory, 'global-middleware.ts')
const apiEntryExists = existsSync(apiEntry)
const viteConfig = getUserViteConfig(opts.vite)
@@ -141,8 +141,7 @@ export async function defineConfig(
})
const TanStackStartPlugin = createTanStackStartPlugin({
- serverFnEntry,
- manifestVirtualImportId: 'tsr:start-manifest',
+ globalMiddlewareEntry,
})
// Create a dummy nitro app to get the resolved public output path
diff --git a/packages/start-config/src/schema.ts b/packages/start-config/src/schema.ts
index 5dc171bdd9..516e4e86fa 100644
--- a/packages/start-config/src/schema.ts
+++ b/packages/start-config/src/schema.ts
@@ -158,7 +158,7 @@ const routersSchema = z.object({
server: z
.object({
base: z.string().optional(),
- entry: z.string().optional(),
+ globalMiddlewareEntry: z.string().optional(),
middleware: z.string().optional(),
vite: viteSchema.optional(),
})
From 0e2a7aa406ae0364dc1c9b3aa1057c1343d6ea53 Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Fri, 21 Feb 2025 10:23:16 -0700
Subject: [PATCH 003/155] example: fix duration
---
examples/react/start-basic/app/utils/loggingMiddleware.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/react/start-basic/app/utils/loggingMiddleware.tsx b/examples/react/start-basic/app/utils/loggingMiddleware.tsx
index 3944490725..d743ba5340 100644
--- a/examples/react/start-basic/app/utils/loggingMiddleware.tsx
+++ b/examples/react/start-basic/app/utils/loggingMiddleware.tsx
@@ -32,7 +32,7 @@ export const logMiddleware = createMiddleware()
const now = new Date()
console.log('Client Req/Res:', {
- duration: res.context.clientTime.getTime() - now.getTime(),
+ duration: now.getTime() - res.context.clientTime.getTime(),
durationToServer: res.context.durationToServer,
durationFromServer: now.getTime() - res.context.serverTime.getTime(),
})
From 7d0c293812fab034773602fbf404b708be75a718 Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Fri, 21 Feb 2025 10:51:06 -0700
Subject: [PATCH 004/155] rebased on fix:globalmiddleware
---
.github/labeler.yml | 18 +++-
examples/react/start-basic/app.config.ts | 12 ---
examples/react/start-basic/vite.config.ts | 12 +++
package.json | 1 -
.../src/config.ts} | 0
.../src/schema.ts | 0
.../src/vinxi-file-router.ts | 0
packages/start-config/README.md | 33 -------
packages/start-config/eslint.config.js | 31 ------
packages/start-config/package.json | 73 --------------
packages/start-config/tsconfig.json | 10 --
packages/start/package.json | 12 +--
packages/start/src/config.tsx | 4 -
packages/start/src/plugin.tsx | 1 +
packages/start/vite.config.ts | 4 +-
pnpm-lock.yaml | 95 +++++--------------
scripts/publish.js | 8 --
17 files changed, 60 insertions(+), 254 deletions(-)
delete mode 100644 examples/react/start-basic/app.config.ts
create mode 100644 examples/react/start-basic/vite.config.ts
rename packages/{start-config/src/index.ts => react-start-plugin/src/config.ts} (100%)
rename packages/{start-config => react-start-plugin}/src/schema.ts (100%)
rename packages/{start-config => react-start-plugin}/src/vinxi-file-router.ts (100%)
delete mode 100644 packages/start-config/README.md
delete mode 100644 packages/start-config/eslint.config.js
delete mode 100644 packages/start-config/package.json
delete mode 100644 packages/start-config/tsconfig.json
delete mode 100644 packages/start/src/config.tsx
create mode 100644 packages/start/src/plugin.tsx
diff --git a/.github/labeler.yml b/.github/labeler.yml
index 138f2f8d5d..76b074f192 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -84,8 +84,22 @@
- 'packages/solid-start-server-functions-ssr/**/*'
'package: start':
- 'packages/start/**/*'
-'package: start-config':
- - 'packages/start-config/**/*'
+'package: start-api-routes':
+ - 'packages/start-api-routes/**/*'
+'package: start-client':
+ - 'packages/start-client/**/*'
+'package: start-plugin':
+ - 'packages/start-plugin/**/*'
+'package: start-router-manifest':
+ - 'packages/start-router-manifest/**/*'
+'package: start-server':
+ - 'packages/start-server/**/*'
+'package: start-server-functions-client':
+ - 'packages/start-server-functions-client/**/*'
+'package: start-server-functions-fetcher':
+ - 'packages/start-server-functions-fetcher/**/*'
+'package: start-server-functions-handler':
+ - 'packages/start-server-functions-handler/**/*'
'package: start-server-functions-server':
- 'packages/start-server-functions-server/**/*'
'package: valibot-adapter':
diff --git a/examples/react/start-basic/app.config.ts b/examples/react/start-basic/app.config.ts
deleted file mode 100644
index 346ac63390..0000000000
--- a/examples/react/start-basic/app.config.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { defineConfig } from '@tanstack/react-start/config'
-import tsConfigPaths from 'vite-tsconfig-paths'
-
-export default defineConfig({
- vite: {
- plugins: [
- tsConfigPaths({
- projects: ['./tsconfig.json'],
- }),
- ],
- },
-})
diff --git a/examples/react/start-basic/vite.config.ts b/examples/react/start-basic/vite.config.ts
new file mode 100644
index 0000000000..487b4bf09f
--- /dev/null
+++ b/examples/react/start-basic/vite.config.ts
@@ -0,0 +1,12 @@
+import { defineConfig } from 'vite'
+import tsConfigPaths from 'vite-tsconfig-paths'
+import { TanStackStartVitePlugin } from '@tanstack/start/plugin'
+
+export default defineConfig({
+ plugins: [
+ tsConfigPaths({
+ projects: ['./tsconfig.json'],
+ }),
+ TanStackStartVitePlugin(),
+ ],
+})
diff --git a/package.json b/package.json
index 59409a03fe..2fb22d4277 100644
--- a/package.json
+++ b/package.json
@@ -103,7 +103,6 @@
"@tanstack/react-start-server-functions-ssr": "workspace:*",
"@tanstack/start-server-functions-server": "workspace:*",
"@tanstack/react-start-router-manifest": "workspace:*",
- "@tanstack/react-start-config": "workspace:*",
"@tanstack/react-start-plugin": "workspace:*",
"@tanstack/eslint-plugin-router": "workspace:*",
"@tanstack/server-functions-plugin": "workspace:*",
diff --git a/packages/start-config/src/index.ts b/packages/react-start-plugin/src/config.ts
similarity index 100%
rename from packages/start-config/src/index.ts
rename to packages/react-start-plugin/src/config.ts
diff --git a/packages/start-config/src/schema.ts b/packages/react-start-plugin/src/schema.ts
similarity index 100%
rename from packages/start-config/src/schema.ts
rename to packages/react-start-plugin/src/schema.ts
diff --git a/packages/start-config/src/vinxi-file-router.ts b/packages/react-start-plugin/src/vinxi-file-router.ts
similarity index 100%
rename from packages/start-config/src/vinxi-file-router.ts
rename to packages/react-start-plugin/src/vinxi-file-router.ts
diff --git a/packages/start-config/README.md b/packages/start-config/README.md
deleted file mode 100644
index bb009b0c87..0000000000
--- a/packages/start-config/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-> 🤫 we're cooking up something special!
-
-
-
-# TanStack Start
-
-
-
-🤖 Type-safe router w/ built-in caching & URL state management for React!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Query](https://github.com/tannerlinsley/react-query), [React Table](https://github.com/tanstack/react-table), [React Charts](https://github.com/tannerlinsley/react-charts), [React Virtual](https://github.com/tannerlinsley/react-virtual)
-
-## Visit [tanstack.com/router](https://tanstack.com/router) for docs, guides, API and more!
diff --git a/packages/start-config/eslint.config.js b/packages/start-config/eslint.config.js
deleted file mode 100644
index 931f0ec774..0000000000
--- a/packages/start-config/eslint.config.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// @ts-check
-
-import pluginReact from '@eslint-react/eslint-plugin'
-import pluginReactHooks from 'eslint-plugin-react-hooks'
-import rootConfig from '../../eslint.config.js'
-
-export default [
- ...rootConfig,
- {
- ...pluginReact.configs.recommended,
- files: ['**/*.{ts,tsx}'],
- },
- {
- plugins: {
- 'react-hooks': pluginReactHooks,
- },
- rules: {
- '@eslint-react/no-unstable-context-value': 'off',
- '@eslint-react/no-unstable-default-props': 'off',
- '@eslint-react/dom/no-missing-button-type': 'off',
- 'react-hooks/exhaustive-deps': 'error',
- 'react-hooks/rules-of-hooks': 'error',
- },
- },
- {
- files: ['**/__tests__/**'],
- rules: {
- '@typescript-eslint/no-unnecessary-condition': 'off',
- },
- },
-]
diff --git a/packages/start-config/package.json b/packages/start-config/package.json
deleted file mode 100644
index 9e7841ee23..0000000000
--- a/packages/start-config/package.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "name": "@tanstack/start-config",
- "version": "1.114.3",
- "description": "Modern and scalable routing for React applications",
- "author": "Tanner Linsley",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/TanStack/router.git",
- "directory": "packages/start-config"
- },
- "homepage": "https://tanstack.com/start",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/tannerlinsley"
- },
- "keywords": [
- "react",
- "location",
- "router",
- "routing",
- "async",
- "async router",
- "typescript"
- ],
- "scripts": {
- "clean": "rimraf ./dist && rimraf ./coverage",
- "build": "tsc",
- "test": "pnpm test:eslint && pnpm test:types && pnpm test:build && pnpm test:unit",
- "test:unit": "exit 0;vitest",
- "test:eslint": "eslint ./src",
- "test:types": "exit 0; vitest"
- },
- "type": "module",
- "types": "dist/esm/index.d.ts",
- "exports": {
- ".": {
- "import": {
- "types": "./dist/esm/index.d.ts",
- "default": "./dist/esm/index.js"
- }
- },
- "./package.json": "./package.json"
- },
- "sideEffects": false,
- "files": [
- "dist",
- "src"
- ],
- "engines": {
- "node": ">=12"
- },
- "dependencies": {
- "@tanstack/react-router": "workspace:^",
- "@tanstack/router-generator": "workspace:^",
- "@tanstack/router-plugin": "workspace:^",
- "@tanstack/server-functions-plugin": "workspace:^",
- "@tanstack/react-start-plugin": "workspace:^",
- "@tanstack/react-start-server-functions-handler": "workspace:^",
- "@vitejs/plugin-react": "^4.3.4",
- "import-meta-resolve": "^4.1.0",
- "nitropack": "^2.10.4",
- "ofetch": "^1.4.1",
- "vite": "^6.1.0",
- "vinxi": "0.5.3",
- "zod": "^3.24.1"
- },
- "peerDependencies": {
- "react": ">=18.0.0 || >=19.0.0",
- "react-dom": ">=18.0.0 || >=19.0.0",
- "vite": "^6.0.0"
- }
-}
diff --git a/packages/start-config/tsconfig.json b/packages/start-config/tsconfig.json
deleted file mode 100644
index 940a9cce0a..0000000000
--- a/packages/start-config/tsconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extends": "../../tsconfig.json",
- "include": ["src/index.ts"],
- "compilerOptions": {
- "rootDir": "src",
- "outDir": "dist/esm",
- "target": "esnext",
- "noEmit": false
- }
-}
diff --git a/packages/start/package.json b/packages/start/package.json
index d863ca385b..0457100311 100644
--- a/packages/start/package.json
+++ b/packages/start/package.json
@@ -62,14 +62,14 @@
"default": "./dist/cjs/server.cjs"
}
},
- "./config": {
+ "./plugin": {
"import": {
- "types": "./dist/esm/config.d.ts",
- "default": "./dist/esm/config.js"
+ "types": "./dist/esm/plugin.d.ts",
+ "default": "./dist/esm/plugin.js"
},
"require": {
- "types": "./dist/cjs/config.d.cts",
- "default": "./dist/cjs/config.cjs"
+ "types": "./dist/cjs/plugin.d.cts",
+ "default": "./dist/cjs/plugin.cjs"
}
},
"./api": {
@@ -145,7 +145,7 @@
"dependencies": {
"@tanstack/react-start-client": "workspace:^",
"@tanstack/react-start-server": "workspace:^",
- "@tanstack/start-config": "workspace:^",
+ "@tanstack/react-start-plugin": "workspace:^",
"@tanstack/react-start-router-manifest": "workspace:^",
"@tanstack/react-start-server-functions-client": "workspace:^",
"@tanstack/start-server-functions-server": "workspace:^",
diff --git a/packages/start/src/config.tsx b/packages/start/src/config.tsx
deleted file mode 100644
index 262bac966c..0000000000
--- a/packages/start/src/config.tsx
+++ /dev/null
@@ -1,4 +0,0 @@
-console.warn(
- '[@tanstack/start] Warning: This package has moved to @tanstack/react-start. Please switch to the new package, as this package will be dropped soon.',
-)
-export * from '@tanstack/start-config'
diff --git a/packages/start/src/plugin.tsx b/packages/start/src/plugin.tsx
new file mode 100644
index 0000000000..d991c3b71c
--- /dev/null
+++ b/packages/start/src/plugin.tsx
@@ -0,0 +1 @@
+export * from '@tanstack/react-start-plugin'
diff --git a/packages/start/vite.config.ts b/packages/start/vite.config.ts
index c0d7ce210e..8c696b7b37 100644
--- a/packages/start/vite.config.ts
+++ b/packages/start/vite.config.ts
@@ -17,7 +17,7 @@ export default mergeConfig(
entry: [
'./src/client.tsx',
'./src/server.tsx',
- './src/config.tsx',
+ './src/plugin.tsx',
'./src/router-manifest.tsx',
'./src/server-functions-client.tsx',
'./src/server-functions-server.tsx',
@@ -27,7 +27,7 @@ export default mergeConfig(
externalDeps: [
'@tanstack/react-start-client',
'@tanstack/react-start-server',
- '@tanstack/start-config',
+ '@tanstack/react-start-plugin',
'@tanstack/react-start-router-manifest',
'@tanstack/react-start-server-functions-client',
'@tanstack/start-server-functions-server',
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 9a683ec999..f4d98db7ef 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -39,7 +39,6 @@ overrides:
'@tanstack/react-start-server-functions-ssr': workspace:*
'@tanstack/start-server-functions-server': workspace:*
'@tanstack/react-start-router-manifest': workspace:*
- '@tanstack/react-start-config': workspace:*
'@tanstack/react-start-plugin': workspace:*
'@tanstack/eslint-plugin-router': workspace:*
'@tanstack/server-functions-plugin': workspace:*
@@ -3470,10 +3469,10 @@ importers:
version: 19.0.3(@types/react@19.0.8)
html-webpack-plugin:
specifier: ^5.6.3
- version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1)
+ version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
swc-loader:
specifier: ^0.2.6
- version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1)
+ version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
typescript:
specifier: ^5.7.2
version: 5.8.2
@@ -5469,7 +5468,7 @@ importers:
version: 7.0.6
html-webpack-plugin:
specifier: ^5.6.0
- version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1)
+ version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
picocolors:
specifier: ^1.1.1
version: 1.1.1
@@ -5481,7 +5480,7 @@ importers:
version: 19.0.0(react@19.0.0)
swc-loader:
specifier: ^0.2.6
- version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1)
+ version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
tinyglobby:
specifier: ^0.2.10
version: 0.2.12
@@ -5767,7 +5766,7 @@ importers:
specifier: workspace:*
version: link:../react-start-client
'@tanstack/react-start-config':
- specifier: workspace:*
+ specifier: workspace:^
version: link:../react-start-config
'@tanstack/react-start-router-manifest':
specifier: workspace:*
@@ -6768,6 +6767,9 @@ importers:
'@tanstack/react-start-client':
specifier: workspace:*
version: link:../react-start-client
+ '@tanstack/react-start-plugin':
+ specifier: workspace:*
+ version: link:../react-start-plugin
'@tanstack/react-start-router-manifest':
specifier: workspace:*
version: link:../react-start-router-manifest
@@ -6783,61 +6785,10 @@ importers:
'@tanstack/react-start-server-functions-ssr':
specifier: workspace:*
version: link:../react-start-server-functions-ssr
- '@tanstack/start-config':
- specifier: workspace:^
- version: link:../start-config
'@tanstack/start-server-functions-server':
specifier: workspace:*
version: link:../start-server-functions-server
- packages/start-config:
- dependencies:
- '@tanstack/react-router':
- specifier: workspace:*
- version: link:../react-router
- '@tanstack/react-start-plugin':
- specifier: workspace:*
- version: link:../react-start-plugin
- '@tanstack/react-start-server-functions-handler':
- specifier: workspace:*
- version: link:../react-start-server-functions-handler
- '@tanstack/router-generator':
- specifier: workspace:*
- version: link:../router-generator
- '@tanstack/router-plugin':
- specifier: workspace:*
- version: link:../router-plugin
- '@tanstack/server-functions-plugin':
- specifier: workspace:*
- version: link:../server-functions-plugin
- '@vitejs/plugin-react':
- specifier: ^4.3.4
- version: 4.3.4(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
- import-meta-resolve:
- specifier: ^4.1.0
- version: 4.1.0
- nitropack:
- specifier: ^2.10.4
- version: 2.10.4(typescript@5.8.2)
- ofetch:
- specifier: ^1.4.1
- version: 1.4.1
- react:
- specifier: ^19.0.0
- version: 19.0.0
- react-dom:
- specifier: ^19.0.0
- version: 19.0.0(react@19.0.0)
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
- vite:
- specifier: 6.1.0
- version: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
- zod:
- specifier: ^3.24.1
- version: 3.24.1
-
packages/start-server-functions-server:
dependencies:
'@tanstack/server-functions-plugin':
@@ -18725,17 +18676,17 @@ snapshots:
'@webassemblyjs/ast': 1.14.1
'@xtuc/long': 4.2.2
- '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.97.1)':
+ '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))':
dependencies:
webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
webpack-cli: 5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1)
- '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.97.1)':
+ '@webpack-cli/info@2.0.2(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))':
dependencies:
webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
webpack-cli: 5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1)
- '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.2.0)(webpack@5.97.1)':
+ '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack-dev-server@5.2.0(webpack-cli@5.1.4)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))':
dependencies:
webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
webpack-cli: 5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1)
@@ -20702,7 +20653,7 @@ snapshots:
html-tags@3.3.1: {}
- html-webpack-plugin@5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1):
+ html-webpack-plugin@5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
dependencies:
'@types/html-minifier-terser': 6.1.0
html-minifier-terser: 6.1.0
@@ -23001,7 +22952,7 @@ snapshots:
csso: 5.0.5
picocolors: 1.1.1
- swc-loader@0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1):
+ swc-loader@0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
dependencies:
'@swc/core': 1.10.15(@swc/helpers@0.5.15)
'@swc/counter': 0.1.3
@@ -23091,26 +23042,26 @@ snapshots:
type-fest: 2.19.0
unique-string: 3.0.0
- terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)):
+ terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
dependencies:
'@jridgewell/trace-mapping': 0.3.25
jest-worker: 27.5.1
schema-utils: 4.3.0
serialize-javascript: 6.0.2
terser: 5.37.0
- webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)
+ webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
optionalDependencies:
'@swc/core': 1.10.15(@swc/helpers@0.5.15)
esbuild: 0.25.0
- terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1):
+ terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)):
dependencies:
'@jridgewell/trace-mapping': 0.3.25
jest-worker: 27.5.1
schema-utils: 4.3.0
serialize-javascript: 6.0.2
terser: 5.37.0
- webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
+ webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)
optionalDependencies:
'@swc/core': 1.10.15(@swc/helpers@0.5.15)
esbuild: 0.25.0
@@ -23979,9 +23930,9 @@ snapshots:
webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1):
dependencies:
'@discoveryjs/json-ext': 0.5.7
- '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.97.1)
- '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4)(webpack@5.97.1)
- '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.2.0)(webpack@5.97.1)
+ '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
+ '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
+ '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack-dev-server@5.2.0(webpack-cli@5.1.4)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
colorette: 2.0.20
commander: 10.0.1
cross-spawn: 7.0.6
@@ -23995,7 +23946,7 @@ snapshots:
optionalDependencies:
webpack-dev-server: 5.2.0(webpack-cli@5.1.4)(webpack@5.97.1)
- webpack-dev-middleware@7.4.2(webpack@5.97.1):
+ webpack-dev-middleware@7.4.2(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
dependencies:
colorette: 2.0.20
memfs: 4.17.0
@@ -24033,7 +23984,7 @@ snapshots:
serve-index: 1.9.1
sockjs: 0.3.24
spdy: 4.0.2
- webpack-dev-middleware: 7.4.2(webpack@5.97.1)
+ webpack-dev-middleware: 7.4.2(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
ws: 8.18.0
optionalDependencies:
webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
@@ -24108,7 +24059,7 @@ snapshots:
neo-async: 2.6.2
schema-utils: 3.3.0
tapable: 2.2.1
- terser-webpack-plugin: 5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1)
+ terser-webpack-plugin: 5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
watchpack: 2.4.2
webpack-sources: 3.2.3
optionalDependencies:
diff --git a/scripts/publish.js b/scripts/publish.js
index fa381c0912..8d825110f7 100644
--- a/scripts/publish.js
+++ b/scripts/publish.js
@@ -156,14 +156,6 @@ await publish({
name: '@tanstack/react-start-server',
packageDir: 'packages/react-start-server',
},
- {
- name: '@tanstack/start-config',
- packageDir: 'packages/start-config',
- },
- {
- name: '@tanstack/react-start-config',
- packageDir: 'packages/react-start-config',
- },
{
name: '@tanstack/react-start-api-routes',
packageDir: 'packages/react-start-api-routes',
From 4d130676e8f252619efeaae75defef9451d7059e Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Mon, 24 Feb 2025 22:01:42 -0700
Subject: [PATCH 005/155] initial
---
examples/react/start-basic/package.json | 10 +-
.../vite.config.timestamp_1740425668217.js | 15 +
examples/react/start-basic/vite.config.ts | 5 +-
packages/react-start-config/src/schema.ts | 249 +++++-------
.../src/vinxi-file-router.ts | 3 +
packages/react-start-plugin/package.json | 15 +-
packages/react-start-plugin/src/index.ts | 369 ++++++++++--------
.../src/nitro/build-server.ts | 39 ++
.../src/nitro/build-sitemap.ts | 79 ++++
.../react-start-plugin/src/nitro/build-ssr.ts | 25 ++
.../src/nitro/hooks/post-rendering-hook.ts | 12 +
.../nitro/hooks/post-rendering-hooks.spec.ts | 33 ++
.../src/nitro/nitro-plugin.ts | 257 ++++++++++++
.../react-start-plugin/src/nitro/options.ts | 80 ++++
.../src/nitro/plugins/dev-server-plugin.ts | 124 ++++++
.../src/nitro/utils/load-esm.ts | 27 ++
.../nitro/utils/register-dev-middleware.ts | 25 ++
.../src/nitro/vite-plugin-nitro.ts | 3 +
.../src/routesManifestPlugin.ts | 172 ++++++++
packages/react-start-plugin/src/server-fns.ts | 178 +++++++++
packages/react-start-plugin/tsconfig.json | 5 +-
pnpm-lock.yaml | 85 +++-
22 files changed, 1484 insertions(+), 326 deletions(-)
create mode 100644 examples/react/start-basic/vite.config.timestamp_1740425668217.js
create mode 100644 packages/react-start-plugin/src/nitro/build-server.ts
create mode 100644 packages/react-start-plugin/src/nitro/build-sitemap.ts
create mode 100644 packages/react-start-plugin/src/nitro/build-ssr.ts
create mode 100644 packages/react-start-plugin/src/nitro/hooks/post-rendering-hook.ts
create mode 100644 packages/react-start-plugin/src/nitro/hooks/post-rendering-hooks.spec.ts
create mode 100644 packages/react-start-plugin/src/nitro/nitro-plugin.ts
create mode 100644 packages/react-start-plugin/src/nitro/options.ts
create mode 100644 packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts
create mode 100644 packages/react-start-plugin/src/nitro/utils/load-esm.ts
create mode 100644 packages/react-start-plugin/src/nitro/utils/register-dev-middleware.ts
create mode 100644 packages/react-start-plugin/src/nitro/vite-plugin-nitro.ts
create mode 100644 packages/react-start-plugin/src/routesManifestPlugin.ts
create mode 100644 packages/react-start-plugin/src/server-fns.ts
diff --git a/examples/react/start-basic/package.json b/examples/react/start-basic/package.json
index 1a79a5a641..7f662fc169 100644
--- a/examples/react/start-basic/package.json
+++ b/examples/react/start-basic/package.json
@@ -4,9 +4,9 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@tanstack/react-router": "^1.114.3",
@@ -16,14 +16,14 @@
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3"
+ "vite": "6.1.0"
},
"devDependencies": {
"@types/node": "^22.5.4",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
- "postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
+ "postcss": "^8.5.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"vite-tsconfig-paths": "^5.1.4"
diff --git a/examples/react/start-basic/vite.config.timestamp_1740425668217.js b/examples/react/start-basic/vite.config.timestamp_1740425668217.js
new file mode 100644
index 0000000000..70db1b8430
--- /dev/null
+++ b/examples/react/start-basic/vite.config.timestamp_1740425668217.js
@@ -0,0 +1,15 @@
+// vite.config.ts
+import { defineConfig } from "vite";
+import tsConfigPaths from "vite-tsconfig-paths";
+import { TanStackStartVitePlugin } from "@tanstack/start/plugin";
+var vite_config_default = defineConfig({
+ plugins: [
+ tsConfigPaths({
+ projects: ["./tsconfig.json"]
+ }),
+ TanStackStartVitePlugin()
+ ]
+});
+export {
+ vite_config_default as default
+};
diff --git a/examples/react/start-basic/vite.config.ts b/examples/react/start-basic/vite.config.ts
index 487b4bf09f..1bf4c44472 100644
--- a/examples/react/start-basic/vite.config.ts
+++ b/examples/react/start-basic/vite.config.ts
@@ -3,10 +3,13 @@ import tsConfigPaths from 'vite-tsconfig-paths'
import { TanStackStartVitePlugin } from '@tanstack/start/plugin'
export default defineConfig({
+ server: {
+ port: 3000,
+ },
plugins: [
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
- TanStackStartVitePlugin(),
+ TanStackStartVitePlugin({}),
],
})
diff --git a/packages/react-start-config/src/schema.ts b/packages/react-start-config/src/schema.ts
index 516e4e86fa..e0882a17d4 100644
--- a/packages/react-start-config/src/schema.ts
+++ b/packages/react-start-config/src/schema.ts
@@ -1,102 +1,10 @@
-import { configSchema } from '@tanstack/router-generator'
+import path from 'node:path'
+import { existsSync } from 'node:fs'
import { z } from 'zod'
-import type { PluginOption } from 'vite'
-import type { AppOptions as VinxiAppOptions } from 'vinxi'
-import type { NitroOptions } from 'nitropack'
+import { configSchema, getConfig } from '@tanstack/router-generator'
+import type { UserConfig } from 'vite'
+import type { NitroConfig } from 'nitropack'
import type { Options as ViteReactOptions } from '@vitejs/plugin-react'
-import type { CustomizableConfig } from 'vinxi/dist/types/lib/vite-dev'
-
-type StartUserViteConfig = CustomizableConfig | (() => CustomizableConfig)
-
-export function getUserViteConfig(config?: StartUserViteConfig): {
- plugins: Array | undefined
- userConfig: CustomizableConfig
-} {
- const { plugins, ...userConfig } =
- typeof config === 'function' ? config() : { ...config }
- return { plugins, userConfig }
-}
-
-/**
- * Not all the deployment presets are fully functional or tested.
- * @see https://github.com/TanStack/router/pull/2002
- */
-const vinxiDeploymentPresets = [
- 'alwaysdata', // untested
- 'aws-amplify', // untested
- 'aws-lambda', // untested
- 'azure', // untested
- 'azure-functions', // untested
- 'base-worker', // untested
- 'bun', // ✅ working
- 'cleavr', // untested
- 'cli', // untested
- 'cloudflare', // untested
- 'cloudflare-module', // untested
- 'cloudflare-pages', // ✅ working
- 'cloudflare-pages-static', // untested
- 'deno', // untested
- 'deno-deploy', // untested
- 'deno-server', // untested
- 'digital-ocean', // untested
- 'edgio', // untested
- 'firebase', // untested
- 'flight-control', // untested
- 'github-pages', // untested
- 'heroku', // untested
- 'iis', // untested
- 'iis-handler', // untested
- 'iis-node', // untested
- 'koyeb', // untested
- 'layer0', // untested
- 'netlify', // ✅ working
- 'netlify-builder', // untested
- 'netlify-edge', // untested
- 'netlify-static', // untested
- 'nitro-dev', // untested
- 'nitro-prerender', // untested
- 'node', // partially working
- 'node-cluster', // untested
- 'node-server', // ✅ working
- 'platform-sh', // untested
- 'service-worker', // untested
- 'static', // 🟧 partially working
- 'stormkit', // untested
- 'vercel', // ✅ working
- 'vercel-edge', // untested
- 'vercel-static', // untested
- 'winterjs', // untested
- 'zeabur', // untested
- 'zeabur-static', // untested
-] as const
-
-type DeploymentPreset = (typeof vinxiDeploymentPresets)[number] | (string & {})
-
-const testedDeploymentPresets: Array = [
- 'bun',
- 'netlify',
- 'vercel',
- 'cloudflare-pages',
- 'node-server',
-]
-
-export function checkDeploymentPresetInput(preset: string): DeploymentPreset {
- if (!vinxiDeploymentPresets.includes(preset as any)) {
- console.warn(
- `Invalid deployment preset "${preset}". Available presets are: ${vinxiDeploymentPresets
- .map((p) => `"${p}"`)
- .join(', ')}.`,
- )
- }
-
- if (!testedDeploymentPresets.includes(preset as any)) {
- console.warn(
- `The deployment preset '${preset}' is not fully supported yet and may not work as expected.`,
- )
- }
-
- return preset
-}
type HTTPSOptions = {
cert?: string
@@ -107,88 +15,131 @@ type HTTPSOptions = {
domains?: Array
}
-type ServerOptions_ = VinxiAppOptions['server'] & {
+type ServerOptions = NitroConfig & {
https?: boolean | HTTPSOptions
}
-type ServerOptions = {
- [K in keyof ServerOptions_]: ServerOptions_[K]
-}
-
-export const serverSchema = z
- .object({
- routeRules: z.custom().optional(),
- preset: z.custom().optional(),
- static: z.boolean().optional(),
- prerender: z
- .object({
- routes: z.array(z.string()),
- ignore: z
- .array(
- z.custom<
- string | RegExp | ((path: string) => undefined | null | boolean)
- >(),
- )
- .optional(),
- crawlLinks: z.boolean().optional(),
- })
- .optional(),
- })
- .and(z.custom())
+export const serverSchema = z.custom().and(
+ z.object({
+ preset: z
+ .custom()
+ .optional()
+ .default('node-server'),
+ }),
+)
-const viteSchema = z.custom()
+const viteSchema = z.custom()
const viteReactSchema = z.custom()
const routersSchema = z.object({
ssr: z
.object({
- entry: z.string().optional(),
- middleware: z.string().optional(),
+ entry: z.string().optional().default('ssr.tsx'),
+ // middleware: z.string().optional(),
vite: viteSchema.optional(),
})
- .optional(),
+ .optional()
+ .default({}),
client: z
.object({
- entry: z.string().optional(),
- base: z.string().optional(),
+ entry: z.string().optional().default('client.tsx'),
+ base: z.string().optional().default('/_build'),
vite: viteSchema.optional(),
})
- .optional(),
+ .optional()
+ .default({}),
server: z
.object({
- base: z.string().optional(),
- globalMiddlewareEntry: z.string().optional(),
- middleware: z.string().optional(),
+ base: z.string().optional().default('/_server'),
+ globalMiddlewareEntry: z
+ .string()
+ .optional()
+ .default('global-middleware.ts'),
+ // middleware: z.string().optional(),
vite: viteSchema.optional(),
})
- .optional(),
+ .optional()
+ .default({}),
api: z
.object({
- entry: z.string().optional(),
- middleware: z.string().optional(),
+ base: z.string().optional().default('/api'),
+ entry: z.string().optional().default('api.ts'),
+ // middleware: z.string().optional(),
vite: viteSchema.optional(),
})
- .optional(),
+ .optional()
+ .default({}),
public: z
.object({
- dir: z.string().optional(),
- base: z.string().optional(),
+ dir: z.string().optional().default('public'),
+ base: z.string().optional().default('/'),
})
- .optional(),
+ .optional()
+ .default({}),
})
-const tsrConfig = configSchema.partial().extend({
- appDirectory: z.string().optional(),
+const sitemapSchema = z.object({
+ host: z.string(),
})
-export const inlineConfigSchema = z.object({
- react: viteReactSchema.optional(),
- vite: viteSchema.optional(),
- tsr: tsrConfig.optional(),
- routers: routersSchema.optional(),
- server: serverSchema.optional(),
+const tsrConfig = configSchema.partial().extend({
+ // Normally these are `./src/___`, but we're using `./app/___` for Start stuff
+ appDirectory: z.string().optional().default('app'),
})
-export type TanStackStartInputConfig = z.input
-export type TanStackStartOutputConfig = z.infer
+const TanStackStartOptionsSchema = z
+ .object({
+ root: z.string().optional().default(process.cwd()),
+ react: viteReactSchema.optional(),
+ vite: viteSchema.optional(),
+ tsr: tsrConfig.optional().default({}),
+ routers: routersSchema.optional().default({}),
+ server: serverSchema.optional().default({}),
+ sitemap: sitemapSchema.optional(),
+ })
+ .optional()
+ .default({})
+
+export function getTanStackStartOptions(opts?: TanStackStartInputConfig) {
+ const options = TanStackStartOptionsSchema.parse(opts)
+
+ const appDirectory = options.tsr.appDirectory
+ const routesDirectory =
+ options.tsr.routesDirectory ?? path.join(appDirectory, 'routes')
+ const generatedRouteTree =
+ options.tsr.generatedRouteTree ??
+ path.join(appDirectory, 'routeTree.gen.ts')
+ const clientEntryPath = path.join(appDirectory, options.routers.client.entry)
+ const ssrEntryPath = path.join(appDirectory, options.routers.ssr.entry)
+ const apiEntryPath = path.join(appDirectory, options.routers.api.entry)
+ const globalMiddlewareEntryPath = path.join(
+ appDirectory,
+ options.routers.server.globalMiddlewareEntry,
+ )
+ const hasApiEntry = existsSync(apiEntryPath)
+
+ return {
+ ...options,
+ tsr: {
+ ...options.tsr,
+ ...getConfig({
+ ...options.tsr,
+ routesDirectory,
+ generatedRouteTree,
+ }),
+ },
+ clientEntryPath,
+ ssrEntryPath,
+ apiEntryPath,
+ globalMiddlewareEntryPath,
+ hasApiEntry,
+ }
+}
+
+export type TanStackStartInputConfig = z.input<
+ typeof TanStackStartOptionsSchema
+>
+export type TanStackStartOutputConfig = ReturnType<
+ typeof getTanStackStartOptions
+>
diff --git a/packages/react-start-config/src/vinxi-file-router.ts b/packages/react-start-config/src/vinxi-file-router.ts
index 9e6d829d1b..a60d71585c 100644
--- a/packages/react-start-config/src/vinxi-file-router.ts
+++ b/packages/react-start-config/src/vinxi-file-router.ts
@@ -1,3 +1,6 @@
+// eslint-disable-next-line @typescript-eslint/ban-ts-comment
+// @ts-nocheck
+
import {
BaseFileSystemRouter as VinxiBaseFileSystemRouter,
analyzeModule as vinxiFsRouterAnalyzeModule,
diff --git a/packages/react-start-plugin/package.json b/packages/react-start-plugin/package.json
index 44bd491dcd..d932328a1c 100644
--- a/packages/react-start-plugin/package.json
+++ b/packages/react-start-plugin/package.json
@@ -72,7 +72,11 @@
"@babel/template": "^7.26.8",
"@babel/traverse": "^7.26.8",
"@babel/types": "^7.26.8",
+ "@tanstack/react-router": "workspace:^",
+ "@tanstack/router-generator": "workspace:^",
+ "@tanstack/router-plugin": "workspace:^",
"@tanstack/router-utils": "workspace:^",
+ "@tanstack/server-functions-plugin": "workspace:^",
"babel-dead-code-elimination": "^1.0.9",
"tiny-invariant": "^1.3.3",
"vite": "6.1.0"
@@ -81,6 +85,15 @@
"@types/babel__code-frame": "^7.0.6",
"@types/babel__core": "^7.20.5",
"@types/babel__template": "^7.4.4",
- "@types/babel__traverse": "^7.20.6"
+ "@types/babel__traverse": "^7.20.6",
+ "@vitejs/plugin-react": "^4.3.4",
+ "babel-dead-code-elimination": "^1.0.9",
+ "fast-glob": "^3.3.3",
+ "h3": "1.13.0",
+ "nitropack": "^2.10.4",
+ "tiny-invariant": "^1.3.3",
+ "vite": "6.1.0",
+ "xmlbuilder2": "^3.1.1",
+ "zod": "^3.24.2"
}
}
diff --git a/packages/react-start-plugin/src/index.ts b/packages/react-start-plugin/src/index.ts
index 4d08a9d165..a649b905f2 100644
--- a/packages/react-start-plugin/src/index.ts
+++ b/packages/react-start-plugin/src/index.ts
@@ -1,178 +1,215 @@
-import { fileURLToPath, pathToFileURL } from 'node:url'
-import path from 'node:path'
-import { logDiff } from '@tanstack/router-utils'
-import { compileStartOutput } from './compilers'
-
-import type { Plugin } from 'vite'
-
-const debug =
- process.env.TSR_VITE_DEBUG &&
- ['true', 'start-plugin'].includes(process.env.TSR_VITE_DEBUG)
+// import { importMetaResolve } from 'import-meta-resolve'
+// // @ts-expect-error
+// import { serverComponents } from '@vinxi/server-components/plugin'
-export type TanStackStartViteOptions = {
- globalMiddlewareEntry: string
-}
+// import { tanstackStartVinxiFileRouter } from './vinxi-file-router.js'
+import path from 'node:path'
+import { createTanStackServerFnPlugin } from '@tanstack/server-functions-plugin'
+import { mergeConfig, perEnvironmentPlugin } from 'vite'
+import viteReact from '@vitejs/plugin-react'
+import { createNitro } from 'nitropack'
+import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
+import { createTanStackStartPlugin } from './server-fns.js'
+import { getTanStackStartOptions } from './schema.js'
+import { nitroPlugin } from './nitro/nitro-plugin.js'
+import { tsrRoutesManifestPlugin } from './routesManifestPlugin.js'
+import type { PluginOption } from 'vite'
+import type { TanStackStartInputConfig } from './schema.js'
+
+export type {
+ TanStackStartInputConfig,
+ TanStackStartOutputConfig,
+} from './schema.js'
+
+export function TanStackStartVitePlugin(
+ opts?: TanStackStartInputConfig,
+): Array {
+ const options = getTanStackStartOptions(opts)
+
+ const TanStackServerFnsPlugin = createTanStackServerFnPlugin({
+ // This is the ID that will be available to look up and import
+ // our server function manifest and resolve its module
+ manifestVirtualImportId: 'tsr:server-fn-manifest',
+ client: {
+ getRuntimeCode: () =>
+ `import { createClientRpc } from '@tanstack/start/server-functions-client'`,
+ replacer: (d) =>
+ `createClientRpc('${d.functionId}', '${options.routers.server.base}')`,
+ },
+ ssr: {
+ getRuntimeCode: () =>
+ `import { createSsrRpc } from '@tanstack/start/server-functions-ssr'`,
+ replacer: (d) =>
+ `createSsrRpc('${d.functionId}', '${options.routers.server.base}')`,
+ },
+ server: {
+ getRuntimeCode: () =>
+ `import { createServerRpc } from '@tanstack/start/server-functions-server'`,
+ replacer: (d) =>
+ `createServerRpc('${d.functionId}', '${options.routers.server.base}', ${d.fn})`,
+ },
+ })
+
+ const TanStackStartPlugin = createTanStackStartPlugin({
+ globalMiddlewareEntry: options.routers.server.globalMiddlewareEntry,
+ })
+
+ const globalPlugins: Array = [
+ {
+ name: 'tss-vite-config-client',
+ ...options.vite,
+ async config() {
+ // Create a dummy nitro app to get the resolved public output path
+ const dummyNitroApp = await createNitro({
+ preset: options.server.preset,
+ compatibilityDate: '2024-12-01',
+ })
+
+ const nitroOutputPublicDir = dummyNitroApp.options.output.publicDir
+ await dummyNitroApp.close()
-const transformFuncs = [
- 'createServerFn',
- 'createMiddleware',
- 'serverOnly',
- 'clientOnly',
- 'createIsomorphicFn',
-]
-const tokenRegex = new RegExp(transformFuncs.join('|'))
-// const eitherFuncRegex = new RegExp(
-// `(function ${transformFuncs.join('|function ')})`,
-// )
-
-export function createTanStackStartPlugin(opts: TanStackStartViteOptions): {
- client: Array
- ssr: Array
- server: Array
-} {
- return {
- client: [
- (() => {
- let entry: string | null = null
- let ROOT: string = process.cwd()
return {
- name: 'vite-plugin-tanstack-start-server-entry-client',
- enforce: 'pre',
- configResolved: (config) => {
- ROOT = config.root
- entry = path.resolve(ROOT, (config as any).router.handler)
-
- if (!entry) {
- throw new Error('@tanstack/start-plugin: No server entry found!')
- }
+ resolve: {
+ noExternal: [
+ '@tanstack/start',
+ '@tanstack/start/server',
+ '@tanstack/start-client',
+ '@tanstack/start-server',
+ '@tanstack/start-server-functions-fetcher',
+ '@tanstack/start-server-functions-handler',
+ '@tanstack/start-server-functions-client',
+ '@tanstack/start-server-functions-ssr',
+ '@tanstack/start-server-functions-server',
+ '@tanstack/start-router-manifest',
+ '@tanstack/start-config',
+ '@tanstack/start-api-routes',
+ '@tanstack/server-functions-plugin',
+ 'tsr:routes-manifest',
+ 'tsr:server-fn-manifest',
+ ],
},
- transform(code, id) {
- if (entry && id.includes(entry)) {
- return {
- code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
- map: null,
- }
- }
- return null
- },
- }
- })(),
- TanStackStartServerFnsAndMiddleware({ ...opts, env: 'client' }),
- ],
- ssr: [
- (() => {
- let entry: string | null = null
- let ROOT: string = process.cwd()
- return {
- name: 'vite-plugin-tanstack-start-server-entry-ssr',
- enforce: 'pre',
- configResolved: (config) => {
- ROOT = config.root
- entry = path.resolve(ROOT, (config as any).router.handler)
-
- if (!entry) {
- throw new Error('@tanstack/start-plugin: No server entry found!')
- }
+ optimizeDeps: {
+ entries: [],
+ ...(options.vite?.optimizeDeps || {}),
},
- transform(code, id) {
- if (entry && id.includes(entry)) {
- return {
- code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
- map: null,
- }
- }
- return null
+ define: {
+ ...(options.vite?.define || {}),
+ ...injectDefineEnv('TSS_PUBLIC_BASE', options.routers.public.base),
+ ...injectDefineEnv('TSS_CLIENT_BASE', options.routers.client.base),
+ ...injectDefineEnv('TSS_API_BASE', options.routers.server.base),
+ ...injectDefineEnv('TSS_OUTPUT_PUBLIC_DIR', nitroOutputPublicDir),
},
}
- })(),
- TanStackStartServerFnsAndMiddleware({ ...opts, env: 'ssr' }),
- ],
- server: [
- (() => {
- let entry: string | null = null
- let ROOT: string = process.cwd()
- return {
- name: 'vite-plugin-tanstack-start-server-entry-server',
- enforce: 'pre',
- configResolved: (config) => {
- ROOT = config.root
- entry = path.resolve(ROOT, (config as any).router.handler)
-
- if (!entry) {
- throw new Error('@tanstack/start-plugin: No server entry found!')
- }
- },
- transform(code, id) {
- if (entry && id.includes(entry)) {
- return {
- code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
- map: null,
- }
- }
- return null
- },
+ },
+ configEnvironment(env, config) {
+ if (env === 'client') {
+ return mergeConfig(config, options.routers.client.vite || {})
}
- })(),
- TanStackStartServerFnsAndMiddleware({ ...opts, env: 'server' }),
- ],
- }
-}
-export function TanStackStartServerFnsAndMiddleware(opts: {
- env: 'server' | 'ssr' | 'client'
-}): Plugin {
- let ROOT: string = process.cwd()
+ if (env === 'ssr') {
+ return mergeConfig(config, options.routers.ssr.vite || {})
+ }
- return {
- name: 'vite-plugin-tanstack-start-create-server-fn',
- enforce: 'pre',
- configResolved: (config) => {
- ROOT = config.root
+ return config
+ },
},
- transform(code, id) {
- const url = pathToFileURL(id)
- url.searchParams.delete('v')
- id = fileURLToPath(url).replace(/\\/g, '/')
-
- const includesToken = tokenRegex.test(code)
- // const includesEitherFunc = eitherFuncRegex.test(code)
-
- if (
- !includesToken
- // includesEitherFunc
- // /node_modules/.test(id)
- ) {
- return null
- }
-
- if (code.includes('@react-refresh')) {
- throw new Error(
- `We detected that the '@vitejs/plugin-react' was passed before '@tanstack/start-plugin'. Please make sure that '@tanstack/router-vite-plugin' is passed before '@vitejs/plugin-react' and try again:
-e.g.
-
-plugins: [
- TanStackStartVite(), // Place this before viteReact()
- viteReact(),
-]
-`,
- )
- }
-
- if (debug) console.info(`${opts.env} Compiling Start: `, id)
-
- const compiled = compileStartOutput({
- code,
- root: ROOT,
- filename: id,
- env: opts.env,
- })
-
- if (debug) {
- logDiff(code, compiled.code)
- console.log('Output:\n', compiled.code + '\n\n')
- }
-
- return compiled
- },
- }
+ TanStackRouterVite({
+ ...options.tsr,
+ enableRouteGeneration: true,
+ autoCodeSplitting: true,
+ }),
+ viteReact(options.react),
+ ]
+
+ return [
+ perEnvironmentPlugin('tanstack-start-plugin-client', (environment) =>
+ environment.name === 'client'
+ ? TanStackStartPlugin.client
+ : TanStackStartPlugin.server,
+ ),
+ ...globalPlugins,
+ perEnvironmentPlugin(
+ 'tanstack-server-fns-plugin-client-server',
+ (environment) =>
+ environment.name === 'client'
+ ? TanStackServerFnsPlugin.client
+ : TanStackServerFnsPlugin.server,
+ ),
+ perEnvironmentPlugin(
+ 'tanstack-router-manifest-plugin',
+ (environment) =>
+ environment.name === 'ssr' &&
+ tsrRoutesManifestPlugin({
+ clientBase: options.routers.client.base,
+ tsrConfig: options.tsr,
+ }),
+ ),
+ nitroPlugin({
+ ...options,
+ server: {
+ ...options.server,
+ handlers: [
+ ...(options.hasApiEntry
+ ? [
+ {
+ route: options.routers.api.base,
+ handler: path.join(
+ options.root,
+ options.tsr.appDirectory,
+ options.routers.api.entry,
+ ),
+ },
+ ]
+ : []),
+ ],
+ },
+ plugins: [
+ TanStackStartPlugin.server,
+ ...globalPlugins,
+ TanStackServerFnsPlugin.server,
+ ],
+ }),
+ ]
}
+
+// // Because Vinxi doesn't use the normal nitro dev server, it doesn't
+// // supply $fetch during dev. We need to hook into the dev server creation,
+// // nab the proper utils from the custom nitro instance that is used
+// // during dev and supply the $fetch to app.
+// // Hopefully and likely, this will just get removed when we move to
+// // Nitro directly.
+// vinxiApp.hooks.hook('app:dev:nitro:config', (devServer) => {
+// vinxiApp.hooks.hook(
+// 'app:dev:server:created',
+// ({ devApp: { localFetch } }) => {
+// const $fetch = createFetch({
+// fetch: localFetch,
+// defaults: {
+// baseURL: devServer.nitro.options.runtimeConfig.app.baseURL,
+// },
+// })
+
+// // @ts-expect-error
+// globalThis.$fetch = $fetch
+// },
+// )
+// })
+
+// return vinxiApp
+
+function injectDefineEnv(
+ key: TKey,
+ value: TValue,
+): { [P in `process.env.${TKey}` | `import.meta.env.${TKey}`]: TValue } {
+ return {
+ [`process.env.${key}`]: JSON.stringify(value),
+ [`import.meta.env.${key}`]: JSON.stringify(value),
+ } as { [P in `process.env.${TKey}` | `import.meta.env.${TKey}`]: TValue }
+}
+
+// function isEmptyPrerenderRoutes(options?: Options): boolean {
+// if (!options || isArrayWithElements(nitroConfig.prerender?.routes)) {
+// return false
+// }
+// return !options.server.prerender?.routes
+// }
diff --git a/packages/react-start-plugin/src/nitro/build-server.ts b/packages/react-start-plugin/src/nitro/build-server.ts
new file mode 100644
index 0000000000..052ffd66dc
--- /dev/null
+++ b/packages/react-start-plugin/src/nitro/build-server.ts
@@ -0,0 +1,39 @@
+import {
+ build,
+ copyPublicAssets,
+ createNitro,
+ prepare,
+ prerender,
+} from 'nitropack'
+
+import type { NitroConfig } from 'nitropack'
+
+export async function buildServer(nitroConfig: NitroConfig) {
+ const nitro = await createNitro({
+ dev: false,
+ preset: process.env['BUILD_PRESET'],
+ ...nitroConfig,
+ })
+
+ // if (nitroConfig.prerender?.postRenderingHooks) {
+ // addPostRenderingHooks(nitro, nitroConfig.prerender.postRenderingHooks)
+ // }
+
+ await prepare(nitro)
+ await copyPublicAssets(nitro)
+
+ if (
+ nitroConfig.prerender?.routes &&
+ nitroConfig.prerender.routes.length > 0
+ ) {
+ console.log(`Prerendering static pages...`)
+ await prerender(nitro)
+ }
+
+ if (!nitroConfig.static) {
+ console.log('Building Server...')
+ await build(nitro)
+ }
+
+ await nitro.close()
+}
diff --git a/packages/react-start-plugin/src/nitro/build-sitemap.ts b/packages/react-start-plugin/src/nitro/build-sitemap.ts
new file mode 100644
index 0000000000..c06ed77d0e
--- /dev/null
+++ b/packages/react-start-plugin/src/nitro/build-sitemap.ts
@@ -0,0 +1,79 @@
+import { writeFileSync } from 'node:fs'
+import { resolve } from 'node:path'
+import { create } from 'xmlbuilder2'
+import type { XMLBuilder } from 'xmlbuilder2/lib/interfaces'
+
+export type PagesJson = {
+ page: string
+ lastMod: string
+}
+
+export async function buildSitemap({
+ host,
+ routes,
+ outputDir,
+}: {
+ host: string
+ routes: Array | (() => Promise>)
+ outputDir: string
+}) {
+ const routeList: Array = await optionHasRoutes(routes)
+
+ if (routeList.length) {
+ const slash = checkSlash(host)
+ const sitemapData: Array = routeList.map((page: string) => ({
+ page: `${host}${slash}${page.replace(/^\/+/g, '')}`,
+ lastMod: new Date().toISOString().split('T')[0]!,
+ }))
+
+ const sitemap = createXml('urlset')
+
+ for (const item of sitemapData) {
+ const page = sitemap.ele('url')
+ page.ele('loc').txt(item.page)
+ page.ele('lastmod').txt(item.lastMod)
+ }
+
+ const mapPath = `${resolve(outputDir)}/sitemap.xml`
+ try {
+ console.log(`Writing sitemap at ${mapPath}`)
+ writeFileSync(mapPath, sitemap.end({ prettyPrint: true }))
+ } catch (e) {
+ console.error(`Unable to write file at ${mapPath}`, e)
+ }
+ }
+}
+
+function createXml(elementName: 'urlset' | 'sitemapindex'): XMLBuilder {
+ return create({ version: '1.0', encoding: 'UTF-8' })
+ .ele(elementName, {
+ xmlns: 'https://www.sitemaps.org/schemas/sitemap/0.9',
+ })
+ .com(`This file was automatically generated by Analog.`)
+}
+
+function checkSlash(host: string): string {
+ const finalChar = host.slice(-1)
+ return finalChar === '/' ? '' : '/'
+}
+
+async function optionHasRoutes(
+ routes:
+ | Array
+ | (() => Promise>),
+): Promise> {
+ let routeList: Array
+
+ if (typeof routes === 'function') {
+ // returns an array or undefined
+ routeList = await routes()
+ } else if (Array.isArray(routes)) {
+ // returns an array of strings
+ routeList = routes
+ } else {
+ // default it to an empty of array
+ routeList = []
+ }
+
+ return routeList.filter(Boolean) as Array
+}
diff --git a/packages/react-start-plugin/src/nitro/build-ssr.ts b/packages/react-start-plugin/src/nitro/build-ssr.ts
new file mode 100644
index 0000000000..ff2a769437
--- /dev/null
+++ b/packages/react-start-plugin/src/nitro/build-ssr.ts
@@ -0,0 +1,25 @@
+import { resolve } from 'node:path'
+import { build, mergeConfig } from 'vite'
+import type { UserConfig } from 'vite'
+
+export async function buildSSRApp({
+ root,
+ viteConfig,
+ ssrEntry,
+}: {
+ root: string
+ viteConfig: UserConfig
+ ssrEntry: string
+}) {
+ const ssrBuildConfig = mergeConfig(viteConfig, {
+ build: {
+ ssr: true,
+ rollupOptions: {
+ input: ssrEntry,
+ },
+ outDir: resolve(root, 'dist/ssr'),
+ },
+ })
+
+ await build(ssrBuildConfig)
+}
diff --git a/packages/react-start-plugin/src/nitro/hooks/post-rendering-hook.ts b/packages/react-start-plugin/src/nitro/hooks/post-rendering-hook.ts
new file mode 100644
index 0000000000..5bc1168c8f
--- /dev/null
+++ b/packages/react-start-plugin/src/nitro/hooks/post-rendering-hook.ts
@@ -0,0 +1,12 @@
+import type { Nitro, PrerenderRoute } from 'nitropack'
+
+export function addPostRenderingHooks(
+ nitro: Nitro,
+ hooks: Array<(pr: PrerenderRoute) => Promise>,
+): void {
+ hooks.forEach((hook: (preRoute: PrerenderRoute) => void) => {
+ nitro.hooks.hook('prerender:generate', (route: PrerenderRoute) => {
+ hook(route)
+ })
+ })
+}
diff --git a/packages/react-start-plugin/src/nitro/hooks/post-rendering-hooks.spec.ts b/packages/react-start-plugin/src/nitro/hooks/post-rendering-hooks.spec.ts
new file mode 100644
index 0000000000..bda3dbc7f3
--- /dev/null
+++ b/packages/react-start-plugin/src/nitro/hooks/post-rendering-hooks.spec.ts
@@ -0,0 +1,33 @@
+import { describe, expect, it, vi } from 'vitest'
+
+import { addPostRenderingHooks } from './post-rendering-hook'
+import type { Nitro } from 'nitropack'
+
+describe('postRenderingHook', () => {
+ const genRoute = {
+ route: 'test/testRoute',
+ contents: 'This is a test.',
+ }
+
+ const nitroMock = {
+ hooks: {
+ hook: vi.fn((name: string, callback: (route: any) => void) =>
+ callback(genRoute),
+ ),
+ },
+ } as unknown as Nitro
+
+ const mockFunc1 = vi.fn()
+ const mockFunc2 = vi.fn()
+
+ it('should not attempt to call nitro mocks if no callbacks provided', () => {
+ addPostRenderingHooks(nitroMock, [])
+ expect(nitroMock.hooks.hook).not.toHaveBeenCalled()
+ })
+
+ it('should call provided hooks', () => {
+ addPostRenderingHooks(nitroMock, [mockFunc1, mockFunc2])
+ expect(mockFunc1).toHaveBeenCalledWith(genRoute)
+ expect(mockFunc2).toHaveBeenCalled()
+ })
+})
diff --git a/packages/react-start-plugin/src/nitro/nitro-plugin.ts b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
new file mode 100644
index 0000000000..f620a9fff6
--- /dev/null
+++ b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
@@ -0,0 +1,257 @@
+import { dirname, resolve } from 'node:path'
+import { writeFileSync } from 'node:fs'
+import { platform } from 'node:os'
+import { fileURLToPath } from 'node:url'
+import { build, createDevServer, createNitro } from 'nitropack'
+import { normalizePath } from 'vite'
+
+import { buildServer } from './build-server.js'
+import { buildSSRApp } from './build-ssr.js'
+import { buildSitemap } from './build-sitemap.js'
+import { devServerPlugin } from './plugins/dev-server-plugin.js'
+import type { TanStackStartOutputConfig } from '../schema.js'
+import type { NitroConfig } from 'nitropack'
+
+import type { PluginOption, UserConfig, ViteDevServer } from 'vite'
+
+export type {
+ TanStackStartInputConfig,
+ TanStackStartOutputConfig,
+} from '../schema.js'
+
+const isWindows = platform() === 'win32'
+const filePrefix = isWindows ? 'file:///' : ''
+let clientOutputPath = ''
+
+const __filename = fileURLToPath(
+ // @ts-ignore Cannot figure out for the life of me why tsconfig.json won't let me fix this. Only shows up during build, not in editor.
+ import.meta.url,
+)
+const __dirname = dirname(__filename)
+
+export function nitroPlugin(
+ options: TanStackStartOutputConfig & {
+ plugins: Array
+ },
+): Array {
+ let isTest = process.env['NODE_ENV'] === 'test' || !!process.env['VITEST']
+
+ let isBuild = false
+ let isServe = false
+ let ssrBuild = false
+ let config: UserConfig
+ let nitroConfig: NitroConfig
+ let environmentBuild = false
+
+ return [
+ devServerPlugin(options),
+ {
+ name: 'tanstack-vite-plugin-nitro',
+ config(userConfig, { mode, command }) {
+ isServe = command === 'serve'
+ isBuild = command === 'build'
+ ssrBuild = userConfig.build?.ssr === true
+ config = userConfig
+ isTest = isTest ? isTest : mode === 'test'
+
+ const buildPreset =
+ process.env['BUILD_PRESET'] ??
+ (options.server.preset as string | undefined)
+
+ const rendererEntry =
+ filePrefix + normalizePath(options.routers.ssr.entry)
+
+ nitroConfig = {
+ ...options.server,
+ preset: buildPreset,
+ compatibilityDate: '2024-11-19',
+ logLevel: options.server.logLevel || 0,
+ srcDir: normalizePath(options.tsr.appDirectory),
+ typescript: {
+ generateTsConfig: false,
+ },
+ rollupConfig: {
+ onwarn(warning) {
+ if (
+ warning.message.includes('empty chunk') &&
+ warning.message.endsWith('.server')
+ ) {
+ return
+ }
+ },
+ plugins: options.plugins,
+ },
+ handlers: [],
+ }
+
+ if (!ssrBuild && !isTest) {
+ // store the client output path for the SSR build config
+ clientOutputPath = resolve(
+ options.root,
+ config.build?.outDir || 'dist/client',
+ )
+ }
+
+ nitroConfig.alias = {
+ '#start/ssr': options.ssrEntryPath,
+ }
+
+ if (isBuild) {
+ nitroConfig.publicAssets = [{ dir: clientOutputPath }]
+ nitroConfig.serverAssets = [
+ {
+ baseName: 'public',
+ dir: clientOutputPath,
+ },
+ ]
+ nitroConfig.renderer = rendererEntry
+
+ if (ssrBuild) {
+ if (isWindows) {
+ // Write out the renderer manually because
+ // Windows doesn't resolve the aliases
+ // correctly in its native environment
+ writeFileSync(
+ normalizePath(rendererEntry.replace(filePrefix, '')),
+ `
+ /**
+ * This file is shipped as ESM for Windows support,
+ * as it won't resolve the renderer.ts file correctly in node.
+ */
+ import ssrEntry from '${options.ssrEntryPath}';
+ export default ssrEntry
+ `,
+ )
+
+ nitroConfig.externals = {
+ inline: ['std-env'],
+ }
+ }
+
+ nitroConfig = {
+ ...nitroConfig,
+ externals: {
+ ...nitroConfig.externals,
+ external: ['node-fetch-native/dist/polyfill'],
+ },
+ // moduleSideEffects: [],
+ handlers: [],
+ }
+ }
+ }
+
+ return {
+ environments: {
+ ssr: {
+ build: {
+ ssr: true,
+ rollupOptions: {
+ input: options.ssrEntryPath,
+ },
+ outDir: resolve(options.root, 'dist/ssr'),
+ },
+ },
+ },
+ builder: {
+ sharedPlugins: true,
+ buildApp: async (builder) => {
+ environmentBuild = true
+
+ if (!builder.environments['client']) {
+ throw new Error('Client environment not found')
+ }
+
+ if (!builder.environments['ssr']) {
+ throw new Error('SSR environment not found')
+ }
+
+ await Promise.all([
+ builder.build(builder.environments['client']),
+ builder.build(builder.environments['ssr']),
+ ])
+
+ await buildServer(nitroConfig)
+
+ if (nitroConfig.prerender?.routes?.length && options.sitemap) {
+ console.log('Building Sitemap...')
+ // sitemap needs to be built after all directories are built
+ await buildSitemap({
+ host: options.sitemap.host,
+ routes: nitroConfig.prerender.routes,
+ outputDir: resolve(options.root, 'dist/public'),
+ })
+ }
+
+ console.log(
+ `\n\nThe 'tanstack-platform' server has been successfully built.`,
+ )
+ },
+ },
+ }
+ },
+ async configureServer(viteServer: ViteDevServer) {
+ if (isServe && !isTest) {
+ const nitro = await createNitro({
+ dev: true,
+ ...nitroConfig,
+ })
+ const server = createDevServer(nitro)
+
+ await build(nitro)
+
+ // viteServer.middlewares.use(
+ // apiBase,
+ // toNodeListener(server.app as unknown as App),
+ // )
+
+ viteServer.httpServer?.once('listening', () => {
+ process.env['START_HOST'] = !viteServer.config.server.host
+ ? 'localhost'
+ : (viteServer.config.server.host as string)
+ process.env['START_PORT'] = `${viteServer.config.server.port}`
+ })
+
+ // handle upgrades if websockets are enabled
+ if (nitroConfig.experimental?.websocket) {
+ viteServer.httpServer?.on('upgrade', server.upgrade)
+ }
+ }
+ },
+ async closeBundle() {
+ // Skip when build is triggered by the Environment API
+ if (environmentBuild) {
+ return
+ }
+
+ if (ssrBuild) {
+ return
+ }
+
+ if (isBuild) {
+ console.log('Building SSR application...')
+ await buildSSRApp({
+ root: options.root,
+ ssrEntry: options.ssrEntryPath,
+ viteConfig: config,
+ })
+
+ if (options.sitemap) {
+ console.log('Building Sitemap...')
+ // sitemap needs to be built after all directories are built
+ await buildSitemap({
+ host: options.sitemap.host,
+ routes: nitroConfig.prerender?.routes || [], // TODO: Can we get these routes from the final crawled routes from prerender?
+ outputDir: resolve(options.root, 'dist/public'),
+ })
+ }
+
+ await buildServer(nitroConfig)
+
+ console.log(
+ `\n\nThe 'tanstack-platform' server has been successfully built.`,
+ )
+ }
+ },
+ },
+ ]
+}
diff --git a/packages/react-start-plugin/src/nitro/options.ts b/packages/react-start-plugin/src/nitro/options.ts
new file mode 100644
index 0000000000..d250d3e2ec
--- /dev/null
+++ b/packages/react-start-plugin/src/nitro/options.ts
@@ -0,0 +1,80 @@
+import { PrerenderRoute } from 'nitropack';
+
+export interface Options {
+ ssr?: boolean;
+ ssrBuildDir?: string;
+ /**
+ * Prerender the static pages without producing the server output.
+ */
+ static?: boolean;
+ prerender?: PrerenderOptions;
+ entryServer?: string;
+ index?: string;
+ workspaceRoot?: string;
+ /**
+ * Additional page paths to include
+ */
+ additionalPagesDirs?: string[];
+ /**
+ * Additional API paths to include
+ */
+ additionalAPIDirs?: string[];
+ apiPrefix?: string;
+
+ /**
+ * Toggles internal API middleware.
+ * If disabled, a proxy request is used to route /api
+ * requests to / in the production server build.
+ */
+ useAPIMiddleware?: boolean;
+}
+
+export interface PrerenderOptions {
+ /**
+ * Add additional routes to prerender through crawling page links.
+ */
+ discover?: boolean;
+
+ /**
+ * List of routes to prerender resolved statically or dynamically.
+ */
+ routes?:
+ | (string | PrerenderContentDir)[]
+ | (() => Promise<(string | PrerenderContentDir | undefined)[]>);
+ sitemap?: SitemapConfig;
+ /** List of functions that run for each route after pre-rendering is complete. */
+ postRenderingHooks?: ((routes: PrerenderRoute) => Promise)[];
+}
+
+export interface SitemapConfig {
+ host: string;
+}
+
+export interface PrerenderContentDir {
+ /**
+ * The directory where files should be grabbed from.
+ * @example `/src/contents/blog`
+ */
+ contentDir: string;
+ /**
+ * Transform the matching content files path into a route.
+ * The function is called for each matching content file within the specified contentDir.
+ * @param file information of the matching file (`path`, `name`, `extension`, `attributes`)
+ * @returns a string with the route should be returned (e. g. `/blog/`) or the value `false`, when the route should not be prerendered.
+ */
+ transform: (file: PrerenderContentFile) => string | false;
+}
+
+/**
+ * @param path the path to the content file
+ * @param name the basename of the matching content file without the file extension
+ * @param extension the file extension
+ * @param attributes the frontmatter attributes extracted from the frontmatter section of the file
+ * @returns a string with the route should be returned (e. g. `/blog/`) or the value `false`, when the route should not be prerendered.
+ */
+export interface PrerenderContentFile {
+ path: string;
+ attributes: Record;
+ name: string;
+ extension: string;
+}
diff --git a/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts b/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts
new file mode 100644
index 0000000000..912361c336
--- /dev/null
+++ b/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts
@@ -0,0 +1,124 @@
+// SSR dev server, middleware and error page source modified from
+// https://github.com/solidjs/solid-start/blob/main/packages/start/dev/server.js
+
+import { createEvent, sendWebResponse } from 'h3'
+
+import { registerDevServerMiddleware } from '../utils/register-dev-middleware.js'
+import type { Connect, Plugin, ViteDevServer } from 'vite'
+import type { TanStackStartOutputConfig } from '../../schema.js'
+
+export function devServerPlugin(options: TanStackStartOutputConfig): Plugin {
+ // let config: UserConfig
+ let isTest = false
+
+ return {
+ name: 'startjs-dev-ssr-plugin',
+ config(userConfig, { mode }) {
+ // config = userConfig
+ isTest = isTest ? isTest : mode === 'test'
+ return {
+ resolve: {
+ alias: {
+ '~start/ssr-entry': options.ssrEntryPath,
+ },
+ },
+ }
+ },
+ configureServer(viteServer) {
+ if (isTest) {
+ return
+ }
+
+ return () => {
+ remove_html_middlewares(viteServer.middlewares)
+ registerDevServerMiddleware(options.root, viteServer)
+
+ viteServer.middlewares.use(async (req, res) => {
+ const template = await viteServer.transformIndexHtml(
+ req.originalUrl as string,
+ `
+
+
+ `,
+ )
+
+ console.log('template, maybe use?', template)
+
+ try {
+ const serverEntry = (
+ await viteServer.ssrLoadModule('~start/ssr-entry')
+ )['default']
+ const event = createEvent(req, res)
+ const result: string | Response = await serverEntry(event)
+
+ if (result instanceof Response) {
+ sendWebResponse(event, result)
+ return
+ }
+ res.setHeader('Content-Type', 'text/html')
+ res.end(result)
+ } catch (e) {
+ viteServer.ssrFixStacktrace(e as Error)
+ res.statusCode = 500
+ res.end(`
+
+
+
+
+ Error
+
+
+
+
+
+ `)
+ }
+ })
+ }
+ },
+ }
+}
+
+/**
+ * Removes Vite internal middleware
+ *
+ * @param server
+ */
+function remove_html_middlewares(server: ViteDevServer['middlewares']) {
+ const html_middlewares = [
+ 'viteIndexHtmlMiddleware',
+ 'vite404Middleware',
+ 'viteSpaFallbackMiddleware',
+ ]
+ for (let i = server.stack.length - 1; i > 0; i--) {
+ if (
+ html_middlewares.includes(
+ // @ts-expect-error
+ server.stack[i].handle.name,
+ )
+ ) {
+ server.stack.splice(i, 1)
+ }
+ }
+}
+
+/**
+ * Formats error for SSR message in error overlay
+ * @param req
+ * @param error
+ * @returns
+ */
+function prepareError(req: Connect.IncomingMessage, error: unknown) {
+ const e = error as Error
+ return {
+ message: `An error occured while server rendering ${req.url}:\n\n\t${
+ typeof e === 'string' ? e : e.message
+ } `,
+ stack: typeof e === 'string' ? '' : e.stack,
+ }
+}
diff --git a/packages/react-start-plugin/src/nitro/utils/load-esm.ts b/packages/react-start-plugin/src/nitro/utils/load-esm.ts
new file mode 100644
index 0000000000..f9a76f683e
--- /dev/null
+++ b/packages/react-start-plugin/src/nitro/utils/load-esm.ts
@@ -0,0 +1,27 @@
+/**
+ * @license
+ * Copyright Google LLC All Rights Reserved.
+ *
+ * Use of this source code is governed by an MIT-style license that can be
+ * found in the LICENSE file at https://angular.dev/license
+ */
+
+import { URL } from 'node:url';
+
+/**
+ * This uses a dynamic import to load a module which may be ESM.
+ * CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
+ * will currently, unconditionally downlevel dynamic import into a require call.
+ * require calls cannot load ESM code and will result in a runtime error. To workaround
+ * this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
+ * Once TypeScript provides support for keeping the dynamic import this workaround can
+ * be dropped.
+ *
+ * @param modulePath The path of the module to load.
+ * @returns A Promise that resolves to the dynamically imported module.
+ */
+export function loadEsmModule(modulePath: string | URL): Promise {
+ return new Function('modulePath', `return import(modulePath);`)(
+ modulePath,
+ ) as Promise;
+}
diff --git a/packages/react-start-plugin/src/nitro/utils/register-dev-middleware.ts b/packages/react-start-plugin/src/nitro/utils/register-dev-middleware.ts
new file mode 100644
index 0000000000..78d1389515
--- /dev/null
+++ b/packages/react-start-plugin/src/nitro/utils/register-dev-middleware.ts
@@ -0,0 +1,25 @@
+import { createEvent } from 'h3'
+import fg from 'fast-glob'
+import type { ViteDevServer } from 'vite'
+import type { EventHandler } from 'h3'
+
+export function registerDevServerMiddleware(
+ root: string,
+ viteServer: ViteDevServer,
+) {
+ const middlewareFiles = fg.sync([`${root}/src/server/middleware/**/*.ts`])
+
+ middlewareFiles.forEach((file) => {
+ viteServer.middlewares.use(async (req, res, next) => {
+ const middlewareHandler: EventHandler = await viteServer
+ .ssrLoadModule(file)
+ .then((m: unknown) => (m as { default: EventHandler }).default)
+
+ const result = await middlewareHandler(createEvent(req, res))
+
+ if (!result) {
+ next()
+ }
+ })
+ })
+}
diff --git a/packages/react-start-plugin/src/nitro/vite-plugin-nitro.ts b/packages/react-start-plugin/src/nitro/vite-plugin-nitro.ts
new file mode 100644
index 0000000000..b28b04f643
--- /dev/null
+++ b/packages/react-start-plugin/src/nitro/vite-plugin-nitro.ts
@@ -0,0 +1,3 @@
+
+
+
diff --git a/packages/react-start-plugin/src/routesManifestPlugin.ts b/packages/react-start-plugin/src/routesManifestPlugin.ts
new file mode 100644
index 0000000000..0fde46ec3c
--- /dev/null
+++ b/packages/react-start-plugin/src/routesManifestPlugin.ts
@@ -0,0 +1,172 @@
+import { readFileSync } from 'node:fs'
+import path from 'node:path'
+import type { configSchema } from '@tanstack/router-generator'
+import type { PluginOption, ResolvedConfig } from 'vite'
+import type { z } from 'zod'
+import type { Manifest } from '@tanstack/react-router'
+
+export function tsrRoutesManifestPlugin(opts: {
+ tsrConfig: z.infer
+ clientBase: string
+}): PluginOption {
+ let config: ResolvedConfig
+
+ return {
+ name: 'tsr-routes-manifest',
+ configResolved(resolvedConfig) {
+ config = resolvedConfig
+ },
+ resolveId(id) {
+ if (id === 'tsr:routes-manifest') {
+ return id
+ }
+ return
+ },
+ load(id) {
+ if (id === 'tsr:routes-manifest') {
+ // If we're in development, return a dummy manifest
+
+ if (config.command === 'serve') {
+ return `export default () => ({
+ routes: {}
+ })`
+ }
+
+ const clientViteManifestPath = path.resolve(
+ config.build.outDir,
+ `../client/${opts.clientBase}/.vite/manifest.json`,
+ )
+
+ type ViteManifest = Record<
+ string,
+ {
+ file: string
+ isEntry: boolean
+ imports: Array
+ }
+ >
+
+ let manifest: ViteManifest
+ try {
+ manifest = JSON.parse(readFileSync(clientViteManifestPath, 'utf-8'))
+ } catch (err) {
+ console.error(err)
+ throw new Error(
+ `Could not find the production client vite manifest at '${clientViteManifestPath}'!`,
+ )
+ }
+
+ const routeTreePath = path.resolve(opts.tsrConfig.generatedRouteTree)
+
+ let routeTreeContent: string
+ try {
+ routeTreeContent = readFileSync(routeTreePath, 'utf-8')
+ } catch (err) {
+ console.error(err)
+ throw new Error(
+ `Could not find the generated route tree at '${routeTreePath}'!`,
+ )
+ }
+
+ // Extract the routesManifest JSON from the route tree file.
+ // It's located between the /* ROUTE_MANIFEST_START and ROUTE_MANIFEST_END */ comment block.
+
+ const routerManifest = JSON.parse(
+ routeTreeContent.match(
+ /\/\* ROUTE_MANIFEST_START([\s\S]*?)ROUTE_MANIFEST_END \*\//,
+ )?.[1] || '{ routes: {} }',
+ ) as Manifest
+
+ const routes = routerManifest.routes
+
+ let entryFile:
+ | {
+ file: string
+ imports: Array
+ }
+ | undefined
+
+ const filesByRouteFilePath: ViteManifest = Object.fromEntries(
+ Object.entries(manifest).map(([k, v]) => {
+ if (v.isEntry) {
+ entryFile = v
+ }
+
+ const rPath = k.split('?')[0]
+
+ return [rPath, v]
+ }, {}),
+ )
+
+ // Add preloads to the routes from the vite manifest
+ Object.entries(routes).forEach(([k, v]) => {
+ const file =
+ filesByRouteFilePath[
+ path.join(opts.tsrConfig.routesDirectory, v.filePath as string)
+ ]
+
+ if (file) {
+ const preloads = file.imports.map((d) =>
+ path.join(opts.clientBase, manifest[d]!.file),
+ )
+
+ preloads.unshift(path.join(opts.clientBase, file.file))
+
+ routes[k] = {
+ ...v,
+ preloads,
+ }
+ }
+ })
+
+ if (entryFile) {
+ routes.__root__!.preloads = [
+ path.join(opts.clientBase, entryFile.file),
+ ...entryFile.imports.map((d) =>
+ path.join(opts.clientBase, manifest[d]!.file),
+ ),
+ ]
+ }
+
+ const recurseRoute = (
+ route: {
+ preloads?: Array
+ children?: Array
+ },
+ seenPreloads = {} as Record,
+ ) => {
+ route.preloads = route.preloads?.filter((preload) => {
+ if (seenPreloads[preload]) {
+ return false
+ }
+ seenPreloads[preload] = true
+ return true
+ })
+
+ if (route.children) {
+ route.children.forEach((child) => {
+ const childRoute = routes[child]!
+ recurseRoute(childRoute, { ...seenPreloads })
+ })
+ }
+ }
+
+ // @ts-expect-error
+ recurseRoute(routes.__root__)
+
+ const routesManifest = {
+ routes,
+ }
+
+ if (process.env.TSR_VITE_DEBUG) {
+ console.info(
+ 'Routes Manifest: \n' + JSON.stringify(routesManifest, null, 2),
+ )
+ }
+
+ return `export default () => (${JSON.stringify(routesManifest)})`
+ }
+ return
+ },
+ }
+}
diff --git a/packages/react-start-plugin/src/server-fns.ts b/packages/react-start-plugin/src/server-fns.ts
new file mode 100644
index 0000000000..4d08a9d165
--- /dev/null
+++ b/packages/react-start-plugin/src/server-fns.ts
@@ -0,0 +1,178 @@
+import { fileURLToPath, pathToFileURL } from 'node:url'
+import path from 'node:path'
+import { logDiff } from '@tanstack/router-utils'
+import { compileStartOutput } from './compilers'
+
+import type { Plugin } from 'vite'
+
+const debug =
+ process.env.TSR_VITE_DEBUG &&
+ ['true', 'start-plugin'].includes(process.env.TSR_VITE_DEBUG)
+
+export type TanStackStartViteOptions = {
+ globalMiddlewareEntry: string
+}
+
+const transformFuncs = [
+ 'createServerFn',
+ 'createMiddleware',
+ 'serverOnly',
+ 'clientOnly',
+ 'createIsomorphicFn',
+]
+const tokenRegex = new RegExp(transformFuncs.join('|'))
+// const eitherFuncRegex = new RegExp(
+// `(function ${transformFuncs.join('|function ')})`,
+// )
+
+export function createTanStackStartPlugin(opts: TanStackStartViteOptions): {
+ client: Array
+ ssr: Array
+ server: Array
+} {
+ return {
+ client: [
+ (() => {
+ let entry: string | null = null
+ let ROOT: string = process.cwd()
+ return {
+ name: 'vite-plugin-tanstack-start-server-entry-client',
+ enforce: 'pre',
+ configResolved: (config) => {
+ ROOT = config.root
+ entry = path.resolve(ROOT, (config as any).router.handler)
+
+ if (!entry) {
+ throw new Error('@tanstack/start-plugin: No server entry found!')
+ }
+ },
+ transform(code, id) {
+ if (entry && id.includes(entry)) {
+ return {
+ code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
+ map: null,
+ }
+ }
+ return null
+ },
+ }
+ })(),
+ TanStackStartServerFnsAndMiddleware({ ...opts, env: 'client' }),
+ ],
+ ssr: [
+ (() => {
+ let entry: string | null = null
+ let ROOT: string = process.cwd()
+ return {
+ name: 'vite-plugin-tanstack-start-server-entry-ssr',
+ enforce: 'pre',
+ configResolved: (config) => {
+ ROOT = config.root
+ entry = path.resolve(ROOT, (config as any).router.handler)
+
+ if (!entry) {
+ throw new Error('@tanstack/start-plugin: No server entry found!')
+ }
+ },
+ transform(code, id) {
+ if (entry && id.includes(entry)) {
+ return {
+ code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
+ map: null,
+ }
+ }
+ return null
+ },
+ }
+ })(),
+ TanStackStartServerFnsAndMiddleware({ ...opts, env: 'ssr' }),
+ ],
+ server: [
+ (() => {
+ let entry: string | null = null
+ let ROOT: string = process.cwd()
+ return {
+ name: 'vite-plugin-tanstack-start-server-entry-server',
+ enforce: 'pre',
+ configResolved: (config) => {
+ ROOT = config.root
+ entry = path.resolve(ROOT, (config as any).router.handler)
+
+ if (!entry) {
+ throw new Error('@tanstack/start-plugin: No server entry found!')
+ }
+ },
+ transform(code, id) {
+ if (entry && id.includes(entry)) {
+ return {
+ code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
+ map: null,
+ }
+ }
+ return null
+ },
+ }
+ })(),
+ TanStackStartServerFnsAndMiddleware({ ...opts, env: 'server' }),
+ ],
+ }
+}
+
+export function TanStackStartServerFnsAndMiddleware(opts: {
+ env: 'server' | 'ssr' | 'client'
+}): Plugin {
+ let ROOT: string = process.cwd()
+
+ return {
+ name: 'vite-plugin-tanstack-start-create-server-fn',
+ enforce: 'pre',
+ configResolved: (config) => {
+ ROOT = config.root
+ },
+ transform(code, id) {
+ const url = pathToFileURL(id)
+ url.searchParams.delete('v')
+ id = fileURLToPath(url).replace(/\\/g, '/')
+
+ const includesToken = tokenRegex.test(code)
+ // const includesEitherFunc = eitherFuncRegex.test(code)
+
+ if (
+ !includesToken
+ // includesEitherFunc
+ // /node_modules/.test(id)
+ ) {
+ return null
+ }
+
+ if (code.includes('@react-refresh')) {
+ throw new Error(
+ `We detected that the '@vitejs/plugin-react' was passed before '@tanstack/start-plugin'. Please make sure that '@tanstack/router-vite-plugin' is passed before '@vitejs/plugin-react' and try again:
+e.g.
+
+plugins: [
+ TanStackStartVite(), // Place this before viteReact()
+ viteReact(),
+]
+`,
+ )
+ }
+
+ if (debug) console.info(`${opts.env} Compiling Start: `, id)
+
+ const compiled = compileStartOutput({
+ code,
+ root: ROOT,
+ filename: id,
+ env: opts.env,
+ })
+
+ if (debug) {
+ logDiff(code, compiled.code)
+ console.log('Output:\n', compiled.code + '\n\n')
+ }
+
+ return compiled
+ },
+ }
+}
diff --git a/packages/react-start-plugin/tsconfig.json b/packages/react-start-plugin/tsconfig.json
index 37d21ef6ca..6c8c904b07 100644
--- a/packages/react-start-plugin/tsconfig.json
+++ b/packages/react-start-plugin/tsconfig.json
@@ -3,6 +3,9 @@
"include": ["src", "vite.config.ts", "tests"],
"exclude": ["tests/**/test-files/**", "tests/**/snapshots/**"],
"compilerOptions": {
- "jsx": "react-jsx"
+ "rootDir": "src",
+ "outDir": "dist/esm",
+ "target": "esnext",
+ "noEmit": false
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f4d98db7ef..5e6cf54032 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -4203,9 +4203,9 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
+ vite:
+ specifier: 6.1.0
+ version: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
devDependencies:
'@types/node':
specifier: ^22.5.4
@@ -5927,9 +5927,21 @@ importers:
'@babel/types':
specifier: ^7.26.8
version: 7.26.8
+ '@tanstack/react-router':
+ specifier: workspace:*
+ version: link:../react-router
+ '@tanstack/router-generator':
+ specifier: workspace:*
+ version: link:../router-generator
+ '@tanstack/router-plugin':
+ specifier: workspace:*
+ version: link:../router-plugin
'@tanstack/router-utils':
specifier: workspace:*
version: link:../router-utils
+ '@tanstack/server-functions-plugin':
+ specifier: workspace:*
+ version: link:../server-functions-plugin
babel-dead-code-elimination:
specifier: ^1.0.9
version: 1.0.9
@@ -5952,6 +5964,24 @@ importers:
'@types/babel__traverse':
specifier: ^7.20.6
version: 7.20.6
+ '@vitejs/plugin-react':
+ specifier: ^4.3.4
+ version: 4.3.4(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
+ fast-glob:
+ specifier: ^3.3.3
+ version: 3.3.3
+ h3:
+ specifier: 1.13.0
+ version: 1.13.0
+ nitropack:
+ specifier: ^2.10.4
+ version: 2.10.4(typescript@5.7.3)
+ xmlbuilder2:
+ specifier: ^3.1.1
+ version: 3.1.1
+ zod:
+ specifier: ^3.24.2
+ version: 3.24.2
packages/react-start-router-manifest:
dependencies:
@@ -8619,6 +8649,22 @@ packages:
cpu: [x64]
os: [win32]
+ '@oozcitak/dom@1.15.10':
+ resolution: {integrity: sha512-0JT29/LaxVgRcGKvHmSrUTEvZ8BXvZhGl2LASRUgHqDTC1M5g1pLmVv56IYNyt3bG2CUjDkc67wnyZC14pbQrQ==}
+ engines: {node: '>=8.0'}
+
+ '@oozcitak/infra@1.0.8':
+ resolution: {integrity: sha512-JRAUc9VR6IGHOL7OGF+yrvs0LO8SlqGnPAMqyzOuFZPSZSXI7Xf2O9+awQPSMXgIWGtgUf/dA6Hs6X6ySEaWTg==}
+ engines: {node: '>=6.0'}
+
+ '@oozcitak/url@1.0.4':
+ resolution: {integrity: sha512-kDcD8y+y3FCSOvnBI6HJgl00viO/nGbQoCINmQ0h98OhnGITrWR3bOGfwYCthgcrV8AnTJz8MzslTQbC3SOAmw==}
+ engines: {node: '>=8.0'}
+
+ '@oozcitak/util@8.3.8':
+ resolution: {integrity: sha512-T8TbSnGsxo6TDBJx/Sgv/BlVJL3tshxZP7Aq5R1mSnM5OcHY2dQaxLMu2+E8u3gN0MLOzdjurqN4ZRVuzQycOQ==}
+ engines: {node: '>=8.0'}
+
'@open-draft/deferred-promise@2.2.0':
resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==}
@@ -14999,6 +15045,10 @@ packages:
resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==}
engines: {node: '>=18'}
+ xmlbuilder2@3.1.1:
+ resolution: {integrity: sha512-WCSfbfZnQDdLQLiMdGUQpMxxckeQ4oZNMNhLVkcekTu7xhD4tuUDyAPoY8CwXvBYE6LwBHd6QW2WZXlOWr1vCw==}
+ engines: {node: '>=12.0'}
+
xmlchars@2.2.0:
resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}
@@ -15067,6 +15117,9 @@ packages:
zod@3.24.1:
resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==}
+ zod@3.24.2:
+ resolution: {integrity: sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==}
+
snapshots:
'@adobe/css-tools@4.4.1': {}
@@ -16881,6 +16934,23 @@ snapshots:
'@nx/nx-win32-x64-msvc@20.4.2':
optional: true
+ '@oozcitak/dom@1.15.10':
+ dependencies:
+ '@oozcitak/infra': 1.0.8
+ '@oozcitak/url': 1.0.4
+ '@oozcitak/util': 8.3.8
+
+ '@oozcitak/infra@1.0.8':
+ dependencies:
+ '@oozcitak/util': 8.3.8
+
+ '@oozcitak/url@1.0.4':
+ dependencies:
+ '@oozcitak/infra': 1.0.8
+ '@oozcitak/util': 8.3.8
+
+ '@oozcitak/util@8.3.8': {}
+
'@open-draft/deferred-promise@2.2.0': {}
'@open-draft/logger@0.3.0':
@@ -24146,6 +24216,13 @@ snapshots:
xml-name-validator@5.0.0: {}
+ xmlbuilder2@3.1.1:
+ dependencies:
+ '@oozcitak/dom': 1.15.10
+ '@oozcitak/infra': 1.0.8
+ '@oozcitak/util': 8.3.8
+ js-yaml: 3.14.1
+
xmlchars@2.2.0: {}
y18n@5.0.8: {}
@@ -24203,3 +24280,5 @@ snapshots:
readable-stream: 4.7.0
zod@3.24.1: {}
+
+ zod@3.24.2: {}
From 5a3da487a8e4aa3971dc512b0c9568d72f971703 Mon Sep 17 00:00:00 2001
From: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
Date: Wed, 26 Feb 2025 01:43:07 +1300
Subject: [PATCH 006/155] chore: gitignore timestamp files
---
.gitignore | 2 ++
.../vite.config.timestamp_1740425668217.js | 15 ---------------
2 files changed, 2 insertions(+), 15 deletions(-)
delete mode 100644 examples/react/start-basic/vite.config.timestamp_1740425668217.js
diff --git a/.gitignore b/.gitignore
index 5cc3e94113..36785455d3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,12 +61,14 @@ nx-cloud.env
gpt/db.json
app.config.timestamp-*
+vite.config.timestamp-*
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
app.config.js.timestamp-*
app.config.ts.timestamp-*
app.config.timestamp_*
+vite.config.timestamp_*
vite.config.js.timestamp_*
vite.config.ts.timestamp_*
app.config.js.timestamp_*
diff --git a/examples/react/start-basic/vite.config.timestamp_1740425668217.js b/examples/react/start-basic/vite.config.timestamp_1740425668217.js
deleted file mode 100644
index 70db1b8430..0000000000
--- a/examples/react/start-basic/vite.config.timestamp_1740425668217.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// vite.config.ts
-import { defineConfig } from "vite";
-import tsConfigPaths from "vite-tsconfig-paths";
-import { TanStackStartVitePlugin } from "@tanstack/start/plugin";
-var vite_config_default = defineConfig({
- plugins: [
- tsConfigPaths({
- projects: ["./tsconfig.json"]
- }),
- TanStackStartVitePlugin()
- ]
-});
-export {
- vite_config_default as default
-};
From e8c6f189bd4e31ce8789744380d099c720470e6f Mon Sep 17 00:00:00 2001
From: Manuel Schiller
Date: Wed, 26 Feb 2025 00:15:55 +0100
Subject: [PATCH 007/155] remove react-start-config
---
.github/labeler.yml | 2 -
packages/react-start-config/README.md | 33 -
packages/react-start-config/eslint.config.js | 31 -
packages/react-start-config/package.json | 73 --
packages/react-start-config/src/index.ts | 665 ------------------
packages/react-start-config/src/schema.ts | 145 ----
.../src/vinxi-file-router.ts | 90 ---
packages/react-start-config/tsconfig.json | 10 -
packages/react-start/src/config.tsx | 1 -
packages/react-start/vite.config.ts | 2 -
10 files changed, 1052 deletions(-)
delete mode 100644 packages/react-start-config/README.md
delete mode 100644 packages/react-start-config/eslint.config.js
delete mode 100644 packages/react-start-config/package.json
delete mode 100644 packages/react-start-config/src/index.ts
delete mode 100644 packages/react-start-config/src/schema.ts
delete mode 100644 packages/react-start-config/src/vinxi-file-router.ts
delete mode 100644 packages/react-start-config/tsconfig.json
delete mode 100644 packages/react-start/src/config.tsx
diff --git a/.github/labeler.yml b/.github/labeler.yml
index 76b074f192..b71b1f4c35 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -22,8 +22,6 @@
- 'packages/react-start-api-routes/**/*'
'package: react-start-client':
- 'packages/react-start-client/**/*'
-'package: react-start-config':
- - 'packages/react-start-config/**/*'
'package: react-start-plugin':
- 'packages/react-start-plugin/**/*'
'package: react-start-router-manifest':
diff --git a/packages/react-start-config/README.md b/packages/react-start-config/README.md
deleted file mode 100644
index bb009b0c87..0000000000
--- a/packages/react-start-config/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-> 🤫 we're cooking up something special!
-
-
-
-# TanStack Start
-
-
-
-🤖 Type-safe router w/ built-in caching & URL state management for React!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Query](https://github.com/tannerlinsley/react-query), [React Table](https://github.com/tanstack/react-table), [React Charts](https://github.com/tannerlinsley/react-charts), [React Virtual](https://github.com/tannerlinsley/react-virtual)
-
-## Visit [tanstack.com/router](https://tanstack.com/router) for docs, guides, API and more!
diff --git a/packages/react-start-config/eslint.config.js b/packages/react-start-config/eslint.config.js
deleted file mode 100644
index 931f0ec774..0000000000
--- a/packages/react-start-config/eslint.config.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// @ts-check
-
-import pluginReact from '@eslint-react/eslint-plugin'
-import pluginReactHooks from 'eslint-plugin-react-hooks'
-import rootConfig from '../../eslint.config.js'
-
-export default [
- ...rootConfig,
- {
- ...pluginReact.configs.recommended,
- files: ['**/*.{ts,tsx}'],
- },
- {
- plugins: {
- 'react-hooks': pluginReactHooks,
- },
- rules: {
- '@eslint-react/no-unstable-context-value': 'off',
- '@eslint-react/no-unstable-default-props': 'off',
- '@eslint-react/dom/no-missing-button-type': 'off',
- 'react-hooks/exhaustive-deps': 'error',
- 'react-hooks/rules-of-hooks': 'error',
- },
- },
- {
- files: ['**/__tests__/**'],
- rules: {
- '@typescript-eslint/no-unnecessary-condition': 'off',
- },
- },
-]
diff --git a/packages/react-start-config/package.json b/packages/react-start-config/package.json
deleted file mode 100644
index efed5ca44e..0000000000
--- a/packages/react-start-config/package.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "name": "@tanstack/react-start-config",
- "version": "1.114.3",
- "description": "Modern and scalable routing for React applications",
- "author": "Tanner Linsley",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/TanStack/router.git",
- "directory": "packages/react-start-config"
- },
- "homepage": "https://tanstack.com/start",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/tannerlinsley"
- },
- "keywords": [
- "react",
- "location",
- "router",
- "routing",
- "async",
- "async router",
- "typescript"
- ],
- "scripts": {
- "clean": "rimraf ./dist && rimraf ./coverage",
- "build": "tsc",
- "test": "pnpm test:eslint && pnpm test:types && pnpm test:build && pnpm test:unit",
- "test:unit": "exit 0;vitest",
- "test:eslint": "eslint ./src",
- "test:types": "exit 0; vitest"
- },
- "type": "module",
- "types": "dist/esm/index.d.ts",
- "exports": {
- ".": {
- "import": {
- "types": "./dist/esm/index.d.ts",
- "default": "./dist/esm/index.js"
- }
- },
- "./package.json": "./package.json"
- },
- "sideEffects": false,
- "files": [
- "dist",
- "src"
- ],
- "engines": {
- "node": ">=12"
- },
- "dependencies": {
- "@tanstack/router-core": "workspace:^",
- "@tanstack/router-generator": "workspace:^",
- "@tanstack/router-plugin": "workspace:^",
- "@tanstack/server-functions-plugin": "workspace:^",
- "@tanstack/react-start-plugin": "workspace:^",
- "@tanstack/react-start-server-functions-handler": "workspace:^",
- "@vitejs/plugin-react": "^4.3.4",
- "import-meta-resolve": "^4.1.0",
- "nitropack": "^2.10.4",
- "ofetch": "^1.4.1",
- "vite": "^6.1.0",
- "vinxi": "0.5.3",
- "zod": "^3.24.1"
- },
- "peerDependencies": {
- "react": ">=18.0.0 || >=19.0.0",
- "react-dom": ">=18.0.0 || >=19.0.0",
- "vite": "^6.0.0"
- }
-}
diff --git a/packages/react-start-config/src/index.ts b/packages/react-start-config/src/index.ts
deleted file mode 100644
index 8fc7c3f5a8..0000000000
--- a/packages/react-start-config/src/index.ts
+++ /dev/null
@@ -1,665 +0,0 @@
-import path from 'node:path'
-import { existsSync, readFileSync } from 'node:fs'
-import { readFile } from 'node:fs/promises'
-import { fileURLToPath } from 'node:url'
-import viteReact from '@vitejs/plugin-react'
-import { resolve } from 'import-meta-resolve'
-import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
-import { getConfig } from '@tanstack/router-generator'
-import { createApp } from 'vinxi'
-import { config } from 'vinxi/plugins/config'
-// // @ts-expect-error
-// import { serverComponents } from '@vinxi/server-components/plugin'
-import { createTanStackServerFnPlugin } from '@tanstack/server-functions-plugin'
-import { createTanStackStartPlugin } from '@tanstack/react-start-plugin'
-import { createFetch } from 'ofetch'
-import { createNitro } from 'nitropack'
-import { tanstackStartVinxiFileRouter } from './vinxi-file-router.js'
-import {
- checkDeploymentPresetInput,
- getUserViteConfig,
- inlineConfigSchema,
- serverSchema,
-} from './schema.js'
-import type { configSchema } from '@tanstack/router-generator'
-import type { z } from 'zod'
-import type {
- TanStackStartInputConfig,
- TanStackStartOutputConfig,
-} from './schema.js'
-import type { App as VinxiApp } from 'vinxi'
-import type { Manifest } from '@tanstack/router-core'
-import type * as vite from 'vite'
-
-export type {
- TanStackStartInputConfig,
- TanStackStartOutputConfig,
-} from './schema.js'
-
-function setTsrDefaults(config: TanStackStartOutputConfig['tsr']) {
- // Normally these are `./src/___`, but we're using `./app/___` for Start stuff
- const appDirectory = config?.appDirectory ?? './app'
- return {
- ...config,
- appDirectory: config?.appDirectory ?? appDirectory,
- routesDirectory:
- config?.routesDirectory ?? path.join(appDirectory, 'routes'),
- generatedRouteTree:
- config?.generatedRouteTree ?? path.join(appDirectory, 'routeTree.gen.ts'),
- }
-}
-
-function mergeSsrOptions(options: Array) {
- let ssrOptions: vite.SSROptions = {}
- let noExternal: vite.SSROptions['noExternal'] = []
- for (const option of options) {
- if (!option) {
- continue
- }
-
- if (option.noExternal) {
- if (option.noExternal === true) {
- noExternal = true
- } else if (noExternal !== true) {
- if (Array.isArray(option.noExternal)) {
- noExternal.push(...option.noExternal)
- } else {
- noExternal.push(option.noExternal)
- }
- }
- }
-
- ssrOptions = {
- ...ssrOptions,
- ...option,
- noExternal,
- }
- }
-
- return ssrOptions
-}
-
-export async function defineConfig(
- inlineConfig: TanStackStartInputConfig = {},
-): Promise {
- const opts = inlineConfigSchema.parse(inlineConfig)
-
- const { preset: configDeploymentPreset, ...serverOptions } =
- serverSchema.parse(opts.server || {})
-
- const deploymentPreset = checkDeploymentPresetInput(
- configDeploymentPreset || 'node-server',
- )
- const tsr = setTsrDefaults(opts.tsr)
- const tsrConfig = getConfig(tsr)
-
- const appDirectory = tsr.appDirectory
- const publicDir = opts.routers?.public?.dir || './public'
-
- const publicBase = opts.routers?.public?.base || '/'
- const clientBase = opts.routers?.client?.base || '/_build'
- const apiBase = opts.tsr?.apiBase || '/api'
- const serverBase = opts.routers?.server?.base || '/_server'
-
- const apiMiddleware = opts.routers?.api?.middleware || undefined
- const serverMiddleware = opts.routers?.server?.middleware || undefined
- const ssrMiddleware = opts.routers?.ssr?.middleware || undefined
-
- const clientEntry =
- opts.routers?.client?.entry || path.join(appDirectory, 'client.tsx')
- const ssrEntry =
- opts.routers?.ssr?.entry || path.join(appDirectory, 'ssr.tsx')
- const apiEntry = opts.routers?.api?.entry || path.join(appDirectory, 'api.ts')
- const globalMiddlewareEntry =
- opts.routers?.server?.globalMiddlewareEntry ||
- path.join(appDirectory, 'global-middleware.ts')
- const apiEntryExists = existsSync(apiEntry)
-
- const viteConfig = getUserViteConfig(opts.vite)
-
- const TanStackServerFnsPlugin = createTanStackServerFnPlugin({
- // This is the ID that will be available to look up and import
- // our server function manifest and resolve its module
- manifestVirtualImportId: 'tsr:server-fn-manifest',
- client: {
- getRuntimeCode: () =>
- `import { createClientRpc } from '@tanstack/react-start/server-functions-client'`,
- replacer: (opts) =>
- `createClientRpc('${opts.functionId}', '${serverBase}')`,
- },
- ssr: {
- getRuntimeCode: () =>
- `import { createSsrRpc } from '@tanstack/react-start/server-functions-ssr'`,
- replacer: (opts) => `createSsrRpc('${opts.functionId}', '${serverBase}')`,
- },
- server: {
- getRuntimeCode: () =>
- `import { createServerRpc } from '@tanstack/react-start/server-functions-server'`,
- replacer: (opts) =>
- `createServerRpc('${opts.functionId}', '${serverBase}', ${opts.fn})`,
- },
- })
-
- const TanStackStartPlugin = createTanStackStartPlugin({
- globalMiddlewareEntry,
- })
-
- // Create a dummy nitro app to get the resolved public output path
- const dummyNitroApp = await createNitro({
- preset: deploymentPreset,
- compatibilityDate: '2024-12-01',
- })
-
- const nitroOutputPublicDir = dummyNitroApp.options.output.publicDir
- await dummyNitroApp.close()
-
- let vinxiApp = createApp({
- server: {
- ...serverOptions,
- preset: deploymentPreset,
- experimental: {
- ...serverOptions.experimental,
- asyncContext: true,
- },
- },
- routers: [
- {
- name: 'public',
- type: 'static',
- dir: publicDir,
- base: publicBase,
- },
- {
- name: 'client',
- type: 'client',
- target: 'browser',
- handler: clientEntry,
- base: clientBase,
- // @ts-expect-error
- build: {
- sourcemap: true,
- },
- plugins: () => {
- const routerType = 'client'
- const clientViteConfig = getUserViteConfig(
- opts.routers?.[routerType]?.vite,
- )
-
- return [
- config('tss-vite-config-client', {
- ...viteConfig.userConfig,
- ...clientViteConfig.userConfig,
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(clientViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv(
- 'TSS_OUTPUT_PUBLIC_DIR',
- nitroOutputPublicDir,
- ),
- },
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- clientViteConfig.userConfig.ssr,
- {
- noExternal,
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(clientViteConfig.userConfig.optimizeDeps || {}),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- enableRouteGeneration: true,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- TanStackStartPlugin.client,
- TanStackServerFnsPlugin.client,
- ...(viteConfig.plugins || []),
- ...(clientViteConfig.plugins || []),
- viteReact(opts.react),
- // TODO: RSCS - enable this
- // serverComponents.client(),
- ]
- },
- },
- {
- name: 'ssr',
- type: 'http',
- target: 'server',
- handler: ssrEntry,
- middleware: ssrMiddleware,
- // @ts-expect-error
- link: {
- client: 'client',
- },
- plugins: () => {
- const routerType = 'ssr'
- const ssrViteConfig = getUserViteConfig(
- opts.routers?.[routerType]?.vite,
- )
-
- return [
- config('tss-vite-config-ssr', {
- ...viteConfig.userConfig,
- ...ssrViteConfig.userConfig,
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(ssrViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv(
- 'TSS_OUTPUT_PUBLIC_DIR',
- nitroOutputPublicDir,
- ),
- },
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- ssrViteConfig.userConfig.ssr,
- {
- noExternal,
- external: ['@vinxi/react-server-dom/client'],
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(ssrViteConfig.userConfig.optimizeDeps || {}),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- enableRouteGeneration: false,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- TanStackStartPlugin.ssr,
- TanStackServerFnsPlugin.ssr,
- tsrRoutesManifest({
- tsrConfig,
- clientBase,
- }),
- ...(getUserViteConfig(opts.vite).plugins || []),
- ...(getUserViteConfig(opts.routers?.ssr?.vite).plugins || []),
- viteReact(opts.react),
- ]
- },
- },
- {
- name: 'server',
- type: 'http',
- target: 'server',
- base: serverBase,
- middleware: serverMiddleware,
- // TODO: RSCS - enable this
- // worker: true,
- handler: importToProjectRelative(
- '@tanstack/react-start-server-functions-handler',
- ),
- plugins: () => {
- const routerType = 'server'
- const serverViteConfig = getUserViteConfig(
- opts.routers?.[routerType]?.vite,
- )
-
- return [
- config('tss-vite-config-server', {
- ...viteConfig.userConfig,
- ...serverViteConfig.userConfig,
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(serverViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv('TSS_SERVER_FN_BASE', serverBase),
- ...injectDefineEnv(
- 'TSS_OUTPUT_PUBLIC_DIR',
- nitroOutputPublicDir,
- ),
- },
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- serverViteConfig.userConfig.ssr,
- {
- noExternal,
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(serverViteConfig.userConfig.optimizeDeps || {}),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- enableRouteGeneration: false,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- TanStackStartPlugin.server,
- TanStackServerFnsPlugin.server,
- // TODO: RSCS - remove this
- // resolve: {
- // conditions: [],
- // },
- // TODO: RSCs - add this
- // serverComponents.serverActions({
- // resolve: {
- // conditions: [
- // 'react-server',
- // // 'node',
- // 'import',
- // process.env.NODE_ENV,
- // ],
- // },
- // runtime: '@vinxi/react-server-dom/runtime',
- // transpileDeps: ['react', 'react-dom', '@vinxi/react-server-dom'],
- // }),
- ...(viteConfig.plugins || []),
- ...(serverViteConfig.plugins || []),
- ]
- },
- },
- ],
- })
-
- const noExternal = [
- '@tanstack/start',
- '@tanstack/react-start',
- '@tanstack/react-start/server',
- '@tanstack/react-start-client',
- '@tanstack/react-start-server',
- '@tanstack/react-start-server-functions-fetcher',
- '@tanstack/react-start-server-functions-handler',
- '@tanstack/react-start-server-functions-client',
- '@tanstack/react-start-server-functions-ssr',
- '@tanstack/start-server-functions-server',
- '@tanstack/react-start-router-manifest',
- '@tanstack/react-start-config',
- '@tanstack/react-start-api-routes',
- '@tanstack/server-functions-plugin',
- 'tsr:routes-manifest',
- 'tsr:server-fn-manifest',
- ]
-
- // If API routes handler exists, add a router for it
- if (apiEntryExists) {
- vinxiApp = vinxiApp.addRouter({
- name: 'api',
- type: 'http',
- target: 'server',
- base: apiBase,
- handler: apiEntry,
- middleware: apiMiddleware,
- routes: tanstackStartVinxiFileRouter({ tsrConfig, apiBase }),
- plugins: () => {
- const viteConfig = getUserViteConfig(opts.vite)
- const apiViteConfig = getUserViteConfig(opts.routers?.api?.vite)
-
- return [
- config('tsr-vite-config-api', {
- ...viteConfig.userConfig,
- ...apiViteConfig.userConfig,
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- apiViteConfig.userConfig.ssr,
- {
- noExternal,
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(apiViteConfig.userConfig.optimizeDeps || {}),
- },
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(apiViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv('TSS_OUTPUT_PUBLIC_DIR', nitroOutputPublicDir),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- enableRouteGeneration: false,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- ...(viteConfig.plugins || []),
- ...(apiViteConfig.plugins || []),
- ]
- },
- })
- }
-
- // Because Vinxi doesn't use the normal nitro dev server, it doesn't
- // supply $fetch during dev. We need to hook into the dev server creation,
- // nab the proper utils from the custom nitro instance that is used
- // during dev and supply the $fetch to app.
- // Hopefully and likely, this will just get removed when we move to
- // Nitro directly.
- vinxiApp.hooks.hook('app:dev:nitro:config', (devServer) => {
- vinxiApp.hooks.hook(
- 'app:dev:server:created',
- ({ devApp: { localFetch } }) => {
- const $fetch = createFetch({
- fetch: localFetch,
- defaults: {
- baseURL: devServer.nitro.options.runtimeConfig.app.baseURL,
- },
- })
-
- // @ts-expect-error
- globalThis.$fetch = $fetch
- },
- )
- })
-
- return vinxiApp
-}
-
-function importToProjectRelative(p: string) {
- const resolved = fileURLToPath(resolve(p, import.meta.url))
-
- const relative = path.relative(process.cwd(), resolved)
-
- return relative
-}
-
-function tsrRoutesManifest(opts: {
- tsrConfig: z.infer
- clientBase: string
-}): vite.Plugin {
- let config: vite.ResolvedConfig
-
- return {
- name: 'tsr-routes-manifest',
- configResolved(resolvedConfig) {
- config = resolvedConfig
- },
- resolveId(id) {
- if (id === 'tsr:routes-manifest') {
- return id
- }
- return
- },
- async load(id) {
- if (id === 'tsr:routes-manifest') {
- // If we're in development, return a dummy manifest
-
- if (config.command === 'serve') {
- return `export default () => ({
- routes: {}
- })`
- }
-
- const clientViteManifestPath = path.resolve(
- config.build.outDir,
- `../client/${opts.clientBase}/.vite/manifest.json`,
- )
-
- type ViteManifest = Record<
- string,
- {
- file: string
- isEntry: boolean
- imports: Array
- }
- >
-
- let manifest: ViteManifest
- try {
- manifest = JSON.parse(await readFile(clientViteManifestPath, 'utf-8'))
- } catch (err) {
- console.error(err)
- throw new Error(
- `Could not find the production client vite manifest at '${clientViteManifestPath}'!`,
- )
- }
-
- const routeTreePath = path.resolve(opts.tsrConfig.generatedRouteTree)
-
- let routeTreeContent: string
- try {
- routeTreeContent = readFileSync(routeTreePath, 'utf-8')
- } catch (err) {
- console.error(err)
- throw new Error(
- `Could not find the generated route tree at '${routeTreePath}'!`,
- )
- }
-
- // Extract the routesManifest JSON from the route tree file.
- // It's located between the /* ROUTE_MANIFEST_START and ROUTE_MANIFEST_END */ comment block.
-
- const routerManifest = JSON.parse(
- routeTreeContent.match(
- /\/\* ROUTE_MANIFEST_START([\s\S]*?)ROUTE_MANIFEST_END \*\//,
- )?.[1] || '{ routes: {} }',
- ) as Manifest
-
- const routes = routerManifest.routes
-
- let entryFile:
- | {
- file: string
- imports: Array
- }
- | undefined
-
- const filesByRouteFilePath: ViteManifest = Object.fromEntries(
- Object.entries(manifest).map(([k, v]) => {
- if (v.isEntry) {
- entryFile = v
- }
-
- const rPath = k.split('?')[0]
-
- return [rPath, v]
- }, {}),
- )
-
- // Add preloads to the routes from the vite manifest
- Object.entries(routes).forEach(([k, v]) => {
- const file =
- filesByRouteFilePath[
- path.join(opts.tsrConfig.routesDirectory, v.filePath as string)
- ]
-
- if (file) {
- const preloads = file.imports.map((d) =>
- path.join(opts.clientBase, manifest[d]!.file),
- )
-
- preloads.unshift(path.join(opts.clientBase, file.file))
-
- routes[k] = {
- ...v,
- preloads,
- }
- }
- })
-
- if (entryFile) {
- routes.__root__!.preloads = [
- path.join(opts.clientBase, entryFile.file),
- ...entryFile.imports.map((d) =>
- path.join(opts.clientBase, manifest[d]!.file),
- ),
- ]
- }
-
- const recurseRoute = (
- route: {
- preloads?: Array
- children?: Array
- },
- seenPreloads = {} as Record,
- ) => {
- route.preloads = route.preloads?.filter((preload) => {
- if (seenPreloads[preload]) {
- return false
- }
- seenPreloads[preload] = true
- return true
- })
-
- if (route.children) {
- route.children.forEach((child) => {
- const childRoute = routes[child]!
- recurseRoute(childRoute, { ...seenPreloads })
- })
- }
- }
-
- // @ts-expect-error
- recurseRoute(routes.__root__)
-
- const routesManifest = {
- routes,
- }
-
- if (process.env.TSR_VITE_DEBUG) {
- console.info(
- 'Routes Manifest: \n' + JSON.stringify(routesManifest, null, 2),
- )
- }
-
- return `export default () => (${JSON.stringify(routesManifest)})`
- }
- return
- },
- }
-}
-
-function injectDefineEnv(
- key: TKey,
- value: TValue,
-): { [P in `process.env.${TKey}` | `import.meta.env.${TKey}`]: TValue } {
- return {
- [`process.env.${key}`]: JSON.stringify(value),
- [`import.meta.env.${key}`]: JSON.stringify(value),
- } as { [P in `process.env.${TKey}` | `import.meta.env.${TKey}`]: TValue }
-}
diff --git a/packages/react-start-config/src/schema.ts b/packages/react-start-config/src/schema.ts
deleted file mode 100644
index e0882a17d4..0000000000
--- a/packages/react-start-config/src/schema.ts
+++ /dev/null
@@ -1,145 +0,0 @@
-import path from 'node:path'
-import { existsSync } from 'node:fs'
-import { z } from 'zod'
-import { configSchema, getConfig } from '@tanstack/router-generator'
-import type { UserConfig } from 'vite'
-import type { NitroConfig } from 'nitropack'
-import type { Options as ViteReactOptions } from '@vitejs/plugin-react'
-
-type HTTPSOptions = {
- cert?: string
- key?: string
- pfx?: string
- passphrase?: string
- validityDays?: number
- domains?: Array
-}
-
-type ServerOptions = NitroConfig & {
- https?: boolean | HTTPSOptions
-}
-
-export const serverSchema = z.custom().and(
- z.object({
- preset: z
- .custom()
- .optional()
- .default('node-server'),
- }),
-)
-
-const viteSchema = z.custom()
-
-const viteReactSchema = z.custom()
-
-const routersSchema = z.object({
- ssr: z
- .object({
- entry: z.string().optional().default('ssr.tsx'),
- // middleware: z.string().optional(),
- vite: viteSchema.optional(),
- })
- .optional()
- .default({}),
- client: z
- .object({
- entry: z.string().optional().default('client.tsx'),
- base: z.string().optional().default('/_build'),
- vite: viteSchema.optional(),
- })
- .optional()
- .default({}),
- server: z
- .object({
- base: z.string().optional().default('/_server'),
- globalMiddlewareEntry: z
- .string()
- .optional()
- .default('global-middleware.ts'),
- // middleware: z.string().optional(),
- vite: viteSchema.optional(),
- })
- .optional()
- .default({}),
- api: z
- .object({
- base: z.string().optional().default('/api'),
- entry: z.string().optional().default('api.ts'),
- // middleware: z.string().optional(),
- vite: viteSchema.optional(),
- })
- .optional()
- .default({}),
- public: z
- .object({
- dir: z.string().optional().default('public'),
- base: z.string().optional().default('/'),
- })
- .optional()
- .default({}),
-})
-
-const sitemapSchema = z.object({
- host: z.string(),
-})
-
-const tsrConfig = configSchema.partial().extend({
- // Normally these are `./src/___`, but we're using `./app/___` for Start stuff
- appDirectory: z.string().optional().default('app'),
-})
-
-const TanStackStartOptionsSchema = z
- .object({
- root: z.string().optional().default(process.cwd()),
- react: viteReactSchema.optional(),
- vite: viteSchema.optional(),
- tsr: tsrConfig.optional().default({}),
- routers: routersSchema.optional().default({}),
- server: serverSchema.optional().default({}),
- sitemap: sitemapSchema.optional(),
- })
- .optional()
- .default({})
-
-export function getTanStackStartOptions(opts?: TanStackStartInputConfig) {
- const options = TanStackStartOptionsSchema.parse(opts)
-
- const appDirectory = options.tsr.appDirectory
- const routesDirectory =
- options.tsr.routesDirectory ?? path.join(appDirectory, 'routes')
- const generatedRouteTree =
- options.tsr.generatedRouteTree ??
- path.join(appDirectory, 'routeTree.gen.ts')
- const clientEntryPath = path.join(appDirectory, options.routers.client.entry)
- const ssrEntryPath = path.join(appDirectory, options.routers.ssr.entry)
- const apiEntryPath = path.join(appDirectory, options.routers.api.entry)
- const globalMiddlewareEntryPath = path.join(
- appDirectory,
- options.routers.server.globalMiddlewareEntry,
- )
- const hasApiEntry = existsSync(apiEntryPath)
-
- return {
- ...options,
- tsr: {
- ...options.tsr,
- ...getConfig({
- ...options.tsr,
- routesDirectory,
- generatedRouteTree,
- }),
- },
- clientEntryPath,
- ssrEntryPath,
- apiEntryPath,
- globalMiddlewareEntryPath,
- hasApiEntry,
- }
-}
-
-export type TanStackStartInputConfig = z.input<
- typeof TanStackStartOptionsSchema
->
-export type TanStackStartOutputConfig = ReturnType<
- typeof getTanStackStartOptions
->
diff --git a/packages/react-start-config/src/vinxi-file-router.ts b/packages/react-start-config/src/vinxi-file-router.ts
deleted file mode 100644
index a60d71585c..0000000000
--- a/packages/react-start-config/src/vinxi-file-router.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
-// @ts-nocheck
-
-import {
- BaseFileSystemRouter as VinxiBaseFileSystemRouter,
- analyzeModule as vinxiFsRouterAnalyzeModule,
- cleanPath as vinxiFsRouterCleanPath,
-} from 'vinxi/fs-router'
-import {
- CONSTANTS as GENERATOR_CONSTANTS,
- startAPIRouteSegmentsFromTSRFilePath,
-} from '@tanstack/router-generator'
-import type { configSchema } from '@tanstack/router-generator'
-import type {
- AppOptions as VinxiAppOptions,
- RouterSchemaInput as VinxiRouterSchemaInput,
-} from 'vinxi'
-import type { z } from 'zod'
-
-export function tanstackStartVinxiFileRouter(opts: {
- tsrConfig: z.infer
- apiBase: string
-}) {
- const apiBaseSegment = opts.apiBase.split('/').filter(Boolean).join('/')
- const isAPIPath = new RegExp(`/${apiBaseSegment}/`)
-
- return function (router: VinxiRouterSchemaInput, app: VinxiAppOptions) {
- // Our own custom File Router that extends the VinxiBaseFileSystemRouter
- // for splitting the API routes into its own "bundle"
- // and adding the $APIRoute metadata to the route object
- // This could be customized in future to support more complex splits
- class TanStackStartFsRouter extends VinxiBaseFileSystemRouter {
- toPath(src: string): string {
- const inputPath = vinxiFsRouterCleanPath(src, this.config)
-
- const segments = startAPIRouteSegmentsFromTSRFilePath(
- inputPath,
- opts.tsrConfig,
- )
-
- const pathname = segments
- .map((part) => {
- if (part.type === 'splat') {
- return `*splat`
- }
-
- if (part.type === 'param') {
- return `:${part.value}?`
- }
-
- return part.value
- })
- .join('/')
-
- return pathname.length > 0 ? `/${pathname}` : '/'
- }
-
- toRoute(src: string) {
- const webPath = this.toPath(src)
-
- const [_, exports] = vinxiFsRouterAnalyzeModule(src)
-
- const hasAPIRoute = exports.find(
- (exp) => exp.n === GENERATOR_CONSTANTS.APIRouteExportVariable,
- )
-
- return {
- path: webPath,
- filePath: src,
- $APIRoute:
- isAPIPath.test(webPath) && hasAPIRoute
- ? {
- src,
- pick: [GENERATOR_CONSTANTS.APIRouteExportVariable],
- }
- : undefined,
- }
- }
- }
-
- return new TanStackStartFsRouter(
- {
- dir: opts.tsrConfig.routesDirectory,
- extensions: ['js', 'jsx', 'ts', 'tsx'],
- },
- router,
- app,
- )
- }
-}
diff --git a/packages/react-start-config/tsconfig.json b/packages/react-start-config/tsconfig.json
deleted file mode 100644
index 940a9cce0a..0000000000
--- a/packages/react-start-config/tsconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extends": "../../tsconfig.json",
- "include": ["src/index.ts"],
- "compilerOptions": {
- "rootDir": "src",
- "outDir": "dist/esm",
- "target": "esnext",
- "noEmit": false
- }
-}
diff --git a/packages/react-start/src/config.tsx b/packages/react-start/src/config.tsx
deleted file mode 100644
index 57a7ae394d..0000000000
--- a/packages/react-start/src/config.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export * from '@tanstack/react-start-config'
diff --git a/packages/react-start/vite.config.ts b/packages/react-start/vite.config.ts
index cf9244f281..dd8d715d1d 100644
--- a/packages/react-start/vite.config.ts
+++ b/packages/react-start/vite.config.ts
@@ -17,7 +17,6 @@ export default mergeConfig(
entry: [
'./src/client.tsx',
'./src/server.tsx',
- './src/config.tsx',
'./src/router-manifest.tsx',
'./src/server-functions-client.tsx',
'./src/server-functions-server.tsx',
@@ -27,7 +26,6 @@ export default mergeConfig(
externalDeps: [
'@tanstack/react-start-client',
'@tanstack/react-start-server',
- '@tanstack/react-start-config',
'@tanstack/react-start-router-manifest',
'@tanstack/react-start-server-functions-client',
'@tanstack/start-server-functions-server',
From b4dd06ca1d2014b5a6faaaf28cb722364691f79c Mon Sep 17 00:00:00 2001
From: Manuel Schiller
Date: Wed, 26 Feb 2025 00:18:53 +0100
Subject: [PATCH 008/155] remove vinxi-file-router
---
.../src/vinxi-file-router.ts | 87 -------------------
1 file changed, 87 deletions(-)
delete mode 100644 packages/react-start-plugin/src/vinxi-file-router.ts
diff --git a/packages/react-start-plugin/src/vinxi-file-router.ts b/packages/react-start-plugin/src/vinxi-file-router.ts
deleted file mode 100644
index 9e6d829d1b..0000000000
--- a/packages/react-start-plugin/src/vinxi-file-router.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-import {
- BaseFileSystemRouter as VinxiBaseFileSystemRouter,
- analyzeModule as vinxiFsRouterAnalyzeModule,
- cleanPath as vinxiFsRouterCleanPath,
-} from 'vinxi/fs-router'
-import {
- CONSTANTS as GENERATOR_CONSTANTS,
- startAPIRouteSegmentsFromTSRFilePath,
-} from '@tanstack/router-generator'
-import type { configSchema } from '@tanstack/router-generator'
-import type {
- AppOptions as VinxiAppOptions,
- RouterSchemaInput as VinxiRouterSchemaInput,
-} from 'vinxi'
-import type { z } from 'zod'
-
-export function tanstackStartVinxiFileRouter(opts: {
- tsrConfig: z.infer
- apiBase: string
-}) {
- const apiBaseSegment = opts.apiBase.split('/').filter(Boolean).join('/')
- const isAPIPath = new RegExp(`/${apiBaseSegment}/`)
-
- return function (router: VinxiRouterSchemaInput, app: VinxiAppOptions) {
- // Our own custom File Router that extends the VinxiBaseFileSystemRouter
- // for splitting the API routes into its own "bundle"
- // and adding the $APIRoute metadata to the route object
- // This could be customized in future to support more complex splits
- class TanStackStartFsRouter extends VinxiBaseFileSystemRouter {
- toPath(src: string): string {
- const inputPath = vinxiFsRouterCleanPath(src, this.config)
-
- const segments = startAPIRouteSegmentsFromTSRFilePath(
- inputPath,
- opts.tsrConfig,
- )
-
- const pathname = segments
- .map((part) => {
- if (part.type === 'splat') {
- return `*splat`
- }
-
- if (part.type === 'param') {
- return `:${part.value}?`
- }
-
- return part.value
- })
- .join('/')
-
- return pathname.length > 0 ? `/${pathname}` : '/'
- }
-
- toRoute(src: string) {
- const webPath = this.toPath(src)
-
- const [_, exports] = vinxiFsRouterAnalyzeModule(src)
-
- const hasAPIRoute = exports.find(
- (exp) => exp.n === GENERATOR_CONSTANTS.APIRouteExportVariable,
- )
-
- return {
- path: webPath,
- filePath: src,
- $APIRoute:
- isAPIPath.test(webPath) && hasAPIRoute
- ? {
- src,
- pick: [GENERATOR_CONSTANTS.APIRouteExportVariable],
- }
- : undefined,
- }
- }
- }
-
- return new TanStackStartFsRouter(
- {
- dir: opts.tsrConfig.routesDirectory,
- extensions: ['js', 'jsx', 'ts', 'tsx'],
- },
- router,
- app,
- )
- }
-}
From 441b36e2942659bbba627d6305a2f145f2c27bc7 Mon Sep 17 00:00:00 2001
From: Manuel Schiller
Date: Wed, 26 Feb 2025 00:27:58 +0100
Subject: [PATCH 009/155] fix package name
---
packages/react-start-plugin/package.json | 7 +-----
packages/react-start/package.json | 1 -
pnpm-lock.yaml | 27 ++++++++----------------
3 files changed, 10 insertions(+), 25 deletions(-)
diff --git a/packages/react-start-plugin/package.json b/packages/react-start-plugin/package.json
index d932328a1c..87f20c1e47 100644
--- a/packages/react-start-plugin/package.json
+++ b/packages/react-start-plugin/package.json
@@ -7,7 +7,7 @@
"repository": {
"type": "git",
"url": "https://github.com/TanStack/router.git",
- "directory": "packages/react-start-plugin"
+ "directory": "packages/start-plugin"
},
"homepage": "https://tanstack.com/start",
"funding": {
@@ -77,11 +77,6 @@
"@tanstack/router-plugin": "workspace:^",
"@tanstack/router-utils": "workspace:^",
"@tanstack/server-functions-plugin": "workspace:^",
- "babel-dead-code-elimination": "^1.0.9",
- "tiny-invariant": "^1.3.3",
- "vite": "6.1.0"
- },
- "devDependencies": {
"@types/babel__code-frame": "^7.0.6",
"@types/babel__core": "^7.20.5",
"@types/babel__template": "^7.4.4",
diff --git a/packages/react-start/package.json b/packages/react-start/package.json
index ae6242d1c7..e9e977cebe 100644
--- a/packages/react-start/package.json
+++ b/packages/react-start/package.json
@@ -145,7 +145,6 @@
"dependencies": {
"@tanstack/react-start-client": "workspace:^",
"@tanstack/react-start-server": "workspace:^",
- "@tanstack/react-start-config": "workspace:^",
"@tanstack/react-start-router-manifest": "workspace:^",
"@tanstack/react-start-server-functions-client": "workspace:^",
"@tanstack/start-server-functions-server": "workspace:^",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 5e6cf54032..c0d1263b2c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -5765,9 +5765,6 @@ importers:
'@tanstack/react-start-client':
specifier: workspace:*
version: link:../react-start-client
- '@tanstack/react-start-config':
- specifier: workspace:^
- version: link:../react-start-config
'@tanstack/react-start-router-manifest':
specifier: workspace:*
version: link:../react-start-router-manifest
@@ -5942,16 +5939,6 @@ importers:
'@tanstack/server-functions-plugin':
specifier: workspace:*
version: link:../server-functions-plugin
- babel-dead-code-elimination:
- specifier: ^1.0.9
- version: 1.0.9
- tiny-invariant:
- specifier: ^1.3.3
- version: 1.3.3
- vite:
- specifier: 6.1.0
- version: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
- devDependencies:
'@types/babel__code-frame':
specifier: ^7.0.6
version: 7.0.6
@@ -5967,6 +5954,9 @@ importers:
'@vitejs/plugin-react':
specifier: ^4.3.4
version: 4.3.4(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
+ babel-dead-code-elimination:
+ specifier: ^1.0.9
+ version: 1.0.9
fast-glob:
specifier: ^3.3.3
version: 3.3.3
@@ -5976,6 +5966,12 @@ importers:
nitropack:
specifier: ^2.10.4
version: 2.10.4(typescript@5.7.3)
+ tiny-invariant:
+ specifier: ^1.3.3
+ version: 1.3.3
+ vite:
+ specifier: 6.1.0
+ version: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
xmlbuilder2:
specifier: ^3.1.1
version: 3.1.1
@@ -12130,9 +12126,6 @@ packages:
engines: {node: '>=8'}
hasBin: true
- import-meta-resolve@4.1.0:
- resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==}
-
imurmurhash@0.1.4:
resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
engines: {node: '>=0.8.19'}
@@ -20837,8 +20830,6 @@ snapshots:
pkg-dir: 4.2.0
resolve-cwd: 3.0.0
- import-meta-resolve@4.1.0: {}
-
imurmurhash@0.1.4: {}
indent-string@4.0.0: {}
From 69d8d963a65427cb292f88f918e4501225c3a758 Mon Sep 17 00:00:00 2001
From: Manuel Schiller
Date: Wed, 26 Feb 2025 00:34:58 +0100
Subject: [PATCH 010/155] fix merge, format
---
packages/react-start-plugin/src/config.ts | 665 ------------------
.../react-start-plugin/src/nitro/options.ts | 46 +-
.../src/nitro/utils/load-esm.ts | 4 +-
.../src/nitro/vite-plugin-nitro.ts | 3 -
packages/react-start-plugin/src/schema.ts | 249 +++----
5 files changed, 125 insertions(+), 842 deletions(-)
delete mode 100644 packages/react-start-plugin/src/config.ts
diff --git a/packages/react-start-plugin/src/config.ts b/packages/react-start-plugin/src/config.ts
deleted file mode 100644
index f2d1d06d1a..0000000000
--- a/packages/react-start-plugin/src/config.ts
+++ /dev/null
@@ -1,665 +0,0 @@
-import path from 'node:path'
-import { existsSync, readFileSync } from 'node:fs'
-import { readFile } from 'node:fs/promises'
-import { fileURLToPath } from 'node:url'
-import viteReact from '@vitejs/plugin-react'
-import { resolve } from 'import-meta-resolve'
-import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
-import { getConfig } from '@tanstack/router-generator'
-import { createApp } from 'vinxi'
-import { config } from 'vinxi/plugins/config'
-// // @ts-expect-error
-// import { serverComponents } from '@vinxi/server-components/plugin'
-import { createTanStackServerFnPlugin } from '@tanstack/server-functions-plugin'
-import { createTanStackStartPlugin } from '@tanstack/react-start-plugin'
-import { createFetch } from 'ofetch'
-import { createNitro } from 'nitropack'
-import { tanstackStartVinxiFileRouter } from './vinxi-file-router.js'
-import {
- checkDeploymentPresetInput,
- getUserViteConfig,
- inlineConfigSchema,
- serverSchema,
-} from './schema.js'
-import type { configSchema } from '@tanstack/router-generator'
-import type { z } from 'zod'
-import type {
- TanStackStartInputConfig,
- TanStackStartOutputConfig,
-} from './schema.js'
-import type { App as VinxiApp } from 'vinxi'
-import type { Manifest } from '@tanstack/react-router'
-import type * as vite from 'vite'
-
-export type {
- TanStackStartInputConfig,
- TanStackStartOutputConfig,
-} from './schema.js'
-
-function setTsrDefaults(config: TanStackStartOutputConfig['tsr']) {
- // Normally these are `./src/___`, but we're using `./app/___` for Start stuff
- const appDirectory = config?.appDirectory ?? './app'
- return {
- ...config,
- appDirectory: config?.appDirectory ?? appDirectory,
- routesDirectory:
- config?.routesDirectory ?? path.join(appDirectory, 'routes'),
- generatedRouteTree:
- config?.generatedRouteTree ?? path.join(appDirectory, 'routeTree.gen.ts'),
- }
-}
-
-function mergeSsrOptions(options: Array) {
- let ssrOptions: vite.SSROptions = {}
- let noExternal: vite.SSROptions['noExternal'] = []
- for (const option of options) {
- if (!option) {
- continue
- }
-
- if (option.noExternal) {
- if (option.noExternal === true) {
- noExternal = true
- } else if (noExternal !== true) {
- if (Array.isArray(option.noExternal)) {
- noExternal.push(...option.noExternal)
- } else {
- noExternal.push(option.noExternal)
- }
- }
- }
-
- ssrOptions = {
- ...ssrOptions,
- ...option,
- noExternal,
- }
- }
-
- return ssrOptions
-}
-
-export async function defineConfig(
- inlineConfig: TanStackStartInputConfig = {},
-): Promise {
- const opts = inlineConfigSchema.parse(inlineConfig)
-
- const { preset: configDeploymentPreset, ...serverOptions } =
- serverSchema.parse(opts.server || {})
-
- const deploymentPreset = checkDeploymentPresetInput(
- configDeploymentPreset || 'node-server',
- )
- const tsr = setTsrDefaults(opts.tsr)
- const tsrConfig = getConfig(tsr)
-
- const appDirectory = tsr.appDirectory
- const publicDir = opts.routers?.public?.dir || './public'
-
- const publicBase = opts.routers?.public?.base || '/'
- const clientBase = opts.routers?.client?.base || '/_build'
- const apiBase = opts.tsr?.apiBase || '/api'
- const serverBase = opts.routers?.server?.base || '/_server'
-
- const apiMiddleware = opts.routers?.api?.middleware || undefined
- const serverMiddleware = opts.routers?.server?.middleware || undefined
- const ssrMiddleware = opts.routers?.ssr?.middleware || undefined
-
- const clientEntry =
- opts.routers?.client?.entry || path.join(appDirectory, 'client.tsx')
- const ssrEntry =
- opts.routers?.ssr?.entry || path.join(appDirectory, 'ssr.tsx')
- const apiEntry = opts.routers?.api?.entry || path.join(appDirectory, 'api.ts')
- const globalMiddlewareEntry =
- opts.routers?.server?.globalMiddlewareEntry ||
- path.join(appDirectory, 'global-middleware.ts')
- const apiEntryExists = existsSync(apiEntry)
-
- const viteConfig = getUserViteConfig(opts.vite)
-
- const TanStackServerFnsPlugin = createTanStackServerFnPlugin({
- // This is the ID that will be available to look up and import
- // our server function manifest and resolve its module
- manifestVirtualImportId: 'tsr:server-fn-manifest',
- client: {
- getRuntimeCode: () =>
- `import { createClientRpc } from '@tanstack/start/server-functions-client'`,
- replacer: (opts) =>
- `createClientRpc('${opts.functionId}', '${serverBase}')`,
- },
- ssr: {
- getRuntimeCode: () =>
- `import { createSsrRpc } from '@tanstack/start/server-functions-ssr'`,
- replacer: (opts) => `createSsrRpc('${opts.functionId}', '${serverBase}')`,
- },
- server: {
- getRuntimeCode: () =>
- `import { createServerRpc } from '@tanstack/start/server-functions-server'`,
- replacer: (opts) =>
- `createServerRpc('${opts.functionId}', '${serverBase}', ${opts.fn})`,
- },
- })
-
- const TanStackStartPlugin = createTanStackStartPlugin({
- globalMiddlewareEntry,
- })
-
- // Create a dummy nitro app to get the resolved public output path
- const dummyNitroApp = await createNitro({
- preset: deploymentPreset,
- compatibilityDate: '2024-12-01',
- })
-
- const nitroOutputPublicDir = dummyNitroApp.options.output.publicDir
- await dummyNitroApp.close()
-
- let vinxiApp = createApp({
- server: {
- ...serverOptions,
- preset: deploymentPreset,
- experimental: {
- ...serverOptions.experimental,
- asyncContext: true,
- },
- },
- routers: [
- {
- name: 'public',
- type: 'static',
- dir: publicDir,
- base: publicBase,
- },
- {
- name: 'client',
- type: 'client',
- target: 'browser',
- handler: clientEntry,
- base: clientBase,
- // @ts-expect-error
- build: {
- sourcemap: true,
- },
- plugins: () => {
- const routerType = 'client'
- const clientViteConfig = getUserViteConfig(
- opts.routers?.[routerType]?.vite,
- )
-
- return [
- config('tss-vite-config-client', {
- ...viteConfig.userConfig,
- ...clientViteConfig.userConfig,
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(clientViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv(
- 'TSS_OUTPUT_PUBLIC_DIR',
- nitroOutputPublicDir,
- ),
- },
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- clientViteConfig.userConfig.ssr,
- {
- noExternal,
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(clientViteConfig.userConfig.optimizeDeps || {}),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- enableRouteGeneration: true,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- TanStackStartPlugin.client,
- TanStackServerFnsPlugin.client,
- ...(viteConfig.plugins || []),
- ...(clientViteConfig.plugins || []),
- viteReact(opts.react),
- // TODO: RSCS - enable this
- // serverComponents.client(),
- ]
- },
- },
- {
- name: 'ssr',
- type: 'http',
- target: 'server',
- handler: ssrEntry,
- middleware: ssrMiddleware,
- // @ts-expect-error
- link: {
- client: 'client',
- },
- plugins: () => {
- const routerType = 'ssr'
- const ssrViteConfig = getUserViteConfig(
- opts.routers?.[routerType]?.vite,
- )
-
- return [
- config('tss-vite-config-ssr', {
- ...viteConfig.userConfig,
- ...ssrViteConfig.userConfig,
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(ssrViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv(
- 'TSS_OUTPUT_PUBLIC_DIR',
- nitroOutputPublicDir,
- ),
- },
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- ssrViteConfig.userConfig.ssr,
- {
- noExternal,
- external: ['@vinxi/react-server-dom/client'],
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(ssrViteConfig.userConfig.optimizeDeps || {}),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- enableRouteGeneration: false,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- TanStackStartPlugin.ssr,
- TanStackServerFnsPlugin.ssr,
- tsrRoutesManifest({
- tsrConfig,
- clientBase,
- }),
- ...(getUserViteConfig(opts.vite).plugins || []),
- ...(getUserViteConfig(opts.routers?.ssr?.vite).plugins || []),
- viteReact(opts.react),
- ]
- },
- },
- {
- name: 'server',
- type: 'http',
- target: 'server',
- base: serverBase,
- middleware: serverMiddleware,
- // TODO: RSCS - enable this
- // worker: true,
- handler: importToProjectRelative(
- '@tanstack/react-start-server-functions-handler',
- ),
- plugins: () => {
- const routerType = 'server'
- const serverViteConfig = getUserViteConfig(
- opts.routers?.[routerType]?.vite,
- )
-
- return [
- config('tss-vite-config-server', {
- ...viteConfig.userConfig,
- ...serverViteConfig.userConfig,
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(serverViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv('TSS_SERVER_FN_BASE', serverBase),
- ...injectDefineEnv(
- 'TSS_OUTPUT_PUBLIC_DIR',
- nitroOutputPublicDir,
- ),
- },
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- serverViteConfig.userConfig.ssr,
- {
- noExternal,
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(serverViteConfig.userConfig.optimizeDeps || {}),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- enableRouteGeneration: false,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- TanStackStartPlugin.server,
- TanStackServerFnsPlugin.server,
- // TODO: RSCS - remove this
- // resolve: {
- // conditions: [],
- // },
- // TODO: RSCs - add this
- // serverComponents.serverActions({
- // resolve: {
- // conditions: [
- // 'react-server',
- // // 'node',
- // 'import',
- // process.env.NODE_ENV,
- // ],
- // },
- // runtime: '@vinxi/react-server-dom/runtime',
- // transpileDeps: ['react', 'react-dom', '@vinxi/react-server-dom'],
- // }),
- ...(viteConfig.plugins || []),
- ...(serverViteConfig.plugins || []),
- ]
- },
- },
- ],
- })
-
- const noExternal = [
- '@tanstack/start',
- '@tanstack/react-start',
- '@tanstack/react-start/server',
- '@tanstack/react-start-client',
- '@tanstack/react-start-server',
- '@tanstack/react-start-server-functions-fetcher',
- '@tanstack/react-start-server-functions-handler',
- '@tanstack/react-start-server-functions-client',
- '@tanstack/react-start-server-functions-ssr',
- '@tanstack/start-server-functions-server',
- '@tanstack/react-start-router-manifest',
- '@tanstack/start-config',
- '@tanstack/react-start-api-routes',
- '@tanstack/server-functions-plugin',
- 'tsr:routes-manifest',
- 'tsr:server-fn-manifest',
- ]
-
- // If API routes handler exists, add a router for it
- if (apiEntryExists) {
- vinxiApp = vinxiApp.addRouter({
- name: 'api',
- type: 'http',
- target: 'server',
- base: apiBase,
- handler: apiEntry,
- middleware: apiMiddleware,
- routes: tanstackStartVinxiFileRouter({ tsrConfig, apiBase }),
- plugins: () => {
- const viteConfig = getUserViteConfig(opts.vite)
- const apiViteConfig = getUserViteConfig(opts.routers?.api?.vite)
-
- return [
- config('tsr-vite-config-api', {
- ...viteConfig.userConfig,
- ...apiViteConfig.userConfig,
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- apiViteConfig.userConfig.ssr,
- {
- noExternal,
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(apiViteConfig.userConfig.optimizeDeps || {}),
- },
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(apiViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv('TSS_OUTPUT_PUBLIC_DIR', nitroOutputPublicDir),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- enableRouteGeneration: false,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- ...(viteConfig.plugins || []),
- ...(apiViteConfig.plugins || []),
- ]
- },
- })
- }
-
- // Because Vinxi doesn't use the normal nitro dev server, it doesn't
- // supply $fetch during dev. We need to hook into the dev server creation,
- // nab the proper utils from the custom nitro instance that is used
- // during dev and supply the $fetch to app.
- // Hopefully and likely, this will just get removed when we move to
- // Nitro directly.
- vinxiApp.hooks.hook('app:dev:nitro:config', (devServer) => {
- vinxiApp.hooks.hook(
- 'app:dev:server:created',
- ({ devApp: { localFetch } }) => {
- const $fetch = createFetch({
- fetch: localFetch,
- defaults: {
- baseURL: devServer.nitro.options.runtimeConfig.app.baseURL,
- },
- })
-
- // @ts-expect-error
- globalThis.$fetch = $fetch
- },
- )
- })
-
- return vinxiApp
-}
-
-function importToProjectRelative(p: string) {
- const resolved = fileURLToPath(resolve(p, import.meta.url))
-
- const relative = path.relative(process.cwd(), resolved)
-
- return relative
-}
-
-function tsrRoutesManifest(opts: {
- tsrConfig: z.infer
- clientBase: string
-}): vite.Plugin {
- let config: vite.ResolvedConfig
-
- return {
- name: 'tsr-routes-manifest',
- configResolved(resolvedConfig) {
- config = resolvedConfig
- },
- resolveId(id) {
- if (id === 'tsr:routes-manifest') {
- return id
- }
- return
- },
- async load(id) {
- if (id === 'tsr:routes-manifest') {
- // If we're in development, return a dummy manifest
-
- if (config.command === 'serve') {
- return `export default () => ({
- routes: {}
- })`
- }
-
- const clientViteManifestPath = path.resolve(
- config.build.outDir,
- `../client/${opts.clientBase}/.vite/manifest.json`,
- )
-
- type ViteManifest = Record<
- string,
- {
- file: string
- isEntry: boolean
- imports: Array
- }
- >
-
- let manifest: ViteManifest
- try {
- manifest = JSON.parse(await readFile(clientViteManifestPath, 'utf-8'))
- } catch (err) {
- console.error(err)
- throw new Error(
- `Could not find the production client vite manifest at '${clientViteManifestPath}'!`,
- )
- }
-
- const routeTreePath = path.resolve(opts.tsrConfig.generatedRouteTree)
-
- let routeTreeContent: string
- try {
- routeTreeContent = readFileSync(routeTreePath, 'utf-8')
- } catch (err) {
- console.error(err)
- throw new Error(
- `Could not find the generated route tree at '${routeTreePath}'!`,
- )
- }
-
- // Extract the routesManifest JSON from the route tree file.
- // It's located between the /* ROUTE_MANIFEST_START and ROUTE_MANIFEST_END */ comment block.
-
- const routerManifest = JSON.parse(
- routeTreeContent.match(
- /\/\* ROUTE_MANIFEST_START([\s\S]*?)ROUTE_MANIFEST_END \*\//,
- )?.[1] || '{ routes: {} }',
- ) as Manifest
-
- const routes = routerManifest.routes
-
- let entryFile:
- | {
- file: string
- imports: Array
- }
- | undefined
-
- const filesByRouteFilePath: ViteManifest = Object.fromEntries(
- Object.entries(manifest).map(([k, v]) => {
- if (v.isEntry) {
- entryFile = v
- }
-
- const rPath = k.split('?')[0]
-
- return [rPath, v]
- }, {}),
- )
-
- // Add preloads to the routes from the vite manifest
- Object.entries(routes).forEach(([k, v]) => {
- const file =
- filesByRouteFilePath[
- path.join(opts.tsrConfig.routesDirectory, v.filePath as string)
- ]
-
- if (file) {
- const preloads = file.imports.map((d) =>
- path.join(opts.clientBase, manifest[d]!.file),
- )
-
- preloads.unshift(path.join(opts.clientBase, file.file))
-
- routes[k] = {
- ...v,
- preloads,
- }
- }
- })
-
- if (entryFile) {
- routes.__root__!.preloads = [
- path.join(opts.clientBase, entryFile.file),
- ...entryFile.imports.map((d) =>
- path.join(opts.clientBase, manifest[d]!.file),
- ),
- ]
- }
-
- const recurseRoute = (
- route: {
- preloads?: Array
- children?: Array
- },
- seenPreloads = {} as Record,
- ) => {
- route.preloads = route.preloads?.filter((preload) => {
- if (seenPreloads[preload]) {
- return false
- }
- seenPreloads[preload] = true
- return true
- })
-
- if (route.children) {
- route.children.forEach((child) => {
- const childRoute = routes[child]!
- recurseRoute(childRoute, { ...seenPreloads })
- })
- }
- }
-
- // @ts-expect-error
- recurseRoute(routes.__root__)
-
- const routesManifest = {
- routes,
- }
-
- if (process.env.TSR_VITE_DEBUG) {
- console.info(
- 'Routes Manifest: \n' + JSON.stringify(routesManifest, null, 2),
- )
- }
-
- return `export default () => (${JSON.stringify(routesManifest)})`
- }
- return
- },
- }
-}
-
-function injectDefineEnv(
- key: TKey,
- value: TValue,
-): { [P in `process.env.${TKey}` | `import.meta.env.${TKey}`]: TValue } {
- return {
- [`process.env.${key}`]: JSON.stringify(value),
- [`import.meta.env.${key}`]: JSON.stringify(value),
- } as { [P in `process.env.${TKey}` | `import.meta.env.${TKey}`]: TValue }
-}
diff --git a/packages/react-start-plugin/src/nitro/options.ts b/packages/react-start-plugin/src/nitro/options.ts
index d250d3e2ec..c8c8a3d15f 100644
--- a/packages/react-start-plugin/src/nitro/options.ts
+++ b/packages/react-start-plugin/src/nitro/options.ts
@@ -1,53 +1,53 @@
-import { PrerenderRoute } from 'nitropack';
+import { PrerenderRoute } from 'nitropack'
export interface Options {
- ssr?: boolean;
- ssrBuildDir?: string;
+ ssr?: boolean
+ ssrBuildDir?: string
/**
* Prerender the static pages without producing the server output.
*/
- static?: boolean;
- prerender?: PrerenderOptions;
- entryServer?: string;
- index?: string;
- workspaceRoot?: string;
+ static?: boolean
+ prerender?: PrerenderOptions
+ entryServer?: string
+ index?: string
+ workspaceRoot?: string
/**
* Additional page paths to include
*/
- additionalPagesDirs?: string[];
+ additionalPagesDirs?: string[]
/**
* Additional API paths to include
*/
- additionalAPIDirs?: string[];
- apiPrefix?: string;
+ additionalAPIDirs?: string[]
+ apiPrefix?: string
/**
* Toggles internal API middleware.
* If disabled, a proxy request is used to route /api
* requests to / in the production server build.
*/
- useAPIMiddleware?: boolean;
+ useAPIMiddleware?: boolean
}
export interface PrerenderOptions {
/**
* Add additional routes to prerender through crawling page links.
*/
- discover?: boolean;
+ discover?: boolean
/**
* List of routes to prerender resolved statically or dynamically.
*/
routes?:
| (string | PrerenderContentDir)[]
- | (() => Promise<(string | PrerenderContentDir | undefined)[]>);
- sitemap?: SitemapConfig;
+ | (() => Promise<(string | PrerenderContentDir | undefined)[]>)
+ sitemap?: SitemapConfig
/** List of functions that run for each route after pre-rendering is complete. */
- postRenderingHooks?: ((routes: PrerenderRoute) => Promise)[];
+ postRenderingHooks?: ((routes: PrerenderRoute) => Promise)[]
}
export interface SitemapConfig {
- host: string;
+ host: string
}
export interface PrerenderContentDir {
@@ -55,14 +55,14 @@ export interface PrerenderContentDir {
* The directory where files should be grabbed from.
* @example `/src/contents/blog`
*/
- contentDir: string;
+ contentDir: string
/**
* Transform the matching content files path into a route.
* The function is called for each matching content file within the specified contentDir.
* @param file information of the matching file (`path`, `name`, `extension`, `attributes`)
* @returns a string with the route should be returned (e. g. `/blog/`) or the value `false`, when the route should not be prerendered.
*/
- transform: (file: PrerenderContentFile) => string | false;
+ transform: (file: PrerenderContentFile) => string | false
}
/**
@@ -73,8 +73,8 @@ export interface PrerenderContentDir {
* @returns a string with the route should be returned (e. g. `/blog/`) or the value `false`, when the route should not be prerendered.
*/
export interface PrerenderContentFile {
- path: string;
- attributes: Record;
- name: string;
- extension: string;
+ path: string
+ attributes: Record
+ name: string
+ extension: string
}
diff --git a/packages/react-start-plugin/src/nitro/utils/load-esm.ts b/packages/react-start-plugin/src/nitro/utils/load-esm.ts
index f9a76f683e..78e8049184 100644
--- a/packages/react-start-plugin/src/nitro/utils/load-esm.ts
+++ b/packages/react-start-plugin/src/nitro/utils/load-esm.ts
@@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/
-import { URL } from 'node:url';
+import { URL } from 'node:url'
/**
* This uses a dynamic import to load a module which may be ESM.
@@ -23,5 +23,5 @@ import { URL } from 'node:url';
export function loadEsmModule(modulePath: string | URL): Promise {
return new Function('modulePath', `return import(modulePath);`)(
modulePath,
- ) as Promise;
+ ) as Promise
}
diff --git a/packages/react-start-plugin/src/nitro/vite-plugin-nitro.ts b/packages/react-start-plugin/src/nitro/vite-plugin-nitro.ts
index b28b04f643..e69de29bb2 100644
--- a/packages/react-start-plugin/src/nitro/vite-plugin-nitro.ts
+++ b/packages/react-start-plugin/src/nitro/vite-plugin-nitro.ts
@@ -1,3 +0,0 @@
-
-
-
diff --git a/packages/react-start-plugin/src/schema.ts b/packages/react-start-plugin/src/schema.ts
index 516e4e86fa..e0882a17d4 100644
--- a/packages/react-start-plugin/src/schema.ts
+++ b/packages/react-start-plugin/src/schema.ts
@@ -1,102 +1,10 @@
-import { configSchema } from '@tanstack/router-generator'
+import path from 'node:path'
+import { existsSync } from 'node:fs'
import { z } from 'zod'
-import type { PluginOption } from 'vite'
-import type { AppOptions as VinxiAppOptions } from 'vinxi'
-import type { NitroOptions } from 'nitropack'
+import { configSchema, getConfig } from '@tanstack/router-generator'
+import type { UserConfig } from 'vite'
+import type { NitroConfig } from 'nitropack'
import type { Options as ViteReactOptions } from '@vitejs/plugin-react'
-import type { CustomizableConfig } from 'vinxi/dist/types/lib/vite-dev'
-
-type StartUserViteConfig = CustomizableConfig | (() => CustomizableConfig)
-
-export function getUserViteConfig(config?: StartUserViteConfig): {
- plugins: Array | undefined
- userConfig: CustomizableConfig
-} {
- const { plugins, ...userConfig } =
- typeof config === 'function' ? config() : { ...config }
- return { plugins, userConfig }
-}
-
-/**
- * Not all the deployment presets are fully functional or tested.
- * @see https://github.com/TanStack/router/pull/2002
- */
-const vinxiDeploymentPresets = [
- 'alwaysdata', // untested
- 'aws-amplify', // untested
- 'aws-lambda', // untested
- 'azure', // untested
- 'azure-functions', // untested
- 'base-worker', // untested
- 'bun', // ✅ working
- 'cleavr', // untested
- 'cli', // untested
- 'cloudflare', // untested
- 'cloudflare-module', // untested
- 'cloudflare-pages', // ✅ working
- 'cloudflare-pages-static', // untested
- 'deno', // untested
- 'deno-deploy', // untested
- 'deno-server', // untested
- 'digital-ocean', // untested
- 'edgio', // untested
- 'firebase', // untested
- 'flight-control', // untested
- 'github-pages', // untested
- 'heroku', // untested
- 'iis', // untested
- 'iis-handler', // untested
- 'iis-node', // untested
- 'koyeb', // untested
- 'layer0', // untested
- 'netlify', // ✅ working
- 'netlify-builder', // untested
- 'netlify-edge', // untested
- 'netlify-static', // untested
- 'nitro-dev', // untested
- 'nitro-prerender', // untested
- 'node', // partially working
- 'node-cluster', // untested
- 'node-server', // ✅ working
- 'platform-sh', // untested
- 'service-worker', // untested
- 'static', // 🟧 partially working
- 'stormkit', // untested
- 'vercel', // ✅ working
- 'vercel-edge', // untested
- 'vercel-static', // untested
- 'winterjs', // untested
- 'zeabur', // untested
- 'zeabur-static', // untested
-] as const
-
-type DeploymentPreset = (typeof vinxiDeploymentPresets)[number] | (string & {})
-
-const testedDeploymentPresets: Array = [
- 'bun',
- 'netlify',
- 'vercel',
- 'cloudflare-pages',
- 'node-server',
-]
-
-export function checkDeploymentPresetInput(preset: string): DeploymentPreset {
- if (!vinxiDeploymentPresets.includes(preset as any)) {
- console.warn(
- `Invalid deployment preset "${preset}". Available presets are: ${vinxiDeploymentPresets
- .map((p) => `"${p}"`)
- .join(', ')}.`,
- )
- }
-
- if (!testedDeploymentPresets.includes(preset as any)) {
- console.warn(
- `The deployment preset '${preset}' is not fully supported yet and may not work as expected.`,
- )
- }
-
- return preset
-}
type HTTPSOptions = {
cert?: string
@@ -107,88 +15,131 @@ type HTTPSOptions = {
domains?: Array
}
-type ServerOptions_ = VinxiAppOptions['server'] & {
+type ServerOptions = NitroConfig & {
https?: boolean | HTTPSOptions
}
-type ServerOptions = {
- [K in keyof ServerOptions_]: ServerOptions_[K]
-}
-
-export const serverSchema = z
- .object({
- routeRules: z.custom().optional(),
- preset: z.custom().optional(),
- static: z.boolean().optional(),
- prerender: z
- .object({
- routes: z.array(z.string()),
- ignore: z
- .array(
- z.custom<
- string | RegExp | ((path: string) => undefined | null | boolean)
- >(),
- )
- .optional(),
- crawlLinks: z.boolean().optional(),
- })
- .optional(),
- })
- .and(z.custom())
+export const serverSchema = z.custom().and(
+ z.object({
+ preset: z
+ .custom()
+ .optional()
+ .default('node-server'),
+ }),
+)
-const viteSchema = z.custom()
+const viteSchema = z.custom()
const viteReactSchema = z.custom()
const routersSchema = z.object({
ssr: z
.object({
- entry: z.string().optional(),
- middleware: z.string().optional(),
+ entry: z.string().optional().default('ssr.tsx'),
+ // middleware: z.string().optional(),
vite: viteSchema.optional(),
})
- .optional(),
+ .optional()
+ .default({}),
client: z
.object({
- entry: z.string().optional(),
- base: z.string().optional(),
+ entry: z.string().optional().default('client.tsx'),
+ base: z.string().optional().default('/_build'),
vite: viteSchema.optional(),
})
- .optional(),
+ .optional()
+ .default({}),
server: z
.object({
- base: z.string().optional(),
- globalMiddlewareEntry: z.string().optional(),
- middleware: z.string().optional(),
+ base: z.string().optional().default('/_server'),
+ globalMiddlewareEntry: z
+ .string()
+ .optional()
+ .default('global-middleware.ts'),
+ // middleware: z.string().optional(),
vite: viteSchema.optional(),
})
- .optional(),
+ .optional()
+ .default({}),
api: z
.object({
- entry: z.string().optional(),
- middleware: z.string().optional(),
+ base: z.string().optional().default('/api'),
+ entry: z.string().optional().default('api.ts'),
+ // middleware: z.string().optional(),
vite: viteSchema.optional(),
})
- .optional(),
+ .optional()
+ .default({}),
public: z
.object({
- dir: z.string().optional(),
- base: z.string().optional(),
+ dir: z.string().optional().default('public'),
+ base: z.string().optional().default('/'),
})
- .optional(),
+ .optional()
+ .default({}),
})
-const tsrConfig = configSchema.partial().extend({
- appDirectory: z.string().optional(),
+const sitemapSchema = z.object({
+ host: z.string(),
})
-export const inlineConfigSchema = z.object({
- react: viteReactSchema.optional(),
- vite: viteSchema.optional(),
- tsr: tsrConfig.optional(),
- routers: routersSchema.optional(),
- server: serverSchema.optional(),
+const tsrConfig = configSchema.partial().extend({
+ // Normally these are `./src/___`, but we're using `./app/___` for Start stuff
+ appDirectory: z.string().optional().default('app'),
})
-export type TanStackStartInputConfig = z.input
-export type TanStackStartOutputConfig = z.infer
+const TanStackStartOptionsSchema = z
+ .object({
+ root: z.string().optional().default(process.cwd()),
+ react: viteReactSchema.optional(),
+ vite: viteSchema.optional(),
+ tsr: tsrConfig.optional().default({}),
+ routers: routersSchema.optional().default({}),
+ server: serverSchema.optional().default({}),
+ sitemap: sitemapSchema.optional(),
+ })
+ .optional()
+ .default({})
+
+export function getTanStackStartOptions(opts?: TanStackStartInputConfig) {
+ const options = TanStackStartOptionsSchema.parse(opts)
+
+ const appDirectory = options.tsr.appDirectory
+ const routesDirectory =
+ options.tsr.routesDirectory ?? path.join(appDirectory, 'routes')
+ const generatedRouteTree =
+ options.tsr.generatedRouteTree ??
+ path.join(appDirectory, 'routeTree.gen.ts')
+ const clientEntryPath = path.join(appDirectory, options.routers.client.entry)
+ const ssrEntryPath = path.join(appDirectory, options.routers.ssr.entry)
+ const apiEntryPath = path.join(appDirectory, options.routers.api.entry)
+ const globalMiddlewareEntryPath = path.join(
+ appDirectory,
+ options.routers.server.globalMiddlewareEntry,
+ )
+ const hasApiEntry = existsSync(apiEntryPath)
+
+ return {
+ ...options,
+ tsr: {
+ ...options.tsr,
+ ...getConfig({
+ ...options.tsr,
+ routesDirectory,
+ generatedRouteTree,
+ }),
+ },
+ clientEntryPath,
+ ssrEntryPath,
+ apiEntryPath,
+ globalMiddlewareEntryPath,
+ hasApiEntry,
+ }
+}
+
+export type TanStackStartInputConfig = z.input<
+ typeof TanStackStartOptionsSchema
+>
+export type TanStackStartOutputConfig = ReturnType<
+ typeof getTanStackStartOptions
+>
From a3ce53e27dd900554fbfe105bb4fc19ef0f8250a Mon Sep 17 00:00:00 2001
From: Manuel Schiller
Date: Wed, 26 Feb 2025 00:38:17 +0100
Subject: [PATCH 011/155] fix labeler
---
.github/labeler.yml | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/.github/labeler.yml b/.github/labeler.yml
index b71b1f4c35..7b5316ac2a 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -82,22 +82,6 @@
- 'packages/solid-start-server-functions-ssr/**/*'
'package: start':
- 'packages/start/**/*'
-'package: start-api-routes':
- - 'packages/start-api-routes/**/*'
-'package: start-client':
- - 'packages/start-client/**/*'
-'package: start-plugin':
- - 'packages/start-plugin/**/*'
-'package: start-router-manifest':
- - 'packages/start-router-manifest/**/*'
-'package: start-server':
- - 'packages/start-server/**/*'
-'package: start-server-functions-client':
- - 'packages/start-server-functions-client/**/*'
-'package: start-server-functions-fetcher':
- - 'packages/start-server-functions-fetcher/**/*'
-'package: start-server-functions-handler':
- - 'packages/start-server-functions-handler/**/*'
'package: start-server-functions-server':
- 'packages/start-server-functions-server/**/*'
'package: valibot-adapter':
From 4dc7d6e520bd25c37f480a139cf1fef86f09c7d4 Mon Sep 17 00:00:00 2001
From: Manuel Schiller
Date: Wed, 26 Feb 2025 00:39:18 +0100
Subject: [PATCH 012/155] fix docs
---
docs/start/framework/react/middleware.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/start/framework/react/middleware.md b/docs/start/framework/react/middleware.md
index a8e71d26b1..c908f5b895 100644
--- a/docs/start/framework/react/middleware.md
+++ b/docs/start/framework/react/middleware.md
@@ -302,7 +302,7 @@ Here's how to register global middleware:
```tsx
// app/global-middleware.ts
-import { registerGlobalMiddleware } from '@tanstack/start'
+import { registerGlobalMiddleware } from '@tanstack/react-start'
import { authMiddleware } from './middleware'
registerGlobalMiddleware({
From 9db72f27d865034d4e9d61ac74489e5151bd6005 Mon Sep 17 00:00:00 2001
From: Manuel Schiller
Date: Wed, 26 Feb 2025 00:40:12 +0100
Subject: [PATCH 013/155] fix package.json
---
packages/react-start-plugin/package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/react-start-plugin/package.json b/packages/react-start-plugin/package.json
index 87f20c1e47..7d2e2977aa 100644
--- a/packages/react-start-plugin/package.json
+++ b/packages/react-start-plugin/package.json
@@ -7,7 +7,7 @@
"repository": {
"type": "git",
"url": "https://github.com/TanStack/router.git",
- "directory": "packages/start-plugin"
+ "directory": "packages/react-start-plugin"
},
"homepage": "https://tanstack.com/start",
"funding": {
From 3157b19e02ce67df6f26d938a080d7e9ea76dfec Mon Sep 17 00:00:00 2001
From: Manuel Schiller
Date: Wed, 26 Feb 2025 00:53:09 +0100
Subject: [PATCH 014/155] update react-start
---
packages/react-start/package.json | 11 ++++++-----
packages/react-start/src/plugin.ts | 1 +
pnpm-lock.yaml | 3 +++
3 files changed, 10 insertions(+), 5 deletions(-)
create mode 100644 packages/react-start/src/plugin.ts
diff --git a/packages/react-start/package.json b/packages/react-start/package.json
index e9e977cebe..9acc663ba4 100644
--- a/packages/react-start/package.json
+++ b/packages/react-start/package.json
@@ -62,14 +62,14 @@
"default": "./dist/cjs/server.cjs"
}
},
- "./config": {
+ "./plugin": {
"import": {
- "types": "./dist/esm/config.d.ts",
- "default": "./dist/esm/config.js"
+ "types": "./dist/esm/plugin.d.ts",
+ "default": "./dist/esm/plugin.js"
},
"require": {
- "types": "./dist/cjs/config.d.cts",
- "default": "./dist/cjs/config.cjs"
+ "types": "./dist/cjs/plugin.d.cts",
+ "default": "./dist/cjs/plugin.cjs"
}
},
"./api": {
@@ -145,6 +145,7 @@
"dependencies": {
"@tanstack/react-start-client": "workspace:^",
"@tanstack/react-start-server": "workspace:^",
+ "@tanstack/react-start-plugin": "workspace:^",
"@tanstack/react-start-router-manifest": "workspace:^",
"@tanstack/react-start-server-functions-client": "workspace:^",
"@tanstack/start-server-functions-server": "workspace:^",
diff --git a/packages/react-start/src/plugin.ts b/packages/react-start/src/plugin.ts
new file mode 100644
index 0000000000..f2f0c6372d
--- /dev/null
+++ b/packages/react-start/src/plugin.ts
@@ -0,0 +1 @@
+export * from '@tanstack/react-start-plugin'
\ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c0d1263b2c..de497a11c1 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -5765,6 +5765,9 @@ importers:
'@tanstack/react-start-client':
specifier: workspace:*
version: link:../react-start-client
+ '@tanstack/react-start-plugin':
+ specifier: workspace:*
+ version: link:../react-start-plugin
'@tanstack/react-start-router-manifest':
specifier: workspace:*
version: link:../react-start-router-manifest
From b09e263fa5da695e3f915059453f9e5042bae3ef Mon Sep 17 00:00:00 2001
From: Manuel Schiller
Date: Wed, 26 Feb 2025 00:59:48 +0100
Subject: [PATCH 015/155] bump zod
---
.../basic-esbuild-file-based/package.json | 2 +-
.../package.json | 2 +-
.../basic-file-based/package.json | 2 +-
.../basic-react-query-file-based/package.json | 2 +-
.../basic-virtual-file-based/package.json | 2 +-
.../package.json | 2 +-
.../package.json | 2 +-
e2e/react-start/basic/package.json | 2 +-
.../scroll-restoration/package.json | 2 +-
e2e/react-start/server-functions/package.json | 2 +-
e2e/react-start/website/package.json | 2 +-
.../basic-esbuild-file-based/package.json | 2 +-
.../package.json | 2 +-
.../basic-file-based/package.json | 2 +-
.../basic-solid-query-file-based/package.json | 2 +-
.../basic-virtual-file-based/package.json | 2 +-
.../package.json | 2 +-
.../package.json | 2 +-
.../react/authenticated-routes/package.json | 2 +-
.../basic-default-search-params/package.json | 2 +-
examples/react/basic-file-based/package.json | 2 +-
.../basic-react-query-file-based/package.json | 2 +-
.../basic-virtual-file-based/package.json | 2 +-
.../package.json | 2 +-
examples/react/deferred-data/package.json | 2 +-
.../kitchen-sink-file-based/package.json | 2 +-
.../package.json | 2 +-
.../kitchen-sink-react-query/package.json | 2 +-
examples/react/kitchen-sink/package.json | 2 +-
examples/react/large-file-based/package.json | 2 +-
.../package.json | 2 +-
.../react/quickstart-file-based/package.json | 2 +-
.../packages/post-query/package.json | 2 +-
.../packages/router/package.json | 2 +-
.../packages/router/package.json | 2 +-
.../packages/router/package.json | 2 +-
.../search-validator-adapters/package.json | 2 +-
examples/react/start-bare/package.json | 2 +-
.../react/start-convex-trellaux/package.json | 2 +-
examples/react/start-trellaux/package.json | 2 +-
.../react/with-framer-motion/package.json | 2 +-
.../react/with-trpc-react-query/package.json | 2 +-
examples/react/with-trpc/package.json | 2 +-
.../kitchen-sink-file-based/package.json | 2 +-
packages/create-start/package.json | 2 +-
packages/react-router/package.json | 2 +-
packages/react-start-plugin/src/schema.ts | 2 +-
packages/router-generator/package.json | 2 +-
packages/router-plugin/package.json | 2 +-
packages/zod-adapter/package.json | 2 +-
pnpm-lock.yaml | 200 +++++++++---------
51 files changed, 150 insertions(+), 150 deletions(-)
diff --git a/e2e/react-router/basic-esbuild-file-based/package.json b/e2e/react-router/basic-esbuild-file-based/package.json
index 0f61ed5f2b..3da8230e83 100644
--- a/e2e/react-router/basic-esbuild-file-based/package.json
+++ b/e2e/react-router/basic-esbuild-file-based/package.json
@@ -17,7 +17,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-router/basic-file-based-code-splitting/package.json b/e2e/react-router/basic-file-based-code-splitting/package.json
index b4953d4105..d3cd1e2425 100644
--- a/e2e/react-router/basic-file-based-code-splitting/package.json
+++ b/e2e/react-router/basic-file-based-code-splitting/package.json
@@ -19,7 +19,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-router/basic-file-based/package.json b/e2e/react-router/basic-file-based/package.json
index f370c254c1..33c69421d1 100644
--- a/e2e/react-router/basic-file-based/package.json
+++ b/e2e/react-router/basic-file-based/package.json
@@ -21,7 +21,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-router/basic-react-query-file-based/package.json b/e2e/react-router/basic-react-query-file-based/package.json
index 57eb2d2afb..444b508488 100644
--- a/e2e/react-router/basic-react-query-file-based/package.json
+++ b/e2e/react-router/basic-react-query-file-based/package.json
@@ -22,7 +22,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-router/basic-virtual-file-based/package.json b/e2e/react-router/basic-virtual-file-based/package.json
index c11b54ff41..5d881fc0a4 100644
--- a/e2e/react-router/basic-virtual-file-based/package.json
+++ b/e2e/react-router/basic-virtual-file-based/package.json
@@ -21,7 +21,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-router/basic-virtual-named-export-config-file-based/package.json b/e2e/react-router/basic-virtual-named-export-config-file-based/package.json
index 48e74e0fe9..e8548b0db3 100644
--- a/e2e/react-router/basic-virtual-named-export-config-file-based/package.json
+++ b/e2e/react-router/basic-virtual-named-export-config-file-based/package.json
@@ -21,7 +21,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-router/scroll-restoration-sandbox-vite/package.json b/e2e/react-router/scroll-restoration-sandbox-vite/package.json
index 133244f7c7..9382a05e28 100644
--- a/e2e/react-router/scroll-restoration-sandbox-vite/package.json
+++ b/e2e/react-router/scroll-restoration-sandbox-vite/package.json
@@ -24,7 +24,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-start/basic/package.json b/e2e/react-start/basic/package.json
index ad30aa50f0..2046e82f17 100644
--- a/e2e/react-start/basic/package.json
+++ b/e2e/react-start/basic/package.json
@@ -19,7 +19,7 @@
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
"vinxi": "0.5.3",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-start/scroll-restoration/package.json b/e2e/react-start/scroll-restoration/package.json
index 18c7721181..73a72f7300 100644
--- a/e2e/react-start/scroll-restoration/package.json
+++ b/e2e/react-start/scroll-restoration/package.json
@@ -20,7 +20,7 @@
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
"vinxi": "0.5.3",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-start/server-functions/package.json b/e2e/react-start/server-functions/package.json
index 0e7cfdc8e7..2107818357 100644
--- a/e2e/react-start/server-functions/package.json
+++ b/e2e/react-start/server-functions/package.json
@@ -20,7 +20,7 @@
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
"vinxi": "0.5.3",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-start/website/package.json b/e2e/react-start/website/package.json
index 68a8d611c4..e69c2b3ffa 100644
--- a/e2e/react-start/website/package.json
+++ b/e2e/react-start/website/package.json
@@ -19,7 +19,7 @@
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
"vinxi": "0.5.3",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/solid-router/basic-esbuild-file-based/package.json b/e2e/solid-router/basic-esbuild-file-based/package.json
index a7aeccf1d1..5640e6b59e 100644
--- a/e2e/solid-router/basic-esbuild-file-based/package.json
+++ b/e2e/solid-router/basic-esbuild-file-based/package.json
@@ -16,7 +16,7 @@
"@tanstack/zod-adapter": "workspace:^",
"redaxios": "^0.5.1",
"solid-js": "^1.9.5",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/solid-router/basic-file-based-code-splitting/package.json b/e2e/solid-router/basic-file-based-code-splitting/package.json
index 4e04434c8e..ba4a9e2940 100644
--- a/e2e/solid-router/basic-file-based-code-splitting/package.json
+++ b/e2e/solid-router/basic-file-based-code-splitting/package.json
@@ -18,7 +18,7 @@
"postcss": "^8.5.1",
"solid-js": "^1.9.5",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/solid-router/basic-file-based/package.json b/e2e/solid-router/basic-file-based/package.json
index 3ddacc3ed5..9bfd059a6d 100644
--- a/e2e/solid-router/basic-file-based/package.json
+++ b/e2e/solid-router/basic-file-based/package.json
@@ -20,7 +20,7 @@
"solid-js": "^1.9.5",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/solid-router/basic-solid-query-file-based/package.json b/e2e/solid-router/basic-solid-query-file-based/package.json
index 7823b343ed..5a27e959de 100644
--- a/e2e/solid-router/basic-solid-query-file-based/package.json
+++ b/e2e/solid-router/basic-solid-query-file-based/package.json
@@ -21,7 +21,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/solid-router/basic-virtual-file-based/package.json b/e2e/solid-router/basic-virtual-file-based/package.json
index 41f35da25a..3d302dee67 100644
--- a/e2e/solid-router/basic-virtual-file-based/package.json
+++ b/e2e/solid-router/basic-virtual-file-based/package.json
@@ -20,7 +20,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/solid-router/basic-virtual-named-export-config-file-based/package.json b/e2e/solid-router/basic-virtual-named-export-config-file-based/package.json
index a1cc90c747..b79d571fb7 100644
--- a/e2e/solid-router/basic-virtual-named-export-config-file-based/package.json
+++ b/e2e/solid-router/basic-virtual-named-export-config-file-based/package.json
@@ -20,7 +20,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/solid-router/scroll-restoration-sandbox-vite/package.json b/e2e/solid-router/scroll-restoration-sandbox-vite/package.json
index 77c0254c6e..936a4a3214 100644
--- a/e2e/solid-router/scroll-restoration-sandbox-vite/package.json
+++ b/e2e/solid-router/scroll-restoration-sandbox-vite/package.json
@@ -23,7 +23,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/examples/react/authenticated-routes/package.json b/examples/react/authenticated-routes/package.json
index 3c4aa5423d..f3ec72458e 100644
--- a/examples/react/authenticated-routes/package.json
+++ b/examples/react/authenticated-routes/package.json
@@ -18,7 +18,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/basic-default-search-params/package.json b/examples/react/basic-default-search-params/package.json
index 05001f5062..f6f3b9fc6a 100644
--- a/examples/react/basic-default-search-params/package.json
+++ b/examples/react/basic-default-search-params/package.json
@@ -18,7 +18,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/basic-file-based/package.json b/examples/react/basic-file-based/package.json
index 5715990a0e..206bd690fe 100644
--- a/examples/react/basic-file-based/package.json
+++ b/examples/react/basic-file-based/package.json
@@ -18,7 +18,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/basic-react-query-file-based/package.json b/examples/react/basic-react-query-file-based/package.json
index 23bef46869..28f2079938 100644
--- a/examples/react/basic-react-query-file-based/package.json
+++ b/examples/react/basic-react-query-file-based/package.json
@@ -20,7 +20,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/basic-virtual-file-based/package.json b/examples/react/basic-virtual-file-based/package.json
index 30cf054889..32ab8c9d92 100644
--- a/examples/react/basic-virtual-file-based/package.json
+++ b/examples/react/basic-virtual-file-based/package.json
@@ -19,7 +19,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/basic-virtual-inside-file-based/package.json b/examples/react/basic-virtual-inside-file-based/package.json
index 316c2d3cc9..8bd6ec4b1a 100644
--- a/examples/react/basic-virtual-inside-file-based/package.json
+++ b/examples/react/basic-virtual-inside-file-based/package.json
@@ -19,7 +19,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/deferred-data/package.json b/examples/react/deferred-data/package.json
index dec0d13a7c..17b18a43d7 100644
--- a/examples/react/deferred-data/package.json
+++ b/examples/react/deferred-data/package.json
@@ -17,7 +17,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/kitchen-sink-file-based/package.json b/examples/react/kitchen-sink-file-based/package.json
index 876f5114cf..4a1f15a38b 100644
--- a/examples/react/kitchen-sink-file-based/package.json
+++ b/examples/react/kitchen-sink-file-based/package.json
@@ -19,7 +19,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/kitchen-sink-react-query-file-based/package.json b/examples/react/kitchen-sink-react-query-file-based/package.json
index 7068118239..1a9ea69dcf 100644
--- a/examples/react/kitchen-sink-react-query-file-based/package.json
+++ b/examples/react/kitchen-sink-react-query-file-based/package.json
@@ -21,7 +21,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/kitchen-sink-react-query/package.json b/examples/react/kitchen-sink-react-query/package.json
index ef1df060d8..4e24fc4ead 100644
--- a/examples/react/kitchen-sink-react-query/package.json
+++ b/examples/react/kitchen-sink-react-query/package.json
@@ -20,7 +20,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/kitchen-sink/package.json b/examples/react/kitchen-sink/package.json
index 5d6df05178..1439c258c6 100644
--- a/examples/react/kitchen-sink/package.json
+++ b/examples/react/kitchen-sink/package.json
@@ -18,7 +18,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/large-file-based/package.json b/examples/react/large-file-based/package.json
index b6a0123905..07c8ed2672 100644
--- a/examples/react/large-file-based/package.json
+++ b/examples/react/large-file-based/package.json
@@ -21,7 +21,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/quickstart-esbuild-file-based/package.json b/examples/react/quickstart-esbuild-file-based/package.json
index d1016dbb27..7e5701bdb7 100644
--- a/examples/react/quickstart-esbuild-file-based/package.json
+++ b/examples/react/quickstart-esbuild-file-based/package.json
@@ -15,7 +15,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/quickstart-file-based/package.json b/examples/react/quickstart-file-based/package.json
index e19f91f570..7f1ba0dabc 100644
--- a/examples/react/quickstart-file-based/package.json
+++ b/examples/react/quickstart-file-based/package.json
@@ -18,7 +18,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/router-monorepo-react-query/packages/post-query/package.json b/examples/react/router-monorepo-react-query/packages/post-query/package.json
index 25b2a759a4..1ea8a36e06 100644
--- a/examples/react/router-monorepo-react-query/packages/post-query/package.json
+++ b/examples/react/router-monorepo-react-query/packages/post-query/package.json
@@ -10,7 +10,7 @@
"dependencies": {
"@tanstack/react-query": "^5.66.0",
"redaxios": "^0.5.1",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.3.4",
diff --git a/examples/react/router-monorepo-react-query/packages/router/package.json b/examples/react/router-monorepo-react-query/packages/router/package.json
index 6729579003..b2f51ca976 100644
--- a/examples/react/router-monorepo-react-query/packages/router/package.json
+++ b/examples/react/router-monorepo-react-query/packages/router/package.json
@@ -14,7 +14,7 @@
"@tanstack/router-plugin": "^1.114.3",
"@router-mono-react-query/post-query": "workspace:*",
"redaxios": "^0.5.1",
- "zod": "^3.24.1",
+ "zod": "^3.24.2",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
diff --git a/examples/react/router-monorepo-simple-lazy/packages/router/package.json b/examples/react/router-monorepo-simple-lazy/packages/router/package.json
index 726cbf056c..2fd2e228bc 100644
--- a/examples/react/router-monorepo-simple-lazy/packages/router/package.json
+++ b/examples/react/router-monorepo-simple-lazy/packages/router/package.json
@@ -12,7 +12,7 @@
"@tanstack/react-router": "^1.114.3",
"@tanstack/router-plugin": "^1.114.3",
"redaxios": "^0.5.1",
- "zod": "^3.24.1",
+ "zod": "^3.24.2",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
diff --git a/examples/react/router-monorepo-simple/packages/router/package.json b/examples/react/router-monorepo-simple/packages/router/package.json
index 0a0ab9a0bc..2a455a1bf3 100644
--- a/examples/react/router-monorepo-simple/packages/router/package.json
+++ b/examples/react/router-monorepo-simple/packages/router/package.json
@@ -12,7 +12,7 @@
"@tanstack/react-router": "^1.114.3",
"@tanstack/router-plugin": "^1.114.3",
"redaxios": "^0.5.1",
- "zod": "^3.24.1",
+ "zod": "^3.24.2",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
diff --git a/examples/react/search-validator-adapters/package.json b/examples/react/search-validator-adapters/package.json
index 8995bf1e8a..68c2a877a3 100644
--- a/examples/react/search-validator-adapters/package.json
+++ b/examples/react/search-validator-adapters/package.json
@@ -24,7 +24,7 @@
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
"valibot": "1.0.0-beta.15",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.6.3",
diff --git a/examples/react/start-bare/package.json b/examples/react/start-bare/package.json
index fb44cff494..b0762950f3 100644
--- a/examples/react/start-bare/package.json
+++ b/examples/react/start-bare/package.json
@@ -15,7 +15,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"vinxi": "0.5.3",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@tailwindcss/vite": "^4.0.8",
diff --git a/examples/react/start-convex-trellaux/package.json b/examples/react/start-convex-trellaux/package.json
index aca031b727..793d370a72 100644
--- a/examples/react/start-convex-trellaux/package.json
+++ b/examples/react/start-convex-trellaux/package.json
@@ -29,7 +29,7 @@
"tailwind-merge": "^2.6.0",
"tiny-invariant": "^1.3.3",
"vinxi": "0.5.3",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/start-trellaux/package.json b/examples/react/start-trellaux/package.json
index db2d2f851d..04211214bf 100644
--- a/examples/react/start-trellaux/package.json
+++ b/examples/react/start-trellaux/package.json
@@ -24,7 +24,7 @@
"tailwind-merge": "^2.6.0",
"tiny-invariant": "^1.3.3",
"vinxi": "0.5.3",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/with-framer-motion/package.json b/examples/react/with-framer-motion/package.json
index a97679fee8..0bc9030b86 100644
--- a/examples/react/with-framer-motion/package.json
+++ b/examples/react/with-framer-motion/package.json
@@ -18,7 +18,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/with-trpc-react-query/package.json b/examples/react/with-trpc-react-query/package.json
index 6c533c6240..549b022de7 100644
--- a/examples/react/with-trpc-react-query/package.json
+++ b/examples/react/with-trpc-react-query/package.json
@@ -24,7 +24,7 @@
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
"vinxi": "0.5.3",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/with-trpc/package.json b/examples/react/with-trpc/package.json
index 05679b5cc7..31fc08a2ed 100644
--- a/examples/react/with-trpc/package.json
+++ b/examples/react/with-trpc/package.json
@@ -21,7 +21,7 @@
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
"vinxi": "0.5.3",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/solid/kitchen-sink-file-based/package.json b/examples/solid/kitchen-sink-file-based/package.json
index d8fa559e12..575cbbab4a 100644
--- a/examples/solid/kitchen-sink-file-based/package.json
+++ b/examples/solid/kitchen-sink-file-based/package.json
@@ -17,7 +17,7 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@tanstack/router-plugin": "^1.114.3",
diff --git a/packages/create-start/package.json b/packages/create-start/package.json
index 4f49aeaa09..6aaf61475c 100644
--- a/packages/create-start/package.json
+++ b/packages/create-start/package.json
@@ -54,7 +54,7 @@
"tiny-invariant": "^1.3.3",
"validate-npm-package-name": "^6.0.0",
"yocto-spinner": "^0.2.0",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"devDependencies": {
"@inquirer/type": "^3.0.4",
diff --git a/packages/react-router/package.json b/packages/react-router/package.json
index 4328a768f2..06de277d9c 100644
--- a/packages/react-router/package.json
+++ b/packages/react-router/package.json
@@ -81,7 +81,7 @@
"combinate": "^1.1.11",
"react": "^19.0.0",
"react-dom": "^19.0.0",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"peerDependencies": {
"react": ">=18.0.0 || >=19.0.0",
diff --git a/packages/react-start-plugin/src/schema.ts b/packages/react-start-plugin/src/schema.ts
index e0882a17d4..ecc939ec63 100644
--- a/packages/react-start-plugin/src/schema.ts
+++ b/packages/react-start-plugin/src/schema.ts
@@ -142,4 +142,4 @@ export type TanStackStartInputConfig = z.input<
>
export type TanStackStartOutputConfig = ReturnType<
typeof getTanStackStartOptions
->
+>
\ No newline at end of file
diff --git a/packages/router-generator/package.json b/packages/router-generator/package.json
index 5f83478650..c84a9182b2 100644
--- a/packages/router-generator/package.json
+++ b/packages/router-generator/package.json
@@ -68,7 +68,7 @@
"@tanstack/virtual-file-routes": "workspace:^",
"tsx": "^4.19.2",
"prettier": "^3.5.0",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"peerDependencies": {
"@tanstack/react-router": "workspace:^"
diff --git a/packages/router-plugin/package.json b/packages/router-plugin/package.json
index 843261f09b..d00ff42ccd 100644
--- a/packages/router-plugin/package.json
+++ b/packages/router-plugin/package.json
@@ -120,7 +120,7 @@
"babel-dead-code-elimination": "^1.0.9",
"chokidar": "^3.6.0",
"unplugin": "^2.1.2",
- "zod": "^3.24.1"
+ "zod": "^3.24.2"
},
"peerDependencies": {
"@rsbuild/core": ">=1.0.2",
diff --git a/packages/zod-adapter/package.json b/packages/zod-adapter/package.json
index be7141fb00..80aef210a4 100644
--- a/packages/zod-adapter/package.json
+++ b/packages/zod-adapter/package.json
@@ -67,7 +67,7 @@
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@tanstack/react-router": "workspace:^",
- "zod": "^3.24.1",
+ "zod": "^3.24.2",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index de497a11c1..66f4bd092d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -212,8 +212,8 @@ importers:
specifier: ^0.5.1
version: 0.5.1
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -264,8 +264,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -316,8 +316,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -426,8 +426,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -530,8 +530,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -585,8 +585,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -747,8 +747,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -851,8 +851,8 @@ importers:
specifier: 0.5.3
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1211,8 +1211,8 @@ importers:
specifier: 0.5.3
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1281,8 +1281,8 @@ importers:
specifier: 0.5.3
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1351,8 +1351,8 @@ importers:
specifier: 0.5.3
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1446,8 +1446,8 @@ importers:
specifier: ^1.9.5
version: 1.9.5
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1492,8 +1492,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1535,8 +1535,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1667,8 +1667,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1713,8 +1713,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1759,8 +1759,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1900,8 +1900,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -2212,8 +2212,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -2359,8 +2359,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -2454,8 +2454,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -2601,8 +2601,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -2796,8 +2796,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -2848,8 +2848,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -2894,8 +2894,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -2943,8 +2943,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -2995,8 +2995,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -3050,8 +3050,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -3108,8 +3108,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -3160,8 +3160,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -3335,8 +3335,8 @@ importers:
specifier: ^0.5.1
version: 0.5.1
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -3378,8 +3378,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -3630,8 +3630,8 @@ importers:
specifier: ^0.5.1
version: 0.5.1
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@vitejs/plugin-react':
specifier: ^4.3.4
@@ -3670,8 +3670,8 @@ importers:
specifier: ^0.5.1
version: 0.5.1
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -3879,8 +3879,8 @@ importers:
specifier: ^0.5.1
version: 0.5.1
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -3999,8 +3999,8 @@ importers:
specifier: ^0.5.1
version: 0.5.1
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -4109,8 +4109,8 @@ importers:
specifier: 1.0.0-beta.15
version: 1.0.0-beta.15(typescript@5.8.2)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@testing-library/jest-dom':
specifier: ^6.6.3
@@ -4155,8 +4155,8 @@ importers:
specifier: 0.5.3
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@tailwindcss/vite':
specifier: ^4.0.8
@@ -4567,8 +4567,8 @@ importers:
specifier: 0.5.3
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -4839,8 +4839,8 @@ importers:
specifier: 0.5.3
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -4894,8 +4894,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -4955,8 +4955,8 @@ importers:
specifier: 0.5.3
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -5019,8 +5019,8 @@ importers:
specifier: 0.5.3
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -5302,8 +5302,8 @@ importers:
specifier: ^3.4.17
version: 3.4.17
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@tanstack/router-plugin':
specifier: workspace:*
@@ -5588,8 +5588,8 @@ importers:
specifier: ^0.2.0
version: 0.2.0
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
devDependencies:
'@inquirer/type':
specifier: ^3.0.4
@@ -5717,8 +5717,8 @@ importers:
specifier: ^19.0.0
version: 19.0.0(react@19.0.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
packages/react-router-devtools:
dependencies:
@@ -6228,8 +6228,8 @@ importers:
specifier: ^4.19.2
version: 4.19.2
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
packages/router-plugin:
dependencies:
@@ -6297,8 +6297,8 @@ importers:
specifier: '>=5.92.0'
version: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
packages/router-utils:
dependencies:
@@ -6872,8 +6872,8 @@ importers:
specifier: ^19.0.0
version: 19.0.0(react@19.0.0)
zod:
- specifier: ^3.24.1
- version: 3.24.1
+ specifier: ^3.24.2
+ version: 3.24.2
packages:
@@ -23582,7 +23582,7 @@ snapshots:
unenv: 1.10.0
unstorage: 1.14.4(db0@0.2.3)(ioredis@5.4.2)
vite: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
- zod: 3.24.1
+ zod: 3.24.2
transitivePeerDependencies:
- '@azure/app-configuration'
- '@azure/cosmos'
@@ -23661,7 +23661,7 @@ snapshots:
unenv: 1.10.0
unstorage: 1.14.4(db0@0.2.3)(ioredis@5.4.2)
vite: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
- zod: 3.24.1
+ zod: 3.24.2
transitivePeerDependencies:
- '@azure/app-configuration'
- '@azure/cosmos'
From 0087d6badfb3190566b84881eacebf48080131ca Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Wed, 26 Feb 2025 00:01:31 +0000
Subject: [PATCH 016/155] ci: apply automated fixes
---
packages/react-start-plugin/src/schema.ts | 2 +-
packages/react-start/src/plugin.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/react-start-plugin/src/schema.ts b/packages/react-start-plugin/src/schema.ts
index ecc939ec63..e0882a17d4 100644
--- a/packages/react-start-plugin/src/schema.ts
+++ b/packages/react-start-plugin/src/schema.ts
@@ -142,4 +142,4 @@ export type TanStackStartInputConfig = z.input<
>
export type TanStackStartOutputConfig = ReturnType<
typeof getTanStackStartOptions
->
\ No newline at end of file
+>
diff --git a/packages/react-start/src/plugin.ts b/packages/react-start/src/plugin.ts
index f2f0c6372d..d991c3b71c 100644
--- a/packages/react-start/src/plugin.ts
+++ b/packages/react-start/src/plugin.ts
@@ -1 +1 @@
-export * from '@tanstack/react-start-plugin'
\ No newline at end of file
+export * from '@tanstack/react-start-plugin'
From e33bd0bef027e04bb63c8fe405c2be026cca7f6a Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Wed, 26 Feb 2025 17:27:32 -0700
Subject: [PATCH 017/155] Remove "vinxi" from vocab, make dev html response
work
---
.prettierignore | 1 -
.../framework/react/guide/tanstack-start.md | 15 +-
.../framework/react/build-from-scratch.md | 15 +-
.../start/framework/react/learn-the-basics.md | 6 +-
e2e/create-start/utils/setup.ts | 2 +-
e2e/react-start/basic-auth/.gitignore | 2 -
e2e/react-start/basic-auth/app/client.tsx | 1 -
e2e/react-start/basic-auth/package.json | 11 +-
e2e/react-start/basic-react-query/.gitignore | 6 +-
.../basic-react-query/app/client.tsx | 1 -
.../basic-react-query/package.json | 11 +-
e2e/react-start/basic-rsc/.gitignore | 6 +-
e2e/react-start/basic-rsc/app/client.tsx | 1 -
e2e/react-start/basic-rsc/package.json | 9 +-
e2e/react-start/basic-tsr-config/.gitignore | 6 +-
e2e/react-start/basic-tsr-config/package.json | 11 +-
.../basic-tsr-config/src/app/client.tsx | 1 -
.../basic-tsr-config/src/app/ssr.tsx | 1 -
e2e/react-start/basic/.gitignore | 2 -
e2e/react-start/basic/app/client.tsx | 1 -
e2e/react-start/basic/package.json | 9 +-
e2e/react-start/clerk-basic/.gitignore | 6 +-
e2e/react-start/clerk-basic/app/client.tsx | 1 -
e2e/react-start/clerk-basic/package.json | 11 +-
e2e/react-start/scroll-restoration/.gitignore | 6 +-
.../scroll-restoration/app/client.tsx | 1 -
.../scroll-restoration/package.json | 9 +-
e2e/react-start/server-functions/.gitignore | 6 +-
.../server-functions/app/client.tsx | 1 -
e2e/react-start/server-functions/package.json | 9 +-
e2e/react-start/website/.gitignore | 6 +-
e2e/react-start/website/app/client.tsx | 1 -
e2e/react-start/website/app/ssr.tsx | 1 -
e2e/react-start/website/package.json | 9 +-
examples/react/start-bare/app/client.tsx | 1 -
examples/react/start-bare/package.json | 7 +-
examples/react/start-basic-auth/.gitignore | 6 +-
.../react/start-basic-auth/app/client.tsx | 1 -
examples/react/start-basic-auth/app/ssr.tsx | 1 -
examples/react/start-basic-auth/package.json | 9 +-
.../react/start-basic-react-query/.gitignore | 6 +-
.../start-basic-react-query/app/client.tsx | 1 -
.../react/start-basic-react-query/app/ssr.tsx | 1 -
.../start-basic-react-query/package.json | 9 +-
examples/react/start-basic-rsc/.gitignore | 6 +-
examples/react/start-basic-rsc/app/client.tsx | 1 -
examples/react/start-basic-rsc/app/ssr.tsx | 1 -
examples/react/start-basic-rsc/package.json | 9 +-
examples/react/start-basic-static/.gitignore | 6 +-
.../react/start-basic-static/app/client.tsx | 1 -
examples/react/start-basic-static/app/ssr.tsx | 1 -
.../react/start-basic-static/package.json | 9 +-
examples/react/start-basic/.gitignore | 6 +-
examples/react/start-basic/app/client.tsx | 1 -
examples/react/start-basic/app/ssr.tsx | 1 -
examples/react/start-basic/vite.config.ts | 2 +-
examples/react/start-clerk-basic/.gitignore | 6 +-
.../react/start-clerk-basic/app/client.tsx | 1 -
examples/react/start-clerk-basic/app/ssr.tsx | 1 -
examples/react/start-clerk-basic/package.json | 9 +-
.../react/start-convex-trellaux/.gitignore | 6 +-
.../react/start-convex-trellaux/.stackblitzrc | 2 +-
.../start-convex-trellaux/app/client.tsx | 1 -
.../react/start-convex-trellaux/app/ssr.tsx | 1 -
.../react/start-convex-trellaux/package.json | 7 +-
examples/react/start-counter/.gitignore | 6 +-
examples/react/start-counter/app/client.tsx | 1 -
examples/react/start-counter/app/ssr.tsx | 1 -
examples/react/start-counter/package.json | 9 +-
examples/react/start-large/.gitignore | 5 +-
examples/react/start-large/app/client.tsx | 2 +-
examples/react/start-large/app/ssr.tsx | 2 +-
examples/react/start-large/package.json | 9 +-
.../react/start-supabase-basic/.gitignore | 6 +-
.../react/start-supabase-basic/app/client.tsx | 2 +-
.../react/start-supabase-basic/app/ssr.tsx | 2 +-
.../react/start-supabase-basic/package.json | 9 +-
examples/react/start-trellaux/.gitignore | 6 +-
examples/react/start-trellaux/app/client.tsx | 1 -
examples/react/start-trellaux/app/ssr.tsx | 1 -
examples/react/start-trellaux/package.json | 7 +-
.../react/with-trpc-react-query/.gitignore | 6 +-
.../react/with-trpc-react-query/app.config.js | 6 +-
.../react/with-trpc-react-query/app/main.tsx | 2 -
.../with-trpc-react-query/app/router.tsx | 2 +-
.../react/with-trpc-react-query/package.json | 7 +-
examples/react/with-trpc/.gitignore | 6 +-
examples/react/with-trpc/app.config.js | 6 +-
examples/react/with-trpc/app/main.tsx | 2 -
examples/react/with-trpc/app/trpc.ts | 2 +-
examples/react/with-trpc/package.json | 7 +-
.../templates/core/_dot_gitignore | 4 +-
packages/create-start/package.json | 4 -
.../create-start/src/modules/core/index.ts | 8 +-
.../src/modules/core/template/app/client.tsx | 1 -
.../src/modules/core/template/app/ssr.tsx | 1 -
.../tests/e2e/templates/barebones.test.ts | 8 +-
.../directive-functions-plugin/src/index.ts | 2 -
.../tests/compiler.test.ts | 2 -
packages/react-start-api-routes/package.json | 3 +-
packages/react-start-api-routes/src/index.ts | 19 +-
packages/react-start-client/package.json | 3 +-
packages/react-start-client/src/index.tsx | 1 -
packages/react-start-client/src/renderRSC.tsx | 2 -
packages/react-start-plugin/src/index.ts | 59 ++---
.../src/nitro/nitro-plugin.ts | 100 +++------
.../src/nitro/plugins/dev-server-plugin.ts | 12 +-
.../src/nitro/vite-plugin-nitro.ts | 0
.../react-start-router-manifest/package.json | 3 +-
.../react-start-router-manifest/src/index.ts | 32 ++-
.../src/index.ts | 4 +-
packages/react-start/vite.config.ts | 2 +
.../useStateDestructure@component.tsx | 4 +-
.../useStateDestructure@errorComponent.tsx | 2 +-
.../useStateDestructure@notFoundComponent.tsx | 2 +-
.../useStateDestructure@pendingComponent.tsx | 2 +-
.../useStateDestructure@component.tsx | 4 +-
.../useStateDestructure@errorComponent.tsx | 2 +-
.../useStateDestructure@notFoundComponent.tsx | 2 +-
.../useStateDestructure@pendingComponent.tsx | 2 +-
...--notFoundComponent---pendingComponent.tsx | 4 +-
.../useStateDestructure@loader.tsx | 2 +-
...--notFoundComponent---pendingComponent.tsx | 4 +-
.../production/useStateDestructure@loader.tsx | 2 +-
...--notFoundComponent---pendingComponent.tsx | 4 +-
.../useStateDestructure@errorComponent.tsx | 2 +-
...--notFoundComponent---pendingComponent.tsx | 4 +-
.../useStateDestructure@errorComponent.tsx | 2 +-
.../test-files/react/useStateDestructure.tsx | 6 +-
pnpm-lock.yaml | 201 ++----------------
130 files changed, 272 insertions(+), 669 deletions(-)
delete mode 100644 packages/react-start-plugin/src/nitro/vite-plugin-nitro.ts
diff --git a/.prettierignore b/.prettierignore
index d285f8937d..25c93015ed 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -7,7 +7,6 @@
pnpm-lock.yaml
**/snapshots
**/.vercel
-**/.vinxi
**/.output
**/node_modules
node_modules
diff --git a/docs/router/framework/react/guide/tanstack-start.md b/docs/router/framework/react/guide/tanstack-start.md
index 99db736a7c..900ed67df2 100644
--- a/docs/router/framework/react/guide/tanstack-start.md
+++ b/docs/router/framework/react/guide/tanstack-start.md
@@ -47,15 +47,12 @@ TanStack Start is powered by the following packages and need to be installed as
- [@tanstack/start](https://github.com/tanstack/start)
- [@tanstack/react-router](https://tanstack.com/router)
-- [Vinxi](https://vinxi.vercel.app/)
-
-> [!NOTE]
-> Vinxi is a temporary dependency that will be replaced by a simple vite plugin or a dedicated Start CLI.
+- [Vite](https://vite.dev/)
To install them, run:
```shell
-npm i @tanstack/start @tanstack/react-router vinxi
+npm i @tanstack/start @tanstack/react-router vite
```
You'll also need React and the Vite React plugin, so install their dependencies as well:
@@ -72,16 +69,16 @@ npm i -D typescript @types/react @types/react-dom
# Update Configuration Files
-We'll then update our `package.json` to use Vinxi's CLI and set `"type": "module"`:
+We'll then update our `package.json` to use Vite's CLI and set `"type": "module"`:
```jsonc
{
// ...
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start",
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start",
},
}
```
diff --git a/docs/start/framework/react/build-from-scratch.md b/docs/start/framework/react/build-from-scratch.md
index 66eecc1e98..a09e7ff678 100644
--- a/docs/start/framework/react/build-from-scratch.md
+++ b/docs/start/framework/react/build-from-scratch.md
@@ -47,14 +47,12 @@ We highly recommend using TypeScript with TanStack Start. Create a `tsconfig.jso
## Install Dependencies
-TanStack Start is (currently\*) powered by [Vinxi](https://vinxi.vercel.app/) and [TanStack Router](https://tanstack.com/router) and requires them as dependencies.
-
-> [!NOTE] > \*Vinxi will be removed before version 1.0.0 is released and TanStack will rely only on Vite and Nitro. The commands and APIs that use Vinxi will likely be replaced with a Vite plugin or dedicated TanStack Start CLI.
+TanStack Start is (currently\*) powered by [Vite](https://vite.dev/) and [TanStack Router](https://tanstack.com/router) and requires them as dependencies.
To install them, run:
```shell
-npm i @tanstack/react-start @tanstack/react-router vinxi
+npm i @tanstack/react-start @tanstack/react-router vite
```
You'll also need React and the Vite React plugin, so install them too:
@@ -72,16 +70,16 @@ npm i -D typescript @types/react @types/react-dom
## Update Configuration Files
-We'll then update our `package.json` to use Vinxi's CLI and set `"type": "module"`:
+We'll then update our `package.json` to set `"type": "module"`:
```json
{
// ...
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
}
}
```
@@ -189,7 +187,6 @@ router information to our client entry point:
```tsx
// app/client.tsx
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/docs/start/framework/react/learn-the-basics.md b/docs/start/framework/react/learn-the-basics.md
index 4703259c5a..95ac917a6c 100644
--- a/docs/start/framework/react/learn-the-basics.md
+++ b/docs/start/framework/react/learn-the-basics.md
@@ -7,13 +7,11 @@ This guide will help you learn the basics behind how TanStack Start works, regar
## Dependencies
-TanStack Start is (currently\*) powered by [Vinxi](https://vinxi.vercel.app/), [Nitro](https://nitro.unjs.io/) and [TanStack Router](https://tanstack.com/router).
+TanStack Start is powered by [Vite](https://vite.dev/), [Nitro](https://nitro.unjs.io/) and [TanStack Router](https://tanstack.com/router).
- **TanStack Router**: A router for building web applications.
- **Nitro**: A framework for building server applications.
-- **Vinxi**: A server framework for building web applications.
-
-> [!NOTE] Vinxi will be removed before version 1.0.0 is released and TanStack will rely only on Vite and Nitro. The commands and APIs that use Vinxi will likely be replaced with a Vite plugin.
+- **Vite**: A build tool for bundling your application.
## It all "Starts" with the Router
diff --git a/e2e/create-start/utils/setup.ts b/e2e/create-start/utils/setup.ts
index bfb4c1fd53..5f0af79fee 100644
--- a/e2e/create-start/utils/setup.ts
+++ b/e2e/create-start/utils/setup.ts
@@ -15,7 +15,7 @@ async function _setup(
const ADDR = `http://localhost:${port}`
const childProcess = exec(
- `VITE_SERVER_PORT=${port} pnpm vinxi dev --port ${port}`,
+ `VITE_SERVER_PORT=${port} pnpm vite dev --port ${port}`,
{
cwd: projectPath,
},
diff --git a/e2e/react-start/basic-auth/.gitignore b/e2e/react-start/basic-auth/.gitignore
index b15fed94e2..75a469e80c 100644
--- a/e2e/react-start/basic-auth/.gitignore
+++ b/e2e/react-start/basic-auth/.gitignore
@@ -7,13 +7,11 @@ yarn.lock
.cache
.vercel
.output
-.vinxi
/build/
/api/
/server/build
/public/build
-.vinxi
# Sentry Config File
.env.sentry-build-plugin
/test-results/
diff --git a/e2e/react-start/basic-auth/app/client.tsx b/e2e/react-start/basic-auth/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/e2e/react-start/basic-auth/app/client.tsx
+++ b/e2e/react-start/basic-auth/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/e2e/react-start/basic-auth/package.json b/e2e/react-start/basic-auth/package.json
index bb04401e02..f0223cf4a1 100644
--- a/e2e/react-start/basic-auth/package.json
+++ b/e2e/react-start/basic-auth/package.json
@@ -4,10 +4,10 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev --port 3000",
- "dev:e2e": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start",
+ "dev": "vite dev --port 3000",
+ "dev:e2e": "vite dev",
+ "build": "vite build",
+ "start": "vite start",
"prisma-generate": "prisma generate",
"test:e2e": "exit 0; pnpm run prisma-generate && playwright test --project=chromium"
},
@@ -20,8 +20,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
- "tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3"
+ "tailwind-merge": "^2.6.0"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-start/basic-react-query/.gitignore b/e2e/react-start/basic-react-query/.gitignore
index be342025da..ca63f49885 100644
--- a/e2e/react-start/basic-react-query/.gitignore
+++ b/e2e/react-start/basic-react-query/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/e2e/react-start/basic-react-query/app/client.tsx b/e2e/react-start/basic-react-query/app/client.tsx
index 31385f57f1..9fb62bd3c2 100644
--- a/e2e/react-start/basic-react-query/app/client.tsx
+++ b/e2e/react-start/basic-react-query/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/e2e/react-start/basic-react-query/package.json b/e2e/react-start/basic-react-query/package.json
index 4cc7162526..c7d7424af0 100644
--- a/e2e/react-start/basic-react-query/package.json
+++ b/e2e/react-start/basic-react-query/package.json
@@ -4,10 +4,10 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev --port 3000",
- "dev:e2e": "vinxi dev",
- "build": "vinxi build && tsc --noEmit",
- "start": "vinxi start",
+ "dev": "vite dev --port 3000",
+ "dev:e2e": "vite dev",
+ "build": "vite build && tsc --noEmit",
+ "start": "vite start",
"test:e2e": "playwright test --project=chromium"
},
"dependencies": {
@@ -20,8 +20,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
- "tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3"
+ "tailwind-merge": "^2.6.0"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-start/basic-rsc/.gitignore b/e2e/react-start/basic-rsc/.gitignore
index d3387e00cd..3c8e6870b3 100644
--- a/e2e/react-start/basic-rsc/.gitignore
+++ b/e2e/react-start/basic-rsc/.gitignore
@@ -7,12 +7,8 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
diff --git a/e2e/react-start/basic-rsc/app/client.tsx b/e2e/react-start/basic-rsc/app/client.tsx
index 31385f57f1..9fb62bd3c2 100644
--- a/e2e/react-start/basic-rsc/app/client.tsx
+++ b/e2e/react-start/basic-rsc/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/e2e/react-start/basic-rsc/package.json b/e2e/react-start/basic-rsc/package.json
index c93361fa88..fc2369d466 100644
--- a/e2e/react-start/basic-rsc/package.json
+++ b/e2e/react-start/basic-rsc/package.json
@@ -4,9 +4,9 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@babel/plugin-syntax-typescript": "^7.25.9",
@@ -16,8 +16,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
- "tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3"
+ "tailwind-merge": "^2.6.0"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/e2e/react-start/basic-tsr-config/.gitignore b/e2e/react-start/basic-tsr-config/.gitignore
index 2b76174be5..08eba9e706 100644
--- a/e2e/react-start/basic-tsr-config/.gitignore
+++ b/e2e/react-start/basic-tsr-config/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/e2e/react-start/basic-tsr-config/package.json b/e2e/react-start/basic-tsr-config/package.json
index cd697d2bfb..78fa63c5fc 100644
--- a/e2e/react-start/basic-tsr-config/package.json
+++ b/e2e/react-start/basic-tsr-config/package.json
@@ -4,18 +4,17 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev --port 3000",
- "dev:e2e": "vinxi dev",
- "build": "rimraf ./count.txt && vinxi build && tsc --noEmit",
- "start": "vinxi start",
+ "dev": "vite dev --port 3000",
+ "dev:e2e": "vite dev",
+ "build": "rimraf ./count.txt && vite build && tsc --noEmit",
+ "start": "vite start",
"test:e2e": "playwright test --project=chromium"
},
"dependencies": {
"@tanstack/react-router": "workspace:^",
"@tanstack/react-start": "workspace:^",
"react": "^19.0.0",
- "react-dom": "^19.0.0",
- "vinxi": "0.5.3"
+ "react-dom": "^19.0.0"
},
"devDependencies": {
"@tanstack/router-e2e-utils": "workspace:^",
diff --git a/e2e/react-start/basic-tsr-config/src/app/client.tsx b/e2e/react-start/basic-tsr-config/src/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/e2e/react-start/basic-tsr-config/src/app/client.tsx
+++ b/e2e/react-start/basic-tsr-config/src/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/e2e/react-start/basic-tsr-config/src/app/ssr.tsx b/e2e/react-start/basic-tsr-config/src/app/ssr.tsx
index 8981a9a338..65a580f25e 100644
--- a/e2e/react-start/basic-tsr-config/src/app/ssr.tsx
+++ b/e2e/react-start/basic-tsr-config/src/app/ssr.tsx
@@ -1,4 +1,3 @@
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/e2e/react-start/basic/.gitignore b/e2e/react-start/basic/.gitignore
index be342025da..a79d5cf129 100644
--- a/e2e/react-start/basic/.gitignore
+++ b/e2e/react-start/basic/.gitignore
@@ -7,13 +7,11 @@ yarn.lock
.env
.vercel
.output
-.vinxi
/build/
/api/
/server/build
/public/build
-.vinxi
# Sentry Config File
.env.sentry-build-plugin
/test-results/
diff --git a/e2e/react-start/basic/app/client.tsx b/e2e/react-start/basic/app/client.tsx
index b14d8aac68..ffee5f382c 100644
--- a/e2e/react-start/basic/app/client.tsx
+++ b/e2e/react-start/basic/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/start'
import { createRouter } from './router'
diff --git a/e2e/react-start/basic/package.json b/e2e/react-start/basic/package.json
index 2046e82f17..8f0fd1fb2f 100644
--- a/e2e/react-start/basic/package.json
+++ b/e2e/react-start/basic/package.json
@@ -4,10 +4,10 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev --port 3000",
- "dev:e2e": "vinxi dev",
- "build": "vinxi build && tsc --noEmit",
- "start": "vinxi start",
+ "dev": "vite dev --port 3000",
+ "dev:e2e": "vite dev",
+ "build": "vite build && tsc --noEmit",
+ "start": "vite start",
"test:e2e": "playwright test --project=chromium"
},
"dependencies": {
@@ -18,7 +18,6 @@
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3",
"zod": "^3.24.2"
},
"devDependencies": {
diff --git a/e2e/react-start/clerk-basic/.gitignore b/e2e/react-start/clerk-basic/.gitignore
index b15fed94e2..2818549158 100644
--- a/e2e/react-start/clerk-basic/.gitignore
+++ b/e2e/react-start/clerk-basic/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.cache
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/e2e/react-start/clerk-basic/app/client.tsx b/e2e/react-start/clerk-basic/app/client.tsx
index 31385f57f1..9fb62bd3c2 100644
--- a/e2e/react-start/clerk-basic/app/client.tsx
+++ b/e2e/react-start/clerk-basic/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/e2e/react-start/clerk-basic/package.json b/e2e/react-start/clerk-basic/package.json
index 2f517dce0d..3bd0300ca5 100644
--- a/e2e/react-start/clerk-basic/package.json
+++ b/e2e/react-start/clerk-basic/package.json
@@ -4,10 +4,10 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev --port 3000",
- "dev:e2e": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start",
+ "dev": "vite dev --port 3000",
+ "dev:e2e": "vite dev",
+ "build": "vite build",
+ "start": "vite start",
"test:e2e": "exit 0; playwright test --project=chromium"
},
"dependencies": {
@@ -18,8 +18,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
- "tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3"
+ "tailwind-merge": "^2.6.0"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
diff --git a/e2e/react-start/scroll-restoration/.gitignore b/e2e/react-start/scroll-restoration/.gitignore
index be342025da..ca63f49885 100644
--- a/e2e/react-start/scroll-restoration/.gitignore
+++ b/e2e/react-start/scroll-restoration/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/e2e/react-start/scroll-restoration/app/client.tsx b/e2e/react-start/scroll-restoration/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/e2e/react-start/scroll-restoration/app/client.tsx
+++ b/e2e/react-start/scroll-restoration/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/e2e/react-start/scroll-restoration/package.json b/e2e/react-start/scroll-restoration/package.json
index 73a72f7300..de9d765fad 100644
--- a/e2e/react-start/scroll-restoration/package.json
+++ b/e2e/react-start/scroll-restoration/package.json
@@ -4,10 +4,10 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev --port 3000",
- "dev:e2e": "vinxi dev",
- "build": "vinxi build && tsc --noEmit",
- "start": "vinxi start",
+ "dev": "vite dev --port 3000",
+ "dev:e2e": "vite dev",
+ "build": "vite build && tsc --noEmit",
+ "start": "vite start",
"test:e2e": "playwright test --project=chromium"
},
"dependencies": {
@@ -19,7 +19,6 @@
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3",
"zod": "^3.24.2"
},
"devDependencies": {
diff --git a/e2e/react-start/server-functions/.gitignore b/e2e/react-start/server-functions/.gitignore
index be342025da..ca63f49885 100644
--- a/e2e/react-start/server-functions/.gitignore
+++ b/e2e/react-start/server-functions/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/e2e/react-start/server-functions/app/client.tsx b/e2e/react-start/server-functions/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/e2e/react-start/server-functions/app/client.tsx
+++ b/e2e/react-start/server-functions/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/e2e/react-start/server-functions/package.json b/e2e/react-start/server-functions/package.json
index 2107818357..4d48b8f7da 100644
--- a/e2e/react-start/server-functions/package.json
+++ b/e2e/react-start/server-functions/package.json
@@ -4,10 +4,10 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev --port 3000",
- "dev:e2e": "vinxi dev",
- "build": "vinxi build && tsc --noEmit",
- "start": "vinxi start",
+ "dev": "vite dev --port 3000",
+ "dev:e2e": "vite dev",
+ "build": "vite build && tsc --noEmit",
+ "start": "vite start",
"test:e2e": "playwright test --project=chromium"
},
"dependencies": {
@@ -19,7 +19,6 @@
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3",
"zod": "^3.24.2"
},
"devDependencies": {
diff --git a/e2e/react-start/website/.gitignore b/e2e/react-start/website/.gitignore
index be342025da..ca63f49885 100644
--- a/e2e/react-start/website/.gitignore
+++ b/e2e/react-start/website/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/e2e/react-start/website/app/client.tsx b/e2e/react-start/website/app/client.tsx
index 31385f57f1..9fb62bd3c2 100644
--- a/e2e/react-start/website/app/client.tsx
+++ b/e2e/react-start/website/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/e2e/react-start/website/app/ssr.tsx b/e2e/react-start/website/app/ssr.tsx
index 8981a9a338..65a580f25e 100644
--- a/e2e/react-start/website/app/ssr.tsx
+++ b/e2e/react-start/website/app/ssr.tsx
@@ -1,4 +1,3 @@
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/e2e/react-start/website/package.json b/e2e/react-start/website/package.json
index e69c2b3ffa..980aa9ca51 100644
--- a/e2e/react-start/website/package.json
+++ b/e2e/react-start/website/package.json
@@ -4,10 +4,10 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev --port 3000",
- "dev:e2e": "vinxi dev",
- "build": "vinxi build && tsc --noEmit",
- "start": "vinxi start",
+ "dev": "vite dev --port 3000",
+ "dev:e2e": "vite dev",
+ "build": "vite build && tsc --noEmit",
+ "start": "vite start",
"test:e2e": "playwright test --project=chromium"
},
"dependencies": {
@@ -18,7 +18,6 @@
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3",
"zod": "^3.24.2"
},
"devDependencies": {
diff --git a/examples/react/start-bare/app/client.tsx b/examples/react/start-bare/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/examples/react/start-bare/app/client.tsx
+++ b/examples/react/start-bare/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-bare/package.json b/examples/react/start-bare/package.json
index b0762950f3..ba8e8796a8 100644
--- a/examples/react/start-bare/package.json
+++ b/examples/react/start-bare/package.json
@@ -4,9 +4,9 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@tanstack/react-router": "^1.114.3",
@@ -14,7 +14,6 @@
"@tanstack/react-start": "^1.114.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
- "vinxi": "0.5.3",
"zod": "^3.24.2"
},
"devDependencies": {
diff --git a/examples/react/start-basic-auth/.gitignore b/examples/react/start-basic-auth/.gitignore
index b15fed94e2..2818549158 100644
--- a/examples/react/start-basic-auth/.gitignore
+++ b/examples/react/start-basic-auth/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.cache
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/examples/react/start-basic-auth/app/client.tsx b/examples/react/start-basic-auth/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/examples/react/start-basic-auth/app/client.tsx
+++ b/examples/react/start-basic-auth/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-basic-auth/app/ssr.tsx b/examples/react/start-basic-auth/app/ssr.tsx
index 8981a9a338..65a580f25e 100644
--- a/examples/react/start-basic-auth/app/ssr.tsx
+++ b/examples/react/start-basic-auth/app/ssr.tsx
@@ -1,4 +1,3 @@
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/examples/react/start-basic-auth/package.json b/examples/react/start-basic-auth/package.json
index 7a6fcba0f1..a868ef024f 100644
--- a/examples/react/start-basic-auth/package.json
+++ b/examples/react/start-basic-auth/package.json
@@ -4,9 +4,9 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start",
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start",
"prisma-generate": "prisma generate"
},
"dependencies": {
@@ -18,8 +18,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
- "tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3"
+ "tailwind-merge": "^2.6.0"
},
"devDependencies": {
"@types/node": "^22.5.4",
diff --git a/examples/react/start-basic-react-query/.gitignore b/examples/react/start-basic-react-query/.gitignore
index be342025da..ca63f49885 100644
--- a/examples/react/start-basic-react-query/.gitignore
+++ b/examples/react/start-basic-react-query/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/examples/react/start-basic-react-query/app/client.tsx b/examples/react/start-basic-react-query/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/examples/react/start-basic-react-query/app/client.tsx
+++ b/examples/react/start-basic-react-query/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-basic-react-query/app/ssr.tsx b/examples/react/start-basic-react-query/app/ssr.tsx
index 8981a9a338..65a580f25e 100644
--- a/examples/react/start-basic-react-query/app/ssr.tsx
+++ b/examples/react/start-basic-react-query/app/ssr.tsx
@@ -1,4 +1,3 @@
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/examples/react/start-basic-react-query/package.json b/examples/react/start-basic-react-query/package.json
index 31e4737373..6832b69457 100644
--- a/examples/react/start-basic-react-query/package.json
+++ b/examples/react/start-basic-react-query/package.json
@@ -4,9 +4,9 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@tanstack/react-query": "^5.66.0",
@@ -18,8 +18,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
- "tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3"
+ "tailwind-merge": "^2.6.0"
},
"devDependencies": {
"@types/node": "^22.5.4",
diff --git a/examples/react/start-basic-rsc/.gitignore b/examples/react/start-basic-rsc/.gitignore
index d3387e00cd..3c8e6870b3 100644
--- a/examples/react/start-basic-rsc/.gitignore
+++ b/examples/react/start-basic-rsc/.gitignore
@@ -7,12 +7,8 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
diff --git a/examples/react/start-basic-rsc/app/client.tsx b/examples/react/start-basic-rsc/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/examples/react/start-basic-rsc/app/client.tsx
+++ b/examples/react/start-basic-rsc/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-basic-rsc/app/ssr.tsx b/examples/react/start-basic-rsc/app/ssr.tsx
index 8981a9a338..65a580f25e 100644
--- a/examples/react/start-basic-rsc/app/ssr.tsx
+++ b/examples/react/start-basic-rsc/app/ssr.tsx
@@ -1,4 +1,3 @@
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/examples/react/start-basic-rsc/package.json b/examples/react/start-basic-rsc/package.json
index 3450e46e66..a7a543c641 100644
--- a/examples/react/start-basic-rsc/package.json
+++ b/examples/react/start-basic-rsc/package.json
@@ -4,9 +4,9 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@babel/plugin-syntax-typescript": "^7.25.9",
@@ -16,8 +16,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
- "tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3"
+ "tailwind-merge": "^2.6.0"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/start-basic-static/.gitignore b/examples/react/start-basic-static/.gitignore
index be342025da..ca63f49885 100644
--- a/examples/react/start-basic-static/.gitignore
+++ b/examples/react/start-basic-static/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/examples/react/start-basic-static/app/client.tsx b/examples/react/start-basic-static/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/examples/react/start-basic-static/app/client.tsx
+++ b/examples/react/start-basic-static/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-basic-static/app/ssr.tsx b/examples/react/start-basic-static/app/ssr.tsx
index 8981a9a338..65a580f25e 100644
--- a/examples/react/start-basic-static/app/ssr.tsx
+++ b/examples/react/start-basic-static/app/ssr.tsx
@@ -1,4 +1,3 @@
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/examples/react/start-basic-static/package.json b/examples/react/start-basic-static/package.json
index 83f461bb75..a3dce14b35 100644
--- a/examples/react/start-basic-static/package.json
+++ b/examples/react/start-basic-static/package.json
@@ -4,9 +4,9 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@tanstack/react-router": "^1.114.3",
@@ -15,8 +15,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
- "tailwind-merge": "^2.5.5",
- "vinxi": "0.5.1"
+ "tailwind-merge": "^2.5.5"
},
"devDependencies": {
"@types/node": "^22.5.4",
diff --git a/examples/react/start-basic/.gitignore b/examples/react/start-basic/.gitignore
index be342025da..ca63f49885 100644
--- a/examples/react/start-basic/.gitignore
+++ b/examples/react/start-basic/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/examples/react/start-basic/app/client.tsx b/examples/react/start-basic/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/examples/react/start-basic/app/client.tsx
+++ b/examples/react/start-basic/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-basic/app/ssr.tsx b/examples/react/start-basic/app/ssr.tsx
index 8981a9a338..65a580f25e 100644
--- a/examples/react/start-basic/app/ssr.tsx
+++ b/examples/react/start-basic/app/ssr.tsx
@@ -1,4 +1,3 @@
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/examples/react/start-basic/vite.config.ts b/examples/react/start-basic/vite.config.ts
index 1bf4c44472..47532c5353 100644
--- a/examples/react/start-basic/vite.config.ts
+++ b/examples/react/start-basic/vite.config.ts
@@ -1,6 +1,6 @@
import { defineConfig } from 'vite'
import tsConfigPaths from 'vite-tsconfig-paths'
-import { TanStackStartVitePlugin } from '@tanstack/start/plugin'
+import { TanStackStartVitePlugin } from '@tanstack/react-start/plugin'
export default defineConfig({
server: {
diff --git a/examples/react/start-clerk-basic/.gitignore b/examples/react/start-clerk-basic/.gitignore
index b15fed94e2..2818549158 100644
--- a/examples/react/start-clerk-basic/.gitignore
+++ b/examples/react/start-clerk-basic/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.cache
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/examples/react/start-clerk-basic/app/client.tsx b/examples/react/start-clerk-basic/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/examples/react/start-clerk-basic/app/client.tsx
+++ b/examples/react/start-clerk-basic/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-clerk-basic/app/ssr.tsx b/examples/react/start-clerk-basic/app/ssr.tsx
index 363e47546d..ef5ba0bc95 100644
--- a/examples/react/start-clerk-basic/app/ssr.tsx
+++ b/examples/react/start-clerk-basic/app/ssr.tsx
@@ -1,4 +1,3 @@
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/examples/react/start-clerk-basic/package.json b/examples/react/start-clerk-basic/package.json
index 3c6eeed6cd..a5430fc385 100644
--- a/examples/react/start-clerk-basic/package.json
+++ b/examples/react/start-clerk-basic/package.json
@@ -4,9 +4,9 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@clerk/tanstack-start": "0.11.0",
@@ -16,8 +16,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
- "tailwind-merge": "^2.6.0",
- "vinxi": "0.5.3"
+ "tailwind-merge": "^2.6.0"
},
"devDependencies": {
"@types/node": "^22.5.4",
diff --git a/examples/react/start-convex-trellaux/.gitignore b/examples/react/start-convex-trellaux/.gitignore
index 30518e7416..ba7dbddfbe 100644
--- a/examples/react/start-convex-trellaux/.gitignore
+++ b/examples/react/start-convex-trellaux/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
.env.local
diff --git a/examples/react/start-convex-trellaux/.stackblitzrc b/examples/react/start-convex-trellaux/.stackblitzrc
index 2f76846e62..e616ee3a78 100644
--- a/examples/react/start-convex-trellaux/.stackblitzrc
+++ b/examples/react/start-convex-trellaux/.stackblitzrc
@@ -1,3 +1,3 @@
{
- "startCommand": "cp .env.local.example .env.local && npx vinxi dev"
+ "startCommand": "cp .env.local.example .env.local && npx vite dev"
}
diff --git a/examples/react/start-convex-trellaux/app/client.tsx b/examples/react/start-convex-trellaux/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/examples/react/start-convex-trellaux/app/client.tsx
+++ b/examples/react/start-convex-trellaux/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-convex-trellaux/app/ssr.tsx b/examples/react/start-convex-trellaux/app/ssr.tsx
index 8981a9a338..65a580f25e 100644
--- a/examples/react/start-convex-trellaux/app/ssr.tsx
+++ b/examples/react/start-convex-trellaux/app/ssr.tsx
@@ -1,4 +1,3 @@
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/examples/react/start-convex-trellaux/package.json b/examples/react/start-convex-trellaux/package.json
index 793d370a72..cab72fe6fe 100644
--- a/examples/react/start-convex-trellaux/package.json
+++ b/examples/react/start-convex-trellaux/package.json
@@ -5,10 +5,10 @@
"type": "module",
"scripts": {
"dev": "npx convex dev --once && concurrently -r npm:dev:web npm:dev:db",
- "dev:web": "vinxi dev",
+ "dev:web": "vite dev",
"dev:db": "convex dev --run board:seed",
- "build": "vinxi build",
- "start": "vinxi start"
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@convex-dev/react-query": "0.0.0-alpha.8",
@@ -28,7 +28,6 @@
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
"tiny-invariant": "^1.3.3",
- "vinxi": "0.5.3",
"zod": "^3.24.2"
},
"devDependencies": {
diff --git a/examples/react/start-counter/.gitignore b/examples/react/start-counter/.gitignore
index 2b76174be5..08eba9e706 100644
--- a/examples/react/start-counter/.gitignore
+++ b/examples/react/start-counter/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/examples/react/start-counter/app/client.tsx b/examples/react/start-counter/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/examples/react/start-counter/app/client.tsx
+++ b/examples/react/start-counter/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-counter/app/ssr.tsx b/examples/react/start-counter/app/ssr.tsx
index 8981a9a338..65a580f25e 100644
--- a/examples/react/start-counter/app/ssr.tsx
+++ b/examples/react/start-counter/app/ssr.tsx
@@ -1,4 +1,3 @@
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/examples/react/start-counter/package.json b/examples/react/start-counter/package.json
index ca30ed9dc1..6946b37a39 100644
--- a/examples/react/start-counter/package.json
+++ b/examples/react/start-counter/package.json
@@ -4,17 +4,16 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@tanstack/react-router": "^1.114.3",
"@tanstack/react-router-devtools": "^1.114.3",
"@tanstack/react-start": "^1.114.3",
"react": "^19.0.0",
- "react-dom": "^19.0.0",
- "vinxi": "0.5.3"
+ "react-dom": "^19.0.0"
},
"devDependencies": {
"@types/node": "^22.5.4",
diff --git a/examples/react/start-large/.gitignore b/examples/react/start-large/.gitignore
index cb9991202d..ca4ef70bc0 100644
--- a/examples/react/start-large/.gitignore
+++ b/examples/react/start-large/.gitignore
@@ -13,10 +13,7 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
\ No newline at end of file
+/public/build
\ No newline at end of file
diff --git a/examples/react/start-large/app/client.tsx b/examples/react/start-large/app/client.tsx
index c9080c9132..6ef47afdd4 100644
--- a/examples/react/start-large/app/client.tsx
+++ b/examples/react/start-large/app/client.tsx
@@ -1,5 +1,5 @@
// app/client.tsx
-///
+
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-large/app/ssr.tsx b/examples/react/start-large/app/ssr.tsx
index c3bb4cc868..b25c3c5648 100644
--- a/examples/react/start-large/app/ssr.tsx
+++ b/examples/react/start-large/app/ssr.tsx
@@ -1,5 +1,5 @@
// app/ssr.tsx
-///
+
import {
createStartHandler,
defaultStreamHandler,
diff --git a/examples/react/start-large/package.json b/examples/react/start-large/package.json
index 9f4dda61fb..0541ff343b 100644
--- a/examples/react/start-large/package.json
+++ b/examples/react/start-large/package.json
@@ -4,9 +4,9 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start",
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start",
"gen": "node ./app/createRoutes.mjs",
"test:types": "tsc --extendedDiagnostics"
},
@@ -19,8 +19,7 @@
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
- "valibot": "^1.0.0-beta.15",
- "vinxi": "0.5.3"
+ "valibot": "^1.0.0-beta.15"
},
"devDependencies": {
"@types/node": "^22.5.4",
diff --git a/examples/react/start-supabase-basic/.gitignore b/examples/react/start-supabase-basic/.gitignore
index 5578fb7487..8293849e8d 100644
--- a/examples/react/start-supabase-basic/.gitignore
+++ b/examples/react/start-supabase-basic/.gitignore
@@ -9,14 +9,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/examples/react/start-supabase-basic/app/client.tsx b/examples/react/start-supabase-basic/app/client.tsx
index c9080c9132..6ef47afdd4 100644
--- a/examples/react/start-supabase-basic/app/client.tsx
+++ b/examples/react/start-supabase-basic/app/client.tsx
@@ -1,5 +1,5 @@
// app/client.tsx
-///
+
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-supabase-basic/app/ssr.tsx b/examples/react/start-supabase-basic/app/ssr.tsx
index c3bb4cc868..b25c3c5648 100644
--- a/examples/react/start-supabase-basic/app/ssr.tsx
+++ b/examples/react/start-supabase-basic/app/ssr.tsx
@@ -1,5 +1,5 @@
// app/ssr.tsx
-///
+
import {
createStartHandler,
defaultStreamHandler,
diff --git a/examples/react/start-supabase-basic/package.json b/examples/react/start-supabase-basic/package.json
index de512d98ad..6f7bcdd827 100644
--- a/examples/react/start-supabase-basic/package.json
+++ b/examples/react/start-supabase-basic/package.json
@@ -5,9 +5,9 @@
"main": "index.js",
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"keywords": [],
"author": "",
@@ -19,8 +19,7 @@
"@tanstack/react-router-devtools": "^1.114.3",
"@tanstack/react-start": "^1.114.3",
"react": "^19.0.0",
- "react-dom": "^19.0.0",
- "vinxi": "0.5.3"
+ "react-dom": "^19.0.0"
},
"devDependencies": {
"@types/react": "^19.0.8",
diff --git a/examples/react/start-trellaux/.gitignore b/examples/react/start-trellaux/.gitignore
index d3387e00cd..3c8e6870b3 100644
--- a/examples/react/start-trellaux/.gitignore
+++ b/examples/react/start-trellaux/.gitignore
@@ -7,12 +7,8 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
diff --git a/examples/react/start-trellaux/app/client.tsx b/examples/react/start-trellaux/app/client.tsx
index 1593d1b3c7..c5fbaa3c67 100644
--- a/examples/react/start-trellaux/app/client.tsx
+++ b/examples/react/start-trellaux/app/client.tsx
@@ -1,4 +1,3 @@
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/examples/react/start-trellaux/app/ssr.tsx b/examples/react/start-trellaux/app/ssr.tsx
index 8981a9a338..65a580f25e 100644
--- a/examples/react/start-trellaux/app/ssr.tsx
+++ b/examples/react/start-trellaux/app/ssr.tsx
@@ -1,4 +1,3 @@
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/examples/react/start-trellaux/package.json b/examples/react/start-trellaux/package.json
index 04211214bf..0bd9f6253a 100644
--- a/examples/react/start-trellaux/package.json
+++ b/examples/react/start-trellaux/package.json
@@ -4,9 +4,9 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@tanstack/react-query": "^5.66.0",
@@ -23,7 +23,6 @@
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
"tiny-invariant": "^1.3.3",
- "vinxi": "0.5.3",
"zod": "^3.24.2"
},
"devDependencies": {
diff --git a/examples/react/with-trpc-react-query/.gitignore b/examples/react/with-trpc-react-query/.gitignore
index be342025da..ca63f49885 100644
--- a/examples/react/with-trpc-react-query/.gitignore
+++ b/examples/react/with-trpc-react-query/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/examples/react/with-trpc-react-query/app.config.js b/examples/react/with-trpc-react-query/app.config.js
index 1598094be8..c4847edca0 100644
--- a/examples/react/with-trpc-react-query/app.config.js
+++ b/examples/react/with-trpc-react-query/app.config.js
@@ -1,8 +1,10 @@
-import { createApp } from 'vinxi'
+import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react'
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
-export default createApp({
+// TODO: Need to migrate this to vite and the new TanStack Start plugin
+
+export default defineConfig({
server: {
preset: 'node-server', // change to 'netlify' or 'bun' or anyof the supported presets for nitro (nitro.unjs.io)
experimental: {
diff --git a/examples/react/with-trpc-react-query/app/main.tsx b/examples/react/with-trpc-react-query/app/main.tsx
index 4cc69baaac..bda5f47256 100644
--- a/examples/react/with-trpc-react-query/app/main.tsx
+++ b/examples/react/with-trpc-react-query/app/main.tsx
@@ -1,5 +1,3 @@
-///
-
import React from 'react'
import ReactDOM from 'react-dom/client'
import { RouterProvider } from '@tanstack/react-router'
diff --git a/examples/react/with-trpc-react-query/app/router.tsx b/examples/react/with-trpc-react-query/app/router.tsx
index 1dfd9c4131..0d9dd5c4e4 100644
--- a/examples/react/with-trpc-react-query/app/router.tsx
+++ b/examples/react/with-trpc-react-query/app/router.tsx
@@ -15,7 +15,7 @@ export const trpc = createTRPCOptionsProxy({
client: createTRPCClient({
links: [
httpBatchLink({
- // since we are using Vinxi, the server is running on the same port,
+ // since we are using Vite, the server is running on the same port,
// this means in dev the url is `http://localhost:3000/trpc`
// and since its from the same origin, we don't need to explicitly set the full URL
url: '/trpc',
diff --git a/examples/react/with-trpc-react-query/package.json b/examples/react/with-trpc-react-query/package.json
index 549b022de7..f8bc34bf8e 100644
--- a/examples/react/with-trpc-react-query/package.json
+++ b/examples/react/with-trpc-react-query/package.json
@@ -3,9 +3,9 @@
"private": true,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@tanstack/react-query": "^5.66.0",
@@ -23,7 +23,6 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "vinxi": "0.5.3",
"zod": "^3.24.2"
},
"devDependencies": {
diff --git a/examples/react/with-trpc/.gitignore b/examples/react/with-trpc/.gitignore
index be342025da..ca63f49885 100644
--- a/examples/react/with-trpc/.gitignore
+++ b/examples/react/with-trpc/.gitignore
@@ -7,14 +7,10 @@ yarn.lock
.env
.vercel
.output
-.vinxi
-
/build/
/api/
/server/build
-/public/build
-.vinxi
-# Sentry Config File
+/public/build# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
diff --git a/examples/react/with-trpc/app.config.js b/examples/react/with-trpc/app.config.js
index 1598094be8..c4847edca0 100644
--- a/examples/react/with-trpc/app.config.js
+++ b/examples/react/with-trpc/app.config.js
@@ -1,8 +1,10 @@
-import { createApp } from 'vinxi'
+import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react'
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
-export default createApp({
+// TODO: Need to migrate this to vite and the new TanStack Start plugin
+
+export default defineConfig({
server: {
preset: 'node-server', // change to 'netlify' or 'bun' or anyof the supported presets for nitro (nitro.unjs.io)
experimental: {
diff --git a/examples/react/with-trpc/app/main.tsx b/examples/react/with-trpc/app/main.tsx
index 3cff783e4b..ff5d7de693 100644
--- a/examples/react/with-trpc/app/main.tsx
+++ b/examples/react/with-trpc/app/main.tsx
@@ -1,5 +1,3 @@
-///
-
import React from 'react'
import ReactDOM from 'react-dom/client'
import { RouterProvider, createRouter } from '@tanstack/react-router'
diff --git a/examples/react/with-trpc/app/trpc.ts b/examples/react/with-trpc/app/trpc.ts
index 243e4a6f5e..2320dcdfb6 100644
--- a/examples/react/with-trpc/app/trpc.ts
+++ b/examples/react/with-trpc/app/trpc.ts
@@ -4,7 +4,7 @@ import type { AppRouter } from '../trpc-server.handler'
export const trpc = createTRPCClient({
links: [
httpBatchLink({
- // since we are using Vinxi, the server is running on the same port,
+ // since we are using Vite, the server is running on the same port,
// this means in dev the url is `http://localhost:3000/trpc`
// and since its from the same origin, we don't need to explicitly set the full URL
url: '/trpc',
diff --git a/examples/react/with-trpc/package.json b/examples/react/with-trpc/package.json
index 31fc08a2ed..be90fae1bc 100644
--- a/examples/react/with-trpc/package.json
+++ b/examples/react/with-trpc/package.json
@@ -3,9 +3,9 @@
"private": true,
"type": "module",
"scripts": {
- "dev": "vinxi dev",
- "build": "vinxi build",
- "start": "vinxi start"
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
},
"dependencies": {
"@tanstack/react-router": "^1.114.3",
@@ -20,7 +20,6 @@
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
- "vinxi": "0.5.3",
"zod": "^3.24.2"
},
"devDependencies": {
diff --git a/packages/create-router/templates/core/_dot_gitignore b/packages/create-router/templates/core/_dot_gitignore
index ed335a7bdc..bfcf92b4fd 100644
--- a/packages/create-router/templates/core/_dot_gitignore
+++ b/packages/create-router/templates/core/_dot_gitignore
@@ -5,9 +5,7 @@
# Dist
node_modules
-dist/
-.vinxi
-.output
+dist/.output
.vercel
.netlify
.wrangler
diff --git a/packages/create-start/package.json b/packages/create-start/package.json
index 6aaf61475c..63034d0bf7 100644
--- a/packages/create-start/package.json
+++ b/packages/create-start/package.json
@@ -70,7 +70,6 @@
"@types/react-dom": "^19.0.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
- "vinxi": "0.5.1",
"vite": "^6.0.3"
},
"peerDependenciesMeta": {
@@ -98,9 +97,6 @@
"react-dom": {
"optional": true
},
- "vinxi": {
- "optional": true
- },
"vite": {
"optional": true
}
diff --git a/packages/create-start/src/modules/core/index.ts b/packages/create-start/src/modules/core/index.ts
index 79aaf2e8b1..effeb1d66a 100644
--- a/packages/create-start/src/modules/core/index.ts
+++ b/packages/create-start/src/modules/core/index.ts
@@ -68,21 +68,21 @@ export const coreModule = createModule(
'@tanstack/react-start',
'react',
'react-dom',
- 'vinxi',
+ 'vite',
]),
devDependencies: await deps(['@types/react', '@types/react']),
scripts: [
{
name: 'dev',
- script: 'vinxi dev',
+ script: 'vite dev',
},
{
name: 'build',
- script: 'vinxi build',
+ script: 'vite build',
},
{
name: 'start',
- script: 'vinxi start',
+ script: 'vite start',
},
],
...vals.packageJson,
diff --git a/packages/create-start/src/modules/core/template/app/client.tsx b/packages/create-start/src/modules/core/template/app/client.tsx
index 64f18c113f..f675b9c39d 100644
--- a/packages/create-start/src/modules/core/template/app/client.tsx
+++ b/packages/create-start/src/modules/core/template/app/client.tsx
@@ -1,6 +1,5 @@
// @ts-nocheck
-///
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'
diff --git a/packages/create-start/src/modules/core/template/app/ssr.tsx b/packages/create-start/src/modules/core/template/app/ssr.tsx
index 4ab0e48d6f..017f4efa21 100644
--- a/packages/create-start/src/modules/core/template/app/ssr.tsx
+++ b/packages/create-start/src/modules/core/template/app/ssr.tsx
@@ -1,6 +1,5 @@
// @ts-nocheck
-///
import {
createStartHandler,
defaultStreamHandler,
diff --git a/packages/create-start/tests/e2e/templates/barebones.test.ts b/packages/create-start/tests/e2e/templates/barebones.test.ts
index f509937d32..35107d3069 100644
--- a/packages/create-start/tests/e2e/templates/barebones.test.ts
+++ b/packages/create-start/tests/e2e/templates/barebones.test.ts
@@ -65,15 +65,15 @@ describe('barebones template e2e', () => {
expect(pkgJson.dependencies['@tanstack/react-start']).toBeDefined()
expect(pkgJson.dependencies['react']).toBeDefined()
expect(pkgJson.dependencies['react-dom']).toBeDefined()
- expect(pkgJson.dependencies['vinxi']).toBeDefined()
+ expect(pkgJson.dependencies['vite']).toBeDefined()
expect(pkgJson.devDependencies).toBeDefined()
expect(pkgJson.devDependencies['@types/react']).toBeDefined()
expect(pkgJson.scripts).toBeDefined()
- expect(pkgJson.scripts.dev).toBe('vinxi dev')
- expect(pkgJson.scripts.build).toBe('vinxi build')
- expect(pkgJson.scripts.start).toBe('vinxi start')
+ expect(pkgJson.scripts.dev).toBe('vite dev')
+ expect(pkgJson.scripts.build).toBe('vite build')
+ expect(pkgJson.scripts.start).toBe('vite start')
})
})
})
diff --git a/packages/directive-functions-plugin/src/index.ts b/packages/directive-functions-plugin/src/index.ts
index 25ed1df746..5907545538 100644
--- a/packages/directive-functions-plugin/src/index.ts
+++ b/packages/directive-functions-plugin/src/index.ts
@@ -57,8 +57,6 @@ export function TanStackDirectiveFunctionsPlugin(
code,
root: ROOT,
filename: id,
- // globalThis.app currently refers to Vinxi's app instance. In the future, it can just be the
- // vite dev server instance we get from Nitro.
})
opts.onDirectiveFnsById?.(directiveFnsById)
diff --git a/packages/directive-functions-plugin/tests/compiler.test.ts b/packages/directive-functions-plugin/tests/compiler.test.ts
index a7ff05be97..e88114a8ef 100644
--- a/packages/directive-functions-plugin/tests/compiler.test.ts
+++ b/packages/directive-functions-plugin/tests/compiler.test.ts
@@ -697,8 +697,6 @@ describe('server function compilation', () => {
.extractedFilename,
})
- console.log(ssr.directiveFnsById)
-
expect(client.compiledResult.code).toMatchInlineSnapshot(`
"'use server';
diff --git a/packages/react-start-api-routes/package.json b/packages/react-start-api-routes/package.json
index cfff1fd6f1..8189bdea63 100644
--- a/packages/react-start-api-routes/package.json
+++ b/packages/react-start-api-routes/package.json
@@ -63,8 +63,7 @@
},
"dependencies": {
"@tanstack/router-core": "workspace:^",
- "@tanstack/react-start-server": "workspace:^",
- "vinxi": "0.5.3"
+ "@tanstack/react-start-server": "workspace:^"
},
"devDependencies": {
"typescript": "^5.7.2"
diff --git a/packages/react-start-api-routes/src/index.ts b/packages/react-start-api-routes/src/index.ts
index 9ee1fc8ac1..ad9cb44821 100644
--- a/packages/react-start-api-routes/src/index.ts
+++ b/packages/react-start-api-routes/src/index.ts
@@ -1,5 +1,4 @@
import { eventHandler, toWebRequest } from '@tanstack/react-start-server'
-import vinxiFileRoutes from 'vinxi/routes'
import type { ResolveParams } from '@tanstack/router-core'
export type StartAPIHandlerCallback = (ctx: {
@@ -229,9 +228,9 @@ interface CustomizedVinxiFileRoute {
/**
* This is populated by the work done in the config file using the tsrFileRouter
*/
-const vinxiRoutes = (
- vinxiFileRoutes as unknown as Array
-).filter((route) => route['$APIRoute'])
+// const vinxiRoutes = (
+// vinxiFileRoutes as unknown as Array
+// ).filter((route) => route['$APIRoute'])
/**
* This function takes the vinxi routes and interpolates them into a format that can be worked with in the API handler
@@ -313,16 +312,20 @@ function toTSRFileBasedRoutes(
export const defaultAPIFileRouteHandler: StartAPIHandlerCallback = async ({
request,
}) => {
- // Simple early abort if there are no routes
- if (!vinxiRoutes.length) {
- return new Response('No routes found', { status: 404 })
+ // TODO: We need to reimplement api file routes without vinx-i
+ if (Math.random()) {
+ throw new Error('Not implemented')
}
+ // Simple early abort if there are no routes
+ // if (!vinxiRoutes.length) {
+ // return new Response('No routes found', { status: 404 })
+ // }
if (!HTTP_API_METHODS.includes(request.method as HTTP_API_METHOD)) {
return new Response('Method not allowed', { status: 405 })
}
- const routes = toTSRFileBasedRoutes(vinxiRoutes)
+ const routes = toTSRFileBasedRoutes([])
const url = new URL(request.url, 'http://localhost:3000')
diff --git a/packages/react-start-client/package.json b/packages/react-start-client/package.json
index 8b59146167..612f71d792 100644
--- a/packages/react-start-client/package.json
+++ b/packages/react-start-client/package.json
@@ -68,8 +68,7 @@
"cookie-es": "^1.2.2",
"jsesc": "^3.1.0",
"tiny-invariant": "^1.3.3",
- "tiny-warning": "^1.0.3",
- "vinxi": "^0.5.3"
+ "tiny-warning": "^1.0.3"
},
"devDependencies": {
"@testing-library/react": "^16.2.0",
diff --git a/packages/react-start-client/src/index.tsx b/packages/react-start-client/src/index.tsx
index bc97adc78e..00dc9d8996 100644
--- a/packages/react-start-client/src/index.tsx
+++ b/packages/react-start-client/src/index.tsx
@@ -1,4 +1,3 @@
-///
export {
createIsomorphicFn,
type IsomorphicFn,
diff --git a/packages/react-start-client/src/renderRSC.tsx b/packages/react-start-client/src/renderRSC.tsx
index 6201bfa476..4832f074b6 100644
--- a/packages/react-start-client/src/renderRSC.tsx
+++ b/packages/react-start-client/src/renderRSC.tsx
@@ -1,6 +1,4 @@
// TODO: RSCs
-// // @ts-expect-error
-// import * as reactDom from '@vinxi/react-server-dom/client'
import { isValidElement } from 'react'
import invariant from 'tiny-invariant'
import type React from 'react'
diff --git a/packages/react-start-plugin/src/index.ts b/packages/react-start-plugin/src/index.ts
index a649b905f2..076820022e 100644
--- a/packages/react-start-plugin/src/index.ts
+++ b/packages/react-start-plugin/src/index.ts
@@ -1,8 +1,3 @@
-// import { importMetaResolve } from 'import-meta-resolve'
-// // @ts-expect-error
-// import { serverComponents } from '@vinxi/server-components/plugin'
-
-// import { tanstackStartVinxiFileRouter } from './vinxi-file-router.js'
import path from 'node:path'
import { createTanStackServerFnPlugin } from '@tanstack/server-functions-plugin'
import { mergeConfig, perEnvironmentPlugin } from 'vite'
@@ -32,19 +27,19 @@ export function TanStackStartVitePlugin(
manifestVirtualImportId: 'tsr:server-fn-manifest',
client: {
getRuntimeCode: () =>
- `import { createClientRpc } from '@tanstack/start/server-functions-client'`,
+ `import { createClientRpc } from '@tanstack/react-start/server-functions-client'`,
replacer: (d) =>
`createClientRpc('${d.functionId}', '${options.routers.server.base}')`,
},
ssr: {
getRuntimeCode: () =>
- `import { createSsrRpc } from '@tanstack/start/server-functions-ssr'`,
+ `import { createSsrRpc } from '@tanstack/react-start/server-functions-ssr'`,
replacer: (d) =>
`createSsrRpc('${d.functionId}', '${options.routers.server.base}')`,
},
server: {
getRuntimeCode: () =>
- `import { createServerRpc } from '@tanstack/start/server-functions-server'`,
+ `import { createServerRpc } from '@tanstack/react-start/server-functions-server'`,
replacer: (d) =>
`createServerRpc('${d.functionId}', '${options.routers.server.base}', ${d.fn})`,
},
@@ -135,15 +130,20 @@ export function TanStackStartVitePlugin(
? TanStackServerFnsPlugin.client
: TanStackServerFnsPlugin.server,
),
- perEnvironmentPlugin(
- 'tanstack-router-manifest-plugin',
- (environment) =>
- environment.name === 'ssr' &&
- tsrRoutesManifestPlugin({
- clientBase: options.routers.client.base,
- tsrConfig: options.tsr,
- }),
- ),
+ // perEnvironmentPlugin(
+ // 'tanstack-router-manifest-plugin',
+ // (environment) =>
+ // environment.name === 'ssr' &&
+ // tsrRoutesManifestPlugin({
+ // clientBase: options.routers.client.base,
+ // tsrConfig: options.tsr,
+ // }),
+ // ),
+ // TODO: Should this only be loaded for ssr? like above?
+ tsrRoutesManifestPlugin({
+ clientBase: options.routers.client.base,
+ tsrConfig: options.tsr,
+ }),
nitroPlugin({
...options,
server: {
@@ -172,31 +172,6 @@ export function TanStackStartVitePlugin(
]
}
-// // Because Vinxi doesn't use the normal nitro dev server, it doesn't
-// // supply $fetch during dev. We need to hook into the dev server creation,
-// // nab the proper utils from the custom nitro instance that is used
-// // during dev and supply the $fetch to app.
-// // Hopefully and likely, this will just get removed when we move to
-// // Nitro directly.
-// vinxiApp.hooks.hook('app:dev:nitro:config', (devServer) => {
-// vinxiApp.hooks.hook(
-// 'app:dev:server:created',
-// ({ devApp: { localFetch } }) => {
-// const $fetch = createFetch({
-// fetch: localFetch,
-// defaults: {
-// baseURL: devServer.nitro.options.runtimeConfig.app.baseURL,
-// },
-// })
-
-// // @ts-expect-error
-// globalThis.$fetch = $fetch
-// },
-// )
-// })
-
-// return vinxiApp
-
function injectDefineEnv(
key: TKey,
value: TValue,
diff --git a/packages/react-start-plugin/src/nitro/nitro-plugin.ts b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
index f620a9fff6..18c073ce9e 100644
--- a/packages/react-start-plugin/src/nitro/nitro-plugin.ts
+++ b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
@@ -1,8 +1,6 @@
import { dirname, resolve } from 'node:path'
-import { writeFileSync } from 'node:fs'
import { platform } from 'node:os'
import { fileURLToPath } from 'node:url'
-import { build, createDevServer, createNitro } from 'nitropack'
import { normalizePath } from 'vite'
import { buildServer } from './build-server.js'
@@ -96,50 +94,6 @@ export function nitroPlugin(
'#start/ssr': options.ssrEntryPath,
}
- if (isBuild) {
- nitroConfig.publicAssets = [{ dir: clientOutputPath }]
- nitroConfig.serverAssets = [
- {
- baseName: 'public',
- dir: clientOutputPath,
- },
- ]
- nitroConfig.renderer = rendererEntry
-
- if (ssrBuild) {
- if (isWindows) {
- // Write out the renderer manually because
- // Windows doesn't resolve the aliases
- // correctly in its native environment
- writeFileSync(
- normalizePath(rendererEntry.replace(filePrefix, '')),
- `
- /**
- * This file is shipped as ESM for Windows support,
- * as it won't resolve the renderer.ts file correctly in node.
- */
- import ssrEntry from '${options.ssrEntryPath}';
- export default ssrEntry
- `,
- )
-
- nitroConfig.externals = {
- inline: ['std-env'],
- }
- }
-
- nitroConfig = {
- ...nitroConfig,
- externals: {
- ...nitroConfig.externals,
- external: ['node-fetch-native/dist/polyfill'],
- },
- // moduleSideEffects: [],
- handlers: [],
- }
- }
- }
-
return {
environments: {
ssr: {
@@ -155,6 +109,7 @@ export function nitroPlugin(
builder: {
sharedPlugins: true,
buildApp: async (builder) => {
+ console.log('tanner buildApp', builder)
environmentBuild = true
if (!builder.environments['client']) {
@@ -190,32 +145,33 @@ export function nitroPlugin(
}
},
async configureServer(viteServer: ViteDevServer) {
- if (isServe && !isTest) {
- const nitro = await createNitro({
- dev: true,
- ...nitroConfig,
- })
- const server = createDevServer(nitro)
-
- await build(nitro)
-
- // viteServer.middlewares.use(
- // apiBase,
- // toNodeListener(server.app as unknown as App),
- // )
-
- viteServer.httpServer?.once('listening', () => {
- process.env['START_HOST'] = !viteServer.config.server.host
- ? 'localhost'
- : (viteServer.config.server.host as string)
- process.env['START_PORT'] = `${viteServer.config.server.port}`
- })
-
- // handle upgrades if websockets are enabled
- if (nitroConfig.experimental?.websocket) {
- viteServer.httpServer?.on('upgrade', server.upgrade)
- }
- }
+ return // TODO: We'll remove this when we're ready for non-entry routes
+ // if (isServe && !isTest) {
+ // const nitro = await createNitro({
+ // dev: true,
+ // ...nitroConfig,
+ // })
+
+ // const server = createDevServer(nitro)
+ // await build(nitro)
+
+ // // viteServer.middlewares.use(
+ // // apiBase,
+ // // toNodeListener(server.app as unknown as App),
+ // // )
+
+ // viteServer.httpServer?.once('listening', () => {
+ // process.env['START_HOST'] = !viteServer.config.server.host
+ // ? 'localhost'
+ // : (viteServer.config.server.host as string)
+ // process.env['START_PORT'] = `${viteServer.config.server.port}`
+ // })
+
+ // // handle upgrades if websockets are enabled
+ // if (nitroConfig.experimental?.websocket) {
+ // viteServer.httpServer?.on('upgrade', server.upgrade)
+ // }
+ // }
},
async closeBundle() {
// Skip when build is triggered by the Environment API
diff --git a/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts b/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts
index 912361c336..5781f4979a 100644
--- a/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts
+++ b/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts
@@ -16,6 +16,7 @@ export function devServerPlugin(options: TanStackStartOutputConfig): Plugin {
config(userConfig, { mode }) {
// config = userConfig
isTest = isTest ? isTest : mode === 'test'
+
return {
resolve: {
alias: {
@@ -34,20 +35,11 @@ export function devServerPlugin(options: TanStackStartOutputConfig): Plugin {
registerDevServerMiddleware(options.root, viteServer)
viteServer.middlewares.use(async (req, res) => {
- const template = await viteServer.transformIndexHtml(
- req.originalUrl as string,
- `
-
-
- `,
- )
-
- console.log('template, maybe use?', template)
-
try {
const serverEntry = (
await viteServer.ssrLoadModule('~start/ssr-entry')
)['default']
+
const event = createEvent(req, res)
const result: string | Response = await serverEntry(event)
diff --git a/packages/react-start-plugin/src/nitro/vite-plugin-nitro.ts b/packages/react-start-plugin/src/nitro/vite-plugin-nitro.ts
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/packages/react-start-router-manifest/package.json b/packages/react-start-router-manifest/package.json
index 23f2ab74c5..758b86367d 100644
--- a/packages/react-start-router-manifest/package.json
+++ b/packages/react-start-router-manifest/package.json
@@ -59,8 +59,7 @@
},
"dependencies": {
"@tanstack/router-core": "workspace:^",
- "tiny-invariant": "^1.3.3",
- "vinxi": "0.5.3"
+ "tiny-invariant": "^1.3.3"
},
"devDependencies": {
"typescript": "^5.7.2"
diff --git a/packages/react-start-router-manifest/src/index.ts b/packages/react-start-router-manifest/src/index.ts
index 3f0a37f609..c6749527d5 100644
--- a/packages/react-start-router-manifest/src/index.ts
+++ b/packages/react-start-router-manifest/src/index.ts
@@ -1,7 +1,5 @@
// @ts-expect-error
import tsrGetManifest from 'tsr:routes-manifest'
-import { getManifest } from 'vinxi/manifest'
-import { default as invariant } from 'tiny-invariant'
import type { Manifest } from '@tanstack/router-core'
function sanitizeBase(base: string) {
@@ -39,23 +37,23 @@ export function getFullRouterManifest() {
}
// Get the entry for the client from vinxi
- const vinxiClientManifest = getManifest('client')
+ // const vinxiClientManifest = getManifest('client')
- const importPath =
- vinxiClientManifest.inputs[vinxiClientManifest.handler]?.output.path
- if (!importPath) {
- invariant(importPath, 'Could not find client entry in vinxi manifest')
- }
+ // const importPath =
+ // vinxiClientManifest.inputs[vinxiClientManifest.handler]?.output.path
+ // if (!importPath) {
+ // invariant(importPath, 'Could not find client entry in vinxi manifest')
+ // }
- rootRoute.assets.push({
- tag: 'script',
- attrs: {
- type: 'module',
- suppressHydrationWarning: true,
- async: true,
- },
- children: `${script}import("${importPath}")`,
- })
+ // rootRoute.assets.push({
+ // tag: 'script',
+ // attrs: {
+ // type: 'module',
+ // suppressHydrationWarning: true,
+ // async: true,
+ // },
+ // children: `${script}import("${importPath}")`,
+ // })
return routerManifest
}
diff --git a/packages/react-start-server-functions-handler/src/index.ts b/packages/react-start-server-functions-handler/src/index.ts
index c2b039a7b3..4139afcd22 100644
--- a/packages/react-start-server-functions-handler/src/index.ts
+++ b/packages/react-start-server-functions-handler/src/index.ts
@@ -208,11 +208,11 @@ async function handleServerRequest({
// return result.result
// }
- // TODO: RSCs
+ // TODO: RSCs Where are we getting this package?
// if (isValidElement(result)) {
// const { renderToPipeableStream } = await import(
// // @ts-expect-error
- // '@vinxi/react-server-dom/server'
+ // 'react-server-dom/server'
// )
// const pipeableStream = renderToPipeableStream(result)
diff --git a/packages/react-start/vite.config.ts b/packages/react-start/vite.config.ts
index dd8d715d1d..8e960afd50 100644
--- a/packages/react-start/vite.config.ts
+++ b/packages/react-start/vite.config.ts
@@ -17,6 +17,7 @@ export default mergeConfig(
entry: [
'./src/client.tsx',
'./src/server.tsx',
+ './src/plugin.ts',
'./src/router-manifest.tsx',
'./src/server-functions-client.tsx',
'./src/server-functions-server.tsx',
@@ -26,6 +27,7 @@ export default mergeConfig(
externalDeps: [
'@tanstack/react-start-client',
'@tanstack/react-start-server',
+ '@tanstack/react-start-plugin',
'@tanstack/react-start-router-manifest',
'@tanstack/react-start-server-functions-client',
'@tanstack/start-server-functions-server',
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@component.tsx
index 94fb102889..8e73632781 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@component.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@component.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
@@ -502,7 +502,7 @@ const SplitComponent = function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@errorComponent.tsx
index 0a4fcf7cd8..ebd0862514 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@errorComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@errorComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@notFoundComponent.tsx
index 0a4fcf7cd8..ebd0862514 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@notFoundComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@notFoundComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@pendingComponent.tsx
index 0a4fcf7cd8..ebd0862514 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@pendingComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/development/useStateDestructure@pendingComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@component.tsx
index 94fb102889..8e73632781 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@component.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@component.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
@@ -502,7 +502,7 @@ const SplitComponent = function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@errorComponent.tsx
index 0a4fcf7cd8..ebd0862514 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@errorComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@errorComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@notFoundComponent.tsx
index 0a4fcf7cd8..ebd0862514 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@notFoundComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@notFoundComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@pendingComponent.tsx
index 0a4fcf7cd8..ebd0862514 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@pendingComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/production/useStateDestructure@pendingComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/development/useStateDestructure@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/development/useStateDestructure@component---errorComponent---notFoundComponent---pendingComponent.tsx
index 94fb102889..8e73632781 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/development/useStateDestructure@component---errorComponent---notFoundComponent---pendingComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/development/useStateDestructure@component---errorComponent---notFoundComponent---pendingComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
@@ -502,7 +502,7 @@ const SplitComponent = function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/development/useStateDestructure@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/development/useStateDestructure@loader.tsx
index 0a4fcf7cd8..ebd0862514 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/development/useStateDestructure@loader.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/development/useStateDestructure@loader.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/production/useStateDestructure@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/production/useStateDestructure@component---errorComponent---notFoundComponent---pendingComponent.tsx
index 94fb102889..8e73632781 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/production/useStateDestructure@component---errorComponent---notFoundComponent---pendingComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/production/useStateDestructure@component---errorComponent---notFoundComponent---pendingComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
@@ -502,7 +502,7 @@ const SplitComponent = function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/production/useStateDestructure@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/production/useStateDestructure@loader.tsx
index 0a4fcf7cd8..ebd0862514 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/production/useStateDestructure@loader.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/production/useStateDestructure@loader.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/development/useStateDestructure@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/development/useStateDestructure@component---loader---notFoundComponent---pendingComponent.tsx
index 94fb102889..8e73632781 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/development/useStateDestructure@component---loader---notFoundComponent---pendingComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/development/useStateDestructure@component---loader---notFoundComponent---pendingComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
@@ -502,7 +502,7 @@ const SplitComponent = function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/development/useStateDestructure@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/development/useStateDestructure@errorComponent.tsx
index 0a4fcf7cd8..ebd0862514 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/development/useStateDestructure@errorComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/development/useStateDestructure@errorComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/production/useStateDestructure@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/production/useStateDestructure@component---loader---notFoundComponent---pendingComponent.tsx
index 94fb102889..8e73632781 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/production/useStateDestructure@component---loader---notFoundComponent---pendingComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/production/useStateDestructure@component---loader---notFoundComponent---pendingComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
@@ -502,7 +502,7 @@ const SplitComponent = function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/production/useStateDestructure@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/production/useStateDestructure@errorComponent.tsx
index 0a4fcf7cd8..ebd0862514 100644
--- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/production/useStateDestructure@errorComponent.tsx
+++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/production/useStateDestructure@errorComponent.tsx
@@ -108,7 +108,7 @@ export default function VersionIndex() {
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
+ powered by TanStack Router , {' '}
Nitro and Vite . Ready to deploy to
your favorite hosting provider.
diff --git a/packages/router-plugin/tests/code-splitter/test-files/react/useStateDestructure.tsx b/packages/router-plugin/tests/code-splitter/test-files/react/useStateDestructure.tsx
index 6a1a086eaf..8f79e69bf0 100644
--- a/packages/router-plugin/tests/code-splitter/test-files/react/useStateDestructure.tsx
+++ b/packages/router-plugin/tests/code-splitter/test-files/react/useStateDestructure.tsx
@@ -159,9 +159,9 @@ export default function VersionIndex() {
lg:text-xl lg:max-w-[600px]"
>
Full-document SSR, Streaming, Server Functions, bundling and more,
- powered by TanStack Router , Vinxi ,{' '}
- Nitro and Vite . Ready to deploy to
- your favorite hosting provider.
+ powered by TanStack Router , Nitro {' '}
+ and Vite . Ready to deploy to your favorite hosting
+ provider.
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 66f4bd092d..70a55473e2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -847,9 +847,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.2
version: 3.24.2
@@ -920,9 +917,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -990,9 +984,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1054,9 +1045,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -1097,9 +1085,6 @@ importers:
react-dom:
specifier: ^19.0.0
version: 19.0.0(react@19.0.0)
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@tanstack/router-e2e-utils':
specifier: workspace:^
@@ -1143,9 +1128,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -1207,9 +1189,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.2
version: 3.24.2
@@ -1277,9 +1256,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.2
version: 3.24.2
@@ -1347,9 +1323,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.2
version: 3.24.2
@@ -3469,10 +3442,10 @@ importers:
version: 19.0.3(@types/react@19.0.8)
html-webpack-plugin:
specifier: ^5.6.3
- version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
+ version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1)
swc-loader:
specifier: ^0.2.6
- version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
+ version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1)
typescript:
specifier: ^5.7.2
version: 5.8.2
@@ -4151,9 +4124,6 @@ importers:
react-dom:
specifier: ^19.0.0
version: 19.0.0(react@19.0.0)
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.2
version: 3.24.2
@@ -4261,9 +4231,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@types/node':
specifier: ^22.5.4
@@ -4322,9 +4289,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@types/node':
specifier: ^22.5.4
@@ -4377,9 +4341,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -4426,9 +4387,6 @@ importers:
tailwind-merge:
specifier: ^2.5.5
version: 2.6.0
- vinxi:
- specifier: 0.5.1
- version: 0.5.1(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@types/node':
specifier: ^22.5.4
@@ -4481,9 +4439,6 @@ importers:
tailwind-merge:
specifier: ^2.6.0
version: 2.6.0
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@types/node':
specifier: ^22.5.4
@@ -4563,9 +4518,6 @@ importers:
tiny-invariant:
specifier: ^1.3.3
version: 1.3.3
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.2
version: 3.24.2
@@ -4609,9 +4561,6 @@ importers:
react-dom:
specifier: ^19.0.0
version: 19.0.0(react@19.0.0)
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@types/node':
specifier: ^22.5.4
@@ -4654,10 +4603,7 @@ importers:
version: 2.6.0
valibot:
specifier: ^1.0.0-beta.15
- version: 1.0.0-beta.15(typescript@5.8.2)
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
+ version: 1.0.0-beta.15(typescript@5.7.3)
devDependencies:
'@types/node':
specifier: ^22.5.4
@@ -4765,9 +4711,6 @@ importers:
react-dom:
specifier: ^19.0.0
version: 19.0.0(react@19.0.0)
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -4835,9 +4778,6 @@ importers:
tiny-invariant:
specifier: ^1.3.3
version: 1.3.3
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.2
version: 3.24.2
@@ -4951,9 +4891,6 @@ importers:
tailwindcss:
specifier: ^3.4.17
version: 3.4.17
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.2
version: 3.24.2
@@ -5015,9 +4952,6 @@ importers:
tailwindcss:
specifier: ^3.4.17
version: 3.4.17
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.2
version: 3.24.2
@@ -5468,7 +5402,7 @@ importers:
version: 7.0.6
html-webpack-plugin:
specifier: ^5.6.0
- version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
+ version: 5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1)
picocolors:
specifier: ^1.1.1
version: 1.1.1
@@ -5480,7 +5414,7 @@ importers:
version: 19.0.0(react@19.0.0)
swc-loader:
specifier: ^0.2.6
- version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
+ version: 0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1)
tinyglobby:
specifier: ^0.2.10
version: 0.2.12
@@ -5578,9 +5512,6 @@ importers:
validate-npm-package-name:
specifier: ^6.0.0
version: 6.0.0
- vinxi:
- specifier: 0.5.1
- version: 0.5.1(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
vite:
specifier: 6.1.0
version: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
@@ -5808,9 +5739,6 @@ importers:
'@tanstack/router-core':
specifier: workspace:*
version: link:../router-core
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
typescript:
specifier: ^5.7.2
@@ -5842,9 +5770,6 @@ importers:
tiny-warning:
specifier: ^1.0.3
version: 1.0.3
- vinxi:
- specifier: ^0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
'@testing-library/react':
specifier: ^16.2.0
@@ -5990,9 +5915,6 @@ importers:
tiny-invariant:
specifier: ^1.3.3
version: 1.3.3
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
typescript:
specifier: ^5.7.2
@@ -14715,10 +14637,6 @@ packages:
resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
engines: {node: '>= 0.8'}
- vinxi@0.5.1:
- resolution: {integrity: sha512-jvl2hJ0fyWwfDVQdDDHCJiVxqU4k0A6kFAnljS0kIjrGfhdTvKEWIoj0bcJgMyrKhxNMoZZGmHZsstQgjDIL3g==}
- hasBin: true
-
vinxi@0.5.3:
resolution: {integrity: sha512-4sL2SMrRzdzClapP44oXdGjCE1oq7/DagsbjY5A09EibmoIO4LP8ScRVdh03lfXxKRk7nCWK7n7dqKvm+fp/9w==}
hasBin: true
@@ -18742,17 +18660,17 @@ snapshots:
'@webassemblyjs/ast': 1.14.1
'@xtuc/long': 4.2.2
- '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))':
+ '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.97.1)':
dependencies:
webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
webpack-cli: 5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1)
- '@webpack-cli/info@2.0.2(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))':
+ '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.97.1)':
dependencies:
webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
webpack-cli: 5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1)
- '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack-dev-server@5.2.0(webpack-cli@5.1.4)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))':
+ '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.2.0)(webpack@5.97.1)':
dependencies:
webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
webpack-cli: 5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1)
@@ -20719,7 +20637,7 @@ snapshots:
html-tags@3.3.1: {}
- html-webpack-plugin@5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
+ html-webpack-plugin@5.6.3(@rspack/core@1.2.2(@swc/helpers@0.5.15))(webpack@5.97.1):
dependencies:
'@types/html-minifier-terser': 6.1.0
html-minifier-terser: 6.1.0
@@ -23016,7 +22934,7 @@ snapshots:
csso: 5.0.5
picocolors: 1.1.1
- swc-loader@0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
+ swc-loader@0.2.6(@swc/core@1.10.15(@swc/helpers@0.5.15))(webpack@5.97.1):
dependencies:
'@swc/core': 1.10.15(@swc/helpers@0.5.15)
'@swc/counter': 0.1.3
@@ -23106,26 +23024,26 @@ snapshots:
type-fest: 2.19.0
unique-string: 3.0.0
- terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
+ terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)):
dependencies:
'@jridgewell/trace-mapping': 0.3.25
jest-worker: 27.5.1
schema-utils: 4.3.0
serialize-javascript: 6.0.2
terser: 5.37.0
- webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
+ webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)
optionalDependencies:
'@swc/core': 1.10.15(@swc/helpers@0.5.15)
esbuild: 0.25.0
- terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)):
+ terser-webpack-plugin@5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1):
dependencies:
'@jridgewell/trace-mapping': 0.3.25
jest-worker: 27.5.1
schema-utils: 4.3.0
serialize-javascript: 6.0.2
terser: 5.37.0
- webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)
+ webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
optionalDependencies:
'@swc/core': 1.10.15(@swc/helpers@0.5.15)
esbuild: 0.25.0
@@ -23547,85 +23465,6 @@ snapshots:
vary@1.1.2: {}
- vinxi@0.5.1(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0):
- dependencies:
- '@babel/core': 7.26.8
- '@babel/plugin-syntax-jsx': 7.25.9(@babel/core@7.26.8)
- '@babel/plugin-syntax-typescript': 7.25.9(@babel/core@7.26.8)
- '@types/micromatch': 4.0.9
- '@vinxi/listhen': 1.5.6
- boxen: 7.1.1
- chokidar: 3.6.0
- citty: 0.1.6
- consola: 3.4.0
- crossws: 0.3.3
- dax-sh: 0.39.2
- defu: 6.1.4
- es-module-lexer: 1.6.0
- esbuild: 0.20.2
- fast-glob: 3.3.3
- get-port-please: 3.1.2
- h3: 1.13.0
- hookable: 5.5.3
- http-proxy: 1.18.1
- micromatch: 4.0.8
- nitropack: 2.10.4(typescript@5.8.2)
- node-fetch-native: 1.6.6
- path-to-regexp: 6.3.0
- pathe: 1.1.2
- radix3: 1.1.2
- resolve: 1.22.10
- serve-placeholder: 2.0.2
- serve-static: 1.16.2
- ufo: 1.5.4
- unctx: 2.4.1
- unenv: 1.10.0
- unstorage: 1.14.4(db0@0.2.3)(ioredis@5.4.2)
- vite: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
- zod: 3.24.2
- transitivePeerDependencies:
- - '@azure/app-configuration'
- - '@azure/cosmos'
- - '@azure/data-tables'
- - '@azure/identity'
- - '@azure/keyvault-secrets'
- - '@azure/storage-blob'
- - '@capacitor/preferences'
- - '@deno/kv'
- - '@electric-sql/pglite'
- - '@libsql/client'
- - '@netlify/blobs'
- - '@planetscale/database'
- - '@types/node'
- - '@upstash/redis'
- - '@vercel/blob'
- - '@vercel/kv'
- - aws4fetch
- - better-sqlite3
- - db0
- - debug
- - drizzle-orm
- - encoding
- - idb-keyval
- - ioredis
- - jiti
- - less
- - lightningcss
- - mysql2
- - rolldown
- - sass
- - sass-embedded
- - sqlite3
- - stylus
- - sugarss
- - supports-color
- - terser
- - tsx
- - typescript
- - uploadthing
- - xml2js
- - yaml
-
vinxi@0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0):
dependencies:
'@babel/core': 7.26.8
@@ -23994,9 +23833,9 @@ snapshots:
webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1):
dependencies:
'@discoveryjs/json-ext': 0.5.7
- '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
- '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
- '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4(webpack-dev-server@5.2.0)(webpack@5.97.1))(webpack-dev-server@5.2.0(webpack-cli@5.1.4)(webpack@5.97.1))(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
+ '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.97.1)
+ '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4)(webpack@5.97.1)
+ '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.2.0)(webpack@5.97.1)
colorette: 2.0.20
commander: 10.0.1
cross-spawn: 7.0.6
@@ -24010,7 +23849,7 @@ snapshots:
optionalDependencies:
webpack-dev-server: 5.2.0(webpack-cli@5.1.4)(webpack@5.97.1)
- webpack-dev-middleware@7.4.2(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)):
+ webpack-dev-middleware@7.4.2(webpack@5.97.1):
dependencies:
colorette: 2.0.20
memfs: 4.17.0
@@ -24048,7 +23887,7 @@ snapshots:
serve-index: 1.9.1
sockjs: 0.3.24
spdy: 4.0.2
- webpack-dev-middleware: 7.4.2(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
+ webpack-dev-middleware: 7.4.2(webpack@5.97.1)
ws: 8.18.0
optionalDependencies:
webpack: 5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4)
@@ -24123,7 +23962,7 @@ snapshots:
neo-async: 2.6.2
schema-utils: 3.3.0
tapable: 2.2.1
- terser-webpack-plugin: 5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack-cli@5.1.4))
+ terser-webpack-plugin: 5.3.11(@swc/core@1.10.15(@swc/helpers@0.5.15))(esbuild@0.25.0)(webpack@5.97.1)
watchpack: 2.4.2
webpack-sources: 3.2.3
optionalDependencies:
From 64c76dd277a163542f47a406b925ad035e33a2b5 Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Fri, 7 Mar 2025 01:30:03 -0700
Subject: [PATCH 018/155] checkpoint
---
.github/labeler.yml | 2 -
e2e/react-start/basic/app/ssr.tsx | 13 +-
examples/react/start-basic/app/ssr.tsx | 16 +-
examples/react/start-basic/vite.config.ts | 2 +-
package.json | 2 -
.../src/compilers.ts | 4 +
.../directive-functions-plugin/src/index.ts | 144 ++++-
packages/react-router/src/fileRoute.ts | 40 +-
packages/react-start-plugin/package.json | 1 +
packages/react-start-plugin/src/compilers.ts | 7 +-
packages/react-start-plugin/src/index.ts | 157 ++----
.../src/nitro/nitro-plugin.ts | 159 +-----
.../src/nitro/plugins/dev-server-plugin.ts | 82 ++-
.../src/nitro/utils/load-esm.ts | 27 -
.../nitro/utils/register-dev-middleware.ts | 25 -
.../src/routesManifestPlugin.ts | 12 +-
packages/react-start-plugin/src/server-fns.ts | 178 -------
.../src/start-compiler-plugin.ts | 150 ++++++
packages/react-start-plugin/vite.config.ts | 1 +
.../react-start-router-manifest/README.md | 33 --
.../eslint.config.js | 31 --
.../react-start-router-manifest/package.json | 67 ---
.../react-start-router-manifest/tsconfig.json | 10 -
.../vite.config.ts | 22 -
.../README.md | 33 --
.../eslint.config.js | 31 --
.../package.json | 80 ---
.../tsconfig.json | 7 -
.../vite.config.ts | 23 -
.../src/createStartHandler.ts | 21 +-
packages/react-start-server/src/h3.ts | 498 +++++++++++++++++
packages/react-start-server/src/index.tsx | 503 +-----------------
.../src/router-manifest.ts} | 60 +--
.../src/server-functions-handler.ts} | 20 +-
packages/react-start-server/tsconfig.json | 7 +-
packages/react-start-server/vite.config.ts | 1 +
packages/react-start/package.json | 22 -
packages/react-start/src/router-manifest.tsx | 1 -
.../src/server-functions-handler.tsx | 1 -
packages/react-start/vite.config.ts | 2 -
.../src/core/code-splitter/compilers.ts | 3 +
.../src/core/router-code-splitter-plugin.ts | 7 +-
packages/router-utils/src/ast.ts | 8 -
packages/server-functions-plugin/src/index.ts | 159 +++++-
packages/start-plugin/package.json | 1 +
.../package.json | 3 +-
packages/start/package.json | 22 -
packages/start/src/router-manifest.tsx | 4 -
.../start/src/server-functions-handler.tsx | 4 -
packages/start/vite.config.ts | 2 -
pnpm-lock.yaml | 74 +--
scripts/publish.js | 8 -
52 files changed, 1206 insertions(+), 1584 deletions(-)
delete mode 100644 packages/react-start-plugin/src/nitro/utils/load-esm.ts
delete mode 100644 packages/react-start-plugin/src/nitro/utils/register-dev-middleware.ts
delete mode 100644 packages/react-start-plugin/src/server-fns.ts
create mode 100644 packages/react-start-plugin/src/start-compiler-plugin.ts
delete mode 100644 packages/react-start-router-manifest/README.md
delete mode 100644 packages/react-start-router-manifest/eslint.config.js
delete mode 100644 packages/react-start-router-manifest/package.json
delete mode 100644 packages/react-start-router-manifest/tsconfig.json
delete mode 100644 packages/react-start-router-manifest/vite.config.ts
delete mode 100644 packages/react-start-server-functions-handler/README.md
delete mode 100644 packages/react-start-server-functions-handler/eslint.config.js
delete mode 100644 packages/react-start-server-functions-handler/package.json
delete mode 100644 packages/react-start-server-functions-handler/tsconfig.json
delete mode 100644 packages/react-start-server-functions-handler/vite.config.ts
create mode 100644 packages/react-start-server/src/h3.ts
rename packages/{react-start-router-manifest/src/index.ts => react-start-server/src/router-manifest.ts} (63%)
rename packages/{react-start-server-functions-handler/src/index.ts => react-start-server/src/server-functions-handler.ts} (95%)
delete mode 100644 packages/react-start/src/router-manifest.tsx
delete mode 100644 packages/react-start/src/server-functions-handler.tsx
create mode 100644 packages/start-plugin/package.json
delete mode 100644 packages/start/src/router-manifest.tsx
delete mode 100644 packages/start/src/server-functions-handler.tsx
diff --git a/.github/labeler.yml b/.github/labeler.yml
index 7b5316ac2a..25014dccc5 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -32,8 +32,6 @@
- 'packages/react-start-server-functions-client/**/*'
'package: react-start-server-functions-fetcher':
- 'packages/react-start-server-functions-fetcher/**/*'
-'package: react-start-server-functions-handler':
- - 'packages/react-start-server-functions-handler/**/*'
'package: react-start-server-functions-ssr':
- 'packages/react-start-server-functions-ssr/**/*'
'package: router-cli':
diff --git a/e2e/react-start/basic/app/ssr.tsx b/e2e/react-start/basic/app/ssr.tsx
index 62572579ac..de2ca15a47 100644
--- a/e2e/react-start/basic/app/ssr.tsx
+++ b/e2e/react-start/basic/app/ssr.tsx
@@ -1,12 +1,17 @@
import {
createStartHandler,
defaultStreamHandler,
+ defineEventHandler,
} from '@tanstack/start/server'
import { getRouterManifest } from '@tanstack/start/router-manifest'
import { createRouter } from './router'
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
+export default defineEventHandler((event) => {
+ const startHandler = createStartHandler({
+ createRouter,
+ getRouterManifest,
+ })(defaultStreamHandler)
+
+ return startHandler(event)
+})
diff --git a/examples/react/start-basic/app/ssr.tsx b/examples/react/start-basic/app/ssr.tsx
index 65a580f25e..07b04f617d 100644
--- a/examples/react/start-basic/app/ssr.tsx
+++ b/examples/react/start-basic/app/ssr.tsx
@@ -1,12 +1,18 @@
import {
createStartHandler,
defaultStreamHandler,
+ defineEventHandler,
+ getWebRequest,
} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
import { createRouter } from './router'
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
+export default defineEventHandler((event) => {
+ console.log(getWebRequest(event)?.url)
+
+ const startHandler = createStartHandler({
+ createRouter,
+ })(defaultStreamHandler)
+
+ return startHandler(event)
+})
diff --git a/examples/react/start-basic/vite.config.ts b/examples/react/start-basic/vite.config.ts
index 47532c5353..698e4856da 100644
--- a/examples/react/start-basic/vite.config.ts
+++ b/examples/react/start-basic/vite.config.ts
@@ -10,6 +10,6 @@ export default defineConfig({
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
- TanStackStartVitePlugin({}),
+ TanStackStartVitePlugin(),
],
})
diff --git a/package.json b/package.json
index 2fb22d4277..be79181ddc 100644
--- a/package.json
+++ b/package.json
@@ -98,11 +98,9 @@
"@tanstack/react-start-server": "workspace:*",
"@tanstack/react-start-api-routes": "workspace:*",
"@tanstack/react-start-server-functions-fetcher": "workspace:*",
- "@tanstack/react-start-server-functions-handler": "workspace:*",
"@tanstack/react-start-server-functions-client": "workspace:*",
"@tanstack/react-start-server-functions-ssr": "workspace:*",
"@tanstack/start-server-functions-server": "workspace:*",
- "@tanstack/react-start-router-manifest": "workspace:*",
"@tanstack/react-start-plugin": "workspace:*",
"@tanstack/eslint-plugin-router": "workspace:*",
"@tanstack/server-functions-plugin": "workspace:*",
diff --git a/packages/directive-functions-plugin/src/compilers.ts b/packages/directive-functions-plugin/src/compilers.ts
index da0fe941bc..332a40b415 100644
--- a/packages/directive-functions-plugin/src/compilers.ts
+++ b/packages/directive-functions-plugin/src/compilers.ts
@@ -40,6 +40,8 @@ export type CompileDirectivesOpts = ParseAstOptions & {
}) => string
replacer: ReplacerFn
// devSplitImporter: string
+ filename: string
+ root: string
}
function buildDirectiveSplitParam(opts: CompileDirectivesOpts) {
@@ -230,6 +232,8 @@ export function findDirectives(
directiveLabel: string
replacer?: ReplacerFn
directiveSplitParam: string
+ filename: string
+ root: string
},
): Record {
const directiveFnsById: Record = {}
diff --git a/packages/directive-functions-plugin/src/index.ts b/packages/directive-functions-plugin/src/index.ts
index 5907545538..be124822d4 100644
--- a/packages/directive-functions-plugin/src/index.ts
+++ b/packages/directive-functions-plugin/src/index.ts
@@ -15,23 +15,28 @@ export type {
ReplacerFn,
} from './compilers'
-export type DirectiveFunctionsViteOptions = Pick<
+export type DirectiveFunctionsViteEnvOptions = Pick<
CompileDirectivesOpts,
- 'directive' | 'directiveLabel' | 'getRuntimeCode' | 'replacer'
- // | 'devSplitImporter'
+ 'getRuntimeCode' | 'replacer'
> & {
envLabel: string
}
+export type DirectiveFunctionsViteOptions = Pick<
+ CompileDirectivesOpts,
+ 'directive' | 'directiveLabel'
+> &
+ DirectiveFunctionsViteEnvOptions & {
+ onDirectiveFnsById?: (directiveFnsById: Record) => void
+ }
+
const createDirectiveRx = (directive: string) =>
new RegExp(`"${directive}"|'${directive}'`, 'gm')
export function TanStackDirectiveFunctionsPlugin(
- opts: DirectiveFunctionsViteOptions & {
- onDirectiveFnsById?: (directiveFnsById: Record) => void
- },
+ opts: DirectiveFunctionsViteOptions,
): Plugin {
- let ROOT: string = process.cwd()
+ let root: string = process.cwd()
const directiveRx = createDirectiveRx(opts.directive)
@@ -39,34 +44,123 @@ export function TanStackDirectiveFunctionsPlugin(
name: 'tanstack-start-directive-vite-plugin',
enforce: 'pre',
configResolved: (config) => {
- ROOT = config.root
+ root = config.root
},
transform(code, id) {
- const url = pathToFileURL(id)
- url.searchParams.delete('v')
- id = fileURLToPath(url).replace(/\\/g, '/')
+ return transformCode({ ...opts, code, id, directiveRx, root })
+ },
+ }
+}
- if (!code.match(directiveRx)) {
- return null
- }
+export type DirectiveFunctionsVitePluginEnvOptions = Pick<
+ CompileDirectivesOpts,
+ 'directive' | 'directiveLabel'
+> & {
+ environments: {
+ client: DirectiveFunctionsViteEnvOptions & { envName?: string }
+ server: DirectiveFunctionsViteEnvOptions & { envName?: string }
+ }
+ onDirectiveFnsById?: (directiveFnsById: Record) => void
+}
+
+export function TanStackDirectiveFunctionsPluginEnv(
+ opts: DirectiveFunctionsVitePluginEnvOptions,
+): Plugin {
+ opts = {
+ ...opts,
+ environments: {
+ client: {
+ envName: 'client',
+ ...opts.environments.client,
+ },
+ server: {
+ envName: 'server',
+ ...opts.environments.server,
+ },
+ },
+ }
+
+ let root: string = process.cwd()
- if (debug) console.info(`${opts.envLabel}: Compiling Directives: `, id)
+ const directiveRx = createDirectiveRx(opts.directive)
+
+ return {
+ name: 'tanstack-start-directive-vite-plugin',
+ enforce: 'pre',
+ buildStart() {
+ root = this.environment.config.root
+ },
+ applyToEnvironment(env) {
+ return [
+ opts.environments.client.envName,
+ opts.environments.server.envName,
+ ].includes(env.name)
+ },
+ transform(code, id) {
+ const envOptions = [
+ opts.environments.client,
+ opts.environments.server,
+ ].find((e) => e.envName === this.environment.name)
+
+ if (!envOptions) {
+ throw new Error(`Environment ${this.environment.name} not found`)
+ }
- const { compiledResult, directiveFnsById } = compileDirectives({
+ return transformCode({
...opts,
+ ...envOptions,
code,
- root: ROOT,
- filename: id,
+ id,
+ directiveRx,
+ root,
})
+ },
+ }
+}
- opts.onDirectiveFnsById?.(directiveFnsById)
+function transformCode({
+ code,
+ id,
+ directiveRx,
+ envLabel,
+ directive,
+ directiveLabel,
+ getRuntimeCode,
+ replacer,
+ onDirectiveFnsById,
+ root,
+}: DirectiveFunctionsViteOptions & {
+ code: string
+ id: string
+ directiveRx: RegExp
+ root: string
+}) {
+ const url = pathToFileURL(id)
+ url.searchParams.delete('v')
+ id = fileURLToPath(url).replace(/\\/g, '/')
- if (debug) {
- logDiff(code, compiledResult.code)
- console.log('Output:\n', compiledResult.code + '\n\n')
- }
+ if (!code.match(directiveRx)) {
+ return null
+ }
- return compiledResult
- },
+ if (debug) console.info(`${envLabel}: Compiling Directives: `, id)
+
+ const { compiledResult, directiveFnsById } = compileDirectives({
+ directive,
+ directiveLabel,
+ getRuntimeCode,
+ replacer,
+ code,
+ root,
+ filename: id,
+ })
+
+ onDirectiveFnsById?.(directiveFnsById)
+
+ if (debug) {
+ logDiff(code, compiledResult.code)
+ console.log('Output:\n', compiledResult.code + '\n\n')
}
+
+ return compiledResult
}
diff --git a/packages/react-router/src/fileRoute.ts b/packages/react-router/src/fileRoute.ts
index d645cc840d..c72e45ca15 100644
--- a/packages/react-router/src/fileRoute.ts
+++ b/packages/react-router/src/fileRoute.ts
@@ -33,19 +33,33 @@ import type { UseLoaderDepsRoute } from './useLoaderDeps'
import type { UseLoaderDataRoute } from './useLoaderData'
import type { UseRouteContextRoute } from './useRouteContext'
-export function createFileRoute<
- TFilePath extends keyof FileRoutesByPath,
- TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],
- TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],
- TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],
- TFullPath extends
- RouteConstraints['TFullPath'] = FileRoutesByPath[TFilePath]['fullPath'],
->(
- path: TFilePath,
-): FileRoute['createRoute'] {
- return new FileRoute(path, {
- silent: true,
- }).createRoute
+type RouteInfo = {
+ parentRoute: AnyRoute
+ id: RouteConstraints['TId']
+ path: keyof FileRoutesByPath
+ fullPath: RouteConstraints['TFullPath']
+}
+
+export function createFileRoute(): FileRoute<
+ TRouteInfo['path'],
+ TRouteInfo['parentRoute'],
+ TRouteInfo['id'],
+ TRouteInfo['path'],
+ TRouteInfo['fullPath']
+>['createRoute'] {
+ return new FileRoute<
+ TRouteInfo['path'],
+ TRouteInfo['parentRoute'],
+ TRouteInfo['id'],
+ TRouteInfo['path'],
+ TRouteInfo['fullPath']
+ >(
+ // @ts-expect-error
+ undefined,
+ {
+ silent: true,
+ },
+ ).createRoute
}
/**
diff --git a/packages/react-start-plugin/package.json b/packages/react-start-plugin/package.json
index 7d2e2977aa..a27265e674 100644
--- a/packages/react-start-plugin/package.json
+++ b/packages/react-start-plugin/package.json
@@ -85,6 +85,7 @@
"babel-dead-code-elimination": "^1.0.9",
"fast-glob": "^3.3.3",
"h3": "1.13.0",
+ "import-meta-resolve": "^4.1.0",
"nitropack": "^2.10.4",
"tiny-invariant": "^1.3.3",
"vite": "6.1.0",
diff --git a/packages/react-start-plugin/src/compilers.ts b/packages/react-start-plugin/src/compilers.ts
index ca806fc991..6cd7cb55ae 100644
--- a/packages/react-start-plugin/src/compilers.ts
+++ b/packages/react-start-plugin/src/compilers.ts
@@ -17,6 +17,7 @@ const handleClientOnlyCallExpression =
type CompileOptions = ParseAstOptions & {
env: 'server' | 'client' | 'ssr'
dce?: boolean
+ filename: string
}
type IdentifierConfig = {
@@ -187,7 +188,7 @@ export function compileStartOutput(opts: CompileOptions): GeneratorResult {
function handleCreateServerFnCallExpression(
path: babel.NodePath,
- opts: ParseAstOptions,
+ opts: CompileOptions,
) {
// The function is the 'fn' property of the object passed to createServerFn
@@ -352,7 +353,7 @@ function handleCreateServerFnCallExpression(
function handleCreateMiddlewareCallExpression(
path: babel.NodePath,
- opts: ParseAstOptions,
+ opts: CompileOptions,
) {
const rootCallExpression = getRootCallExpression(path)
@@ -427,7 +428,7 @@ function handleCreateMiddlewareCallExpression(
function buildEnvOnlyCallExpressionHandler(env: 'client' | 'server') {
return function envOnlyCallExpressionHandler(
path: babel.NodePath,
- opts: ParseAstOptions,
+ opts: CompileOptions,
) {
// if (debug)
// console.info(`Handling ${env}Only call expression:`, path.toString())
diff --git a/packages/react-start-plugin/src/index.ts b/packages/react-start-plugin/src/index.ts
index 076820022e..ca475b351e 100644
--- a/packages/react-start-plugin/src/index.ts
+++ b/packages/react-start-plugin/src/index.ts
@@ -1,13 +1,12 @@
-import path from 'node:path'
-import { createTanStackServerFnPlugin } from '@tanstack/server-functions-plugin'
-import { mergeConfig, perEnvironmentPlugin } from 'vite'
-import viteReact from '@vitejs/plugin-react'
+import { TanStackServerFnPluginEnv } from '@tanstack/server-functions-plugin'
import { createNitro } from 'nitropack'
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
-import { createTanStackStartPlugin } from './server-fns.js'
+import viteReact from '@vitejs/plugin-react'
+import { mergeConfig } from 'vite'
import { getTanStackStartOptions } from './schema.js'
import { nitroPlugin } from './nitro/nitro-plugin.js'
-import { tsrRoutesManifestPlugin } from './routesManifestPlugin.js'
+import { tsrManifestPlugin } from './routesManifestPlugin.js'
+import { TanStackStartCompilerPlugin } from './start-compiler-plugin.js'
import type { PluginOption } from 'vite'
import type { TanStackStartInputConfig } from './schema.js'
@@ -21,39 +20,11 @@ export function TanStackStartVitePlugin(
): Array {
const options = getTanStackStartOptions(opts)
- const TanStackServerFnsPlugin = createTanStackServerFnPlugin({
- // This is the ID that will be available to look up and import
- // our server function manifest and resolve its module
- manifestVirtualImportId: 'tsr:server-fn-manifest',
- client: {
- getRuntimeCode: () =>
- `import { createClientRpc } from '@tanstack/react-start/server-functions-client'`,
- replacer: (d) =>
- `createClientRpc('${d.functionId}', '${options.routers.server.base}')`,
- },
- ssr: {
- getRuntimeCode: () =>
- `import { createSsrRpc } from '@tanstack/react-start/server-functions-ssr'`,
- replacer: (d) =>
- `createSsrRpc('${d.functionId}', '${options.routers.server.base}')`,
- },
- server: {
- getRuntimeCode: () =>
- `import { createServerRpc } from '@tanstack/react-start/server-functions-server'`,
- replacer: (d) =>
- `createServerRpc('${d.functionId}', '${options.routers.server.base}', ${d.fn})`,
- },
- })
-
- const TanStackStartPlugin = createTanStackStartPlugin({
- globalMiddlewareEntry: options.routers.server.globalMiddlewareEntry,
- })
-
- const globalPlugins: Array = [
+ return [
{
name: 'tss-vite-config-client',
...options.vite,
- async config() {
+ async config(config) {
// Create a dummy nitro app to get the resolved public output path
const dummyNitroApp = await createNitro({
preset: options.server.preset,
@@ -63,7 +34,14 @@ export function TanStackStartVitePlugin(
const nitroOutputPublicDir = dummyNitroApp.options.output.publicDir
await dummyNitroApp.close()
- return {
+ config.environments = {
+ ...(config.environments ?? {}),
+ server: {
+ ...(config.environments?.server ?? {}),
+ },
+ }
+
+ return mergeConfig(config, {
resolve: {
noExternal: [
'@tanstack/start',
@@ -71,7 +49,6 @@ export function TanStackStartVitePlugin(
'@tanstack/start-client',
'@tanstack/start-server',
'@tanstack/start-server-functions-fetcher',
- '@tanstack/start-server-functions-handler',
'@tanstack/start-server-functions-client',
'@tanstack/start-server-functions-ssr',
'@tanstack/start-server-functions-server',
@@ -79,7 +56,7 @@ export function TanStackStartVitePlugin(
'@tanstack/start-config',
'@tanstack/start-api-routes',
'@tanstack/server-functions-plugin',
- 'tsr:routes-manifest',
+ 'tsr:start-manifest',
'tsr:server-fn-manifest',
],
},
@@ -87,88 +64,66 @@ export function TanStackStartVitePlugin(
entries: [],
...(options.vite?.optimizeDeps || {}),
},
+ /* prettier-ignore */
define: {
...(options.vite?.define || {}),
...injectDefineEnv('TSS_PUBLIC_BASE', options.routers.public.base),
...injectDefineEnv('TSS_CLIENT_BASE', options.routers.client.base),
- ...injectDefineEnv('TSS_API_BASE', options.routers.server.base),
+ ...injectDefineEnv('TSS_CLIENT_ENTRY', options.clientEntryPath),
+ ...injectDefineEnv('TSS_SERVER_FN_BASE', options.routers.server.base),
...injectDefineEnv('TSS_OUTPUT_PUBLIC_DIR', nitroOutputPublicDir),
},
- }
+ })
},
configEnvironment(env, config) {
- if (env === 'client') {
- return mergeConfig(config, options.routers.client.vite || {})
- }
+ if (env === 'server') {
+ config = mergeConfig(config, {
+ plugins: [],
+ })
- if (env === 'ssr') {
- return mergeConfig(config, options.routers.ssr.vite || {})
+ config = mergeConfig(
+ mergeConfig(config, options.vite || {}),
+ options.routers.server.vite || {},
+ )
+ } else {
+ config = mergeConfig(
+ mergeConfig(config, options.vite || {}),
+ options.routers.client.vite || {},
+ )
}
return config
},
},
+ TanStackStartCompilerPlugin(),
+ TanStackServerFnPluginEnv({
+ // This is the ID that will be available to look up and import
+ // our server function manifest and resolve its module
+ manifestVirtualImportId: 'tsr:server-fn-manifest',
+ client: {
+ getRuntimeCode: () =>
+ `import { createClientRpc } from '@tanstack/react-start/server-functions-client'`,
+ replacer: (d) =>
+ `createClientRpc('${d.functionId}', '${options.routers.server.base}')`,
+ },
+ server: {
+ getRuntimeCode: () =>
+ `import { createServerRpc } from '@tanstack/react-start/server-functions-server'`,
+ replacer: (d) =>
+ `createServerRpc('${d.functionId}', '${options.routers.server.base}', ${d.fn})`,
+ },
+ }),
+ tsrManifestPlugin({
+ clientBase: options.routers.client.base,
+ tsrConfig: options.tsr,
+ }),
TanStackRouterVite({
...options.tsr,
enableRouteGeneration: true,
autoCodeSplitting: true,
}),
viteReact(options.react),
- ]
-
- return [
- perEnvironmentPlugin('tanstack-start-plugin-client', (environment) =>
- environment.name === 'client'
- ? TanStackStartPlugin.client
- : TanStackStartPlugin.server,
- ),
- ...globalPlugins,
- perEnvironmentPlugin(
- 'tanstack-server-fns-plugin-client-server',
- (environment) =>
- environment.name === 'client'
- ? TanStackServerFnsPlugin.client
- : TanStackServerFnsPlugin.server,
- ),
- // perEnvironmentPlugin(
- // 'tanstack-router-manifest-plugin',
- // (environment) =>
- // environment.name === 'ssr' &&
- // tsrRoutesManifestPlugin({
- // clientBase: options.routers.client.base,
- // tsrConfig: options.tsr,
- // }),
- // ),
- // TODO: Should this only be loaded for ssr? like above?
- tsrRoutesManifestPlugin({
- clientBase: options.routers.client.base,
- tsrConfig: options.tsr,
- }),
- nitroPlugin({
- ...options,
- server: {
- ...options.server,
- handlers: [
- ...(options.hasApiEntry
- ? [
- {
- route: options.routers.api.base,
- handler: path.join(
- options.root,
- options.tsr.appDirectory,
- options.routers.api.entry,
- ),
- },
- ]
- : []),
- ],
- },
- plugins: [
- TanStackStartPlugin.server,
- ...globalPlugins,
- TanStackServerFnsPlugin.server,
- ],
- }),
+ nitroPlugin(options),
]
}
diff --git a/packages/react-start-plugin/src/nitro/nitro-plugin.ts b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
index 18c073ce9e..7b198e80e8 100644
--- a/packages/react-start-plugin/src/nitro/nitro-plugin.ts
+++ b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
@@ -1,16 +1,15 @@
-import { dirname, resolve } from 'node:path'
+import { resolve } from 'node:path'
import { platform } from 'node:os'
-import { fileURLToPath } from 'node:url'
import { normalizePath } from 'vite'
+import { getRollupConfig } from 'nitropack/rollup'
-import { buildServer } from './build-server.js'
-import { buildSSRApp } from './build-ssr.js'
+import { createNitro } from 'nitropack'
import { buildSitemap } from './build-sitemap.js'
import { devServerPlugin } from './plugins/dev-server-plugin.js'
-import type { TanStackStartOutputConfig } from '../schema.js'
import type { NitroConfig } from 'nitropack'
+import type { TanStackStartOutputConfig } from '../schema.js'
-import type { PluginOption, UserConfig, ViteDevServer } from 'vite'
+import type { PluginOption } from 'vite'
export type {
TanStackStartInputConfig,
@@ -19,113 +18,63 @@ export type {
const isWindows = platform() === 'win32'
const filePrefix = isWindows ? 'file:///' : ''
-let clientOutputPath = ''
-
-const __filename = fileURLToPath(
- // @ts-ignore Cannot figure out for the life of me why tsconfig.json won't let me fix this. Only shows up during build, not in editor.
- import.meta.url,
-)
-const __dirname = dirname(__filename)
export function nitroPlugin(
- options: TanStackStartOutputConfig & {
- plugins: Array
- },
+ options: TanStackStartOutputConfig,
): Array {
- let isTest = process.env['NODE_ENV'] === 'test' || !!process.env['VITEST']
-
- let isBuild = false
- let isServe = false
- let ssrBuild = false
- let config: UserConfig
- let nitroConfig: NitroConfig
- let environmentBuild = false
-
return [
devServerPlugin(options),
{
name: 'tanstack-vite-plugin-nitro',
- config(userConfig, { mode, command }) {
- isServe = command === 'serve'
- isBuild = command === 'build'
- ssrBuild = userConfig.build?.ssr === true
- config = userConfig
- isTest = isTest ? isTest : mode === 'test'
-
+ async config() {
const buildPreset =
process.env['BUILD_PRESET'] ??
(options.server.preset as string | undefined)
- const rendererEntry =
- filePrefix + normalizePath(options.routers.ssr.entry)
-
- nitroConfig = {
+ const nitroConfig: NitroConfig = {
...options.server,
preset: buildPreset,
compatibilityDate: '2024-11-19',
logLevel: options.server.logLevel || 0,
srcDir: normalizePath(options.tsr.appDirectory),
+ renderer: filePrefix + normalizePath(options.ssrEntryPath),
+ }
+
+ const nitro = await createNitro({
+ dev: false,
+ ...nitroConfig,
typescript: {
generateTsConfig: false,
},
- rollupConfig: {
- onwarn(warning) {
- if (
- warning.message.includes('empty chunk') &&
- warning.message.endsWith('.server')
- ) {
- return
- }
- },
- plugins: options.plugins,
- },
- handlers: [],
- }
-
- if (!ssrBuild && !isTest) {
- // store the client output path for the SSR build config
- clientOutputPath = resolve(
- options.root,
- config.build?.outDir || 'dist/client',
- )
- }
+ })
- nitroConfig.alias = {
- '#start/ssr': options.ssrEntryPath,
- }
+ const nitroRollupOptions = getRollupConfig(nitro)
return {
environments: {
- ssr: {
+ server: {
build: {
ssr: true,
rollupOptions: {
- input: options.ssrEntryPath,
+ ...nitroRollupOptions,
+ plugins: nitroRollupOptions.plugins as Array,
},
- outDir: resolve(options.root, 'dist/ssr'),
},
},
},
builder: {
sharedPlugins: true,
buildApp: async (builder) => {
- console.log('tanner buildApp', builder)
- environmentBuild = true
-
if (!builder.environments['client']) {
throw new Error('Client environment not found')
}
- if (!builder.environments['ssr']) {
+ if (!builder.environments['server']) {
throw new Error('SSR environment not found')
}
- await Promise.all([
- builder.build(builder.environments['client']),
- builder.build(builder.environments['ssr']),
- ])
-
- await buildServer(nitroConfig)
+ await builder.build(builder.environments['client'])
+ await builder.build(builder.environments['server'])
if (nitroConfig.prerender?.routes?.length && options.sitemap) {
console.log('Building Sitemap...')
@@ -144,70 +93,6 @@ export function nitroPlugin(
},
}
},
- async configureServer(viteServer: ViteDevServer) {
- return // TODO: We'll remove this when we're ready for non-entry routes
- // if (isServe && !isTest) {
- // const nitro = await createNitro({
- // dev: true,
- // ...nitroConfig,
- // })
-
- // const server = createDevServer(nitro)
- // await build(nitro)
-
- // // viteServer.middlewares.use(
- // // apiBase,
- // // toNodeListener(server.app as unknown as App),
- // // )
-
- // viteServer.httpServer?.once('listening', () => {
- // process.env['START_HOST'] = !viteServer.config.server.host
- // ? 'localhost'
- // : (viteServer.config.server.host as string)
- // process.env['START_PORT'] = `${viteServer.config.server.port}`
- // })
-
- // // handle upgrades if websockets are enabled
- // if (nitroConfig.experimental?.websocket) {
- // viteServer.httpServer?.on('upgrade', server.upgrade)
- // }
- // }
- },
- async closeBundle() {
- // Skip when build is triggered by the Environment API
- if (environmentBuild) {
- return
- }
-
- if (ssrBuild) {
- return
- }
-
- if (isBuild) {
- console.log('Building SSR application...')
- await buildSSRApp({
- root: options.root,
- ssrEntry: options.ssrEntryPath,
- viteConfig: config,
- })
-
- if (options.sitemap) {
- console.log('Building Sitemap...')
- // sitemap needs to be built after all directories are built
- await buildSitemap({
- host: options.sitemap.host,
- routes: nitroConfig.prerender?.routes || [], // TODO: Can we get these routes from the final crawled routes from prerender?
- outputDir: resolve(options.root, 'dist/public'),
- })
- }
-
- await buildServer(nitroConfig)
-
- console.log(
- `\n\nThe 'tanstack-platform' server has been successfully built.`,
- )
- }
- },
},
]
}
diff --git a/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts b/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts
index 5781f4979a..995a9b7a0a 100644
--- a/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts
+++ b/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts
@@ -1,10 +1,9 @@
// SSR dev server, middleware and error page source modified from
// https://github.com/solidjs/solid-start/blob/main/packages/start/dev/server.js
-import { createEvent, sendWebResponse } from 'h3'
-
-import { registerDevServerMiddleware } from '../utils/register-dev-middleware.js'
-import type { Connect, Plugin, ViteDevServer } from 'vite'
+import { createEvent, getHeader, sendWebResponse } from 'h3'
+import { isRunnableDevEnvironment } from 'vite'
+import type { Connect, Environment, Plugin, ViteDevServer } from 'vite'
import type { TanStackStartOutputConfig } from '../../schema.js'
export function devServerPlugin(options: TanStackStartOutputConfig): Plugin {
@@ -25,34 +24,66 @@ export function devServerPlugin(options: TanStackStartOutputConfig): Plugin {
},
}
},
- configureServer(viteServer) {
+ configureServer(viteDevServer) {
if (isTest) {
return
}
+ ;(globalThis as any).viteDevServer = viteDevServer
+
return () => {
- remove_html_middlewares(viteServer.middlewares)
- registerDevServerMiddleware(options.root, viteServer)
+ remove_html_middlewares(viteDevServer.middlewares)
+
+ viteDevServer.middlewares.use(async (req, res) => {
+ const event = createEvent(req, res)
+ const serverEnv = viteDevServer.environments['server'] as Environment
- viteServer.middlewares.use(async (req, res) => {
try {
- const serverEntry = (
- await viteServer.ssrLoadModule('~start/ssr-entry')
- )['default']
+ if (!isRunnableDevEnvironment(serverEnv)) {
+ throw new Error('Server environment not found')
+ }
- const event = createEvent(req, res)
- const result: string | Response = await serverEntry(event)
+ const serverEntry =
+ await serverEnv.runner.import('~start/ssr-entry')
- if (result instanceof Response) {
- sendWebResponse(event, result)
- return
- }
- res.setHeader('Content-Type', 'text/html')
- res.end(result)
+ const response = await serverEntry['default'](event)
+
+ sendWebResponse(event, response)
} catch (e) {
- viteServer.ssrFixStacktrace(e as Error)
- res.statusCode = 500
- res.end(`
+ console.error(e)
+ viteDevServer.ssrFixStacktrace(e as Error)
+
+ if (
+ getHeader(event, 'content-type')?.includes('application/json')
+ ) {
+ return sendWebResponse(
+ event,
+ new Response(
+ JSON.stringify(
+ {
+ status: 500,
+ error: 'Internal Server Error',
+ message:
+ 'An unexpected error occurred. Please try again later.',
+ timestamp: new Date().toISOString(),
+ },
+ null,
+ 2,
+ ),
+ {
+ status: 500,
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ },
+ ),
+ )
+ }
+
+ sendWebResponse(
+ event,
+ new Response(
+ `
@@ -68,7 +99,12 @@ export function devServerPlugin(options: TanStackStartOutputConfig): Plugin {
- `)
+ `,
+ {
+ status: 500,
+ },
+ ),
+ )
}
})
}
diff --git a/packages/react-start-plugin/src/nitro/utils/load-esm.ts b/packages/react-start-plugin/src/nitro/utils/load-esm.ts
deleted file mode 100644
index 78e8049184..0000000000
--- a/packages/react-start-plugin/src/nitro/utils/load-esm.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * @license
- * Copyright Google LLC All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.dev/license
- */
-
-import { URL } from 'node:url'
-
-/**
- * This uses a dynamic import to load a module which may be ESM.
- * CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
- * will currently, unconditionally downlevel dynamic import into a require call.
- * require calls cannot load ESM code and will result in a runtime error. To workaround
- * this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
- * Once TypeScript provides support for keeping the dynamic import this workaround can
- * be dropped.
- *
- * @param modulePath The path of the module to load.
- * @returns A Promise that resolves to the dynamically imported module.
- */
-export function loadEsmModule(modulePath: string | URL): Promise {
- return new Function('modulePath', `return import(modulePath);`)(
- modulePath,
- ) as Promise
-}
diff --git a/packages/react-start-plugin/src/nitro/utils/register-dev-middleware.ts b/packages/react-start-plugin/src/nitro/utils/register-dev-middleware.ts
deleted file mode 100644
index 78d1389515..0000000000
--- a/packages/react-start-plugin/src/nitro/utils/register-dev-middleware.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { createEvent } from 'h3'
-import fg from 'fast-glob'
-import type { ViteDevServer } from 'vite'
-import type { EventHandler } from 'h3'
-
-export function registerDevServerMiddleware(
- root: string,
- viteServer: ViteDevServer,
-) {
- const middlewareFiles = fg.sync([`${root}/src/server/middleware/**/*.ts`])
-
- middlewareFiles.forEach((file) => {
- viteServer.middlewares.use(async (req, res, next) => {
- const middlewareHandler: EventHandler = await viteServer
- .ssrLoadModule(file)
- .then((m: unknown) => (m as { default: EventHandler }).default)
-
- const result = await middlewareHandler(createEvent(req, res))
-
- if (!result) {
- next()
- }
- })
- })
-}
diff --git a/packages/react-start-plugin/src/routesManifestPlugin.ts b/packages/react-start-plugin/src/routesManifestPlugin.ts
index 0fde46ec3c..be94ff2405 100644
--- a/packages/react-start-plugin/src/routesManifestPlugin.ts
+++ b/packages/react-start-plugin/src/routesManifestPlugin.ts
@@ -5,7 +5,7 @@ import type { PluginOption, ResolvedConfig } from 'vite'
import type { z } from 'zod'
import type { Manifest } from '@tanstack/react-router'
-export function tsrRoutesManifestPlugin(opts: {
+export function tsrManifestPlugin(opts: {
tsrConfig: z.infer
clientBase: string
}): PluginOption {
@@ -13,21 +13,27 @@ export function tsrRoutesManifestPlugin(opts: {
return {
name: 'tsr-routes-manifest',
+ enforce: 'pre',
+
configResolved(resolvedConfig) {
config = resolvedConfig
},
+ // configEnvironment(env, envConfig) {
+ // config = envConfig.
+ // },
resolveId(id) {
- if (id === 'tsr:routes-manifest') {
+ if (id === 'tsr:start-manifest') {
return id
}
return
},
load(id) {
- if (id === 'tsr:routes-manifest') {
+ if (id === 'tsr:start-manifest') {
// If we're in development, return a dummy manifest
if (config.command === 'serve') {
return `export default () => ({
+ entry: "$${process.env.TSS_CLIENT_BASE}/",
routes: {}
})`
}
diff --git a/packages/react-start-plugin/src/server-fns.ts b/packages/react-start-plugin/src/server-fns.ts
deleted file mode 100644
index 4d08a9d165..0000000000
--- a/packages/react-start-plugin/src/server-fns.ts
+++ /dev/null
@@ -1,178 +0,0 @@
-import { fileURLToPath, pathToFileURL } from 'node:url'
-import path from 'node:path'
-import { logDiff } from '@tanstack/router-utils'
-import { compileStartOutput } from './compilers'
-
-import type { Plugin } from 'vite'
-
-const debug =
- process.env.TSR_VITE_DEBUG &&
- ['true', 'start-plugin'].includes(process.env.TSR_VITE_DEBUG)
-
-export type TanStackStartViteOptions = {
- globalMiddlewareEntry: string
-}
-
-const transformFuncs = [
- 'createServerFn',
- 'createMiddleware',
- 'serverOnly',
- 'clientOnly',
- 'createIsomorphicFn',
-]
-const tokenRegex = new RegExp(transformFuncs.join('|'))
-// const eitherFuncRegex = new RegExp(
-// `(function ${transformFuncs.join('|function ')})`,
-// )
-
-export function createTanStackStartPlugin(opts: TanStackStartViteOptions): {
- client: Array
- ssr: Array
- server: Array
-} {
- return {
- client: [
- (() => {
- let entry: string | null = null
- let ROOT: string = process.cwd()
- return {
- name: 'vite-plugin-tanstack-start-server-entry-client',
- enforce: 'pre',
- configResolved: (config) => {
- ROOT = config.root
- entry = path.resolve(ROOT, (config as any).router.handler)
-
- if (!entry) {
- throw new Error('@tanstack/start-plugin: No server entry found!')
- }
- },
- transform(code, id) {
- if (entry && id.includes(entry)) {
- return {
- code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
- map: null,
- }
- }
- return null
- },
- }
- })(),
- TanStackStartServerFnsAndMiddleware({ ...opts, env: 'client' }),
- ],
- ssr: [
- (() => {
- let entry: string | null = null
- let ROOT: string = process.cwd()
- return {
- name: 'vite-plugin-tanstack-start-server-entry-ssr',
- enforce: 'pre',
- configResolved: (config) => {
- ROOT = config.root
- entry = path.resolve(ROOT, (config as any).router.handler)
-
- if (!entry) {
- throw new Error('@tanstack/start-plugin: No server entry found!')
- }
- },
- transform(code, id) {
- if (entry && id.includes(entry)) {
- return {
- code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
- map: null,
- }
- }
- return null
- },
- }
- })(),
- TanStackStartServerFnsAndMiddleware({ ...opts, env: 'ssr' }),
- ],
- server: [
- (() => {
- let entry: string | null = null
- let ROOT: string = process.cwd()
- return {
- name: 'vite-plugin-tanstack-start-server-entry-server',
- enforce: 'pre',
- configResolved: (config) => {
- ROOT = config.root
- entry = path.resolve(ROOT, (config as any).router.handler)
-
- if (!entry) {
- throw new Error('@tanstack/start-plugin: No server entry found!')
- }
- },
- transform(code, id) {
- if (entry && id.includes(entry)) {
- return {
- code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
- map: null,
- }
- }
- return null
- },
- }
- })(),
- TanStackStartServerFnsAndMiddleware({ ...opts, env: 'server' }),
- ],
- }
-}
-
-export function TanStackStartServerFnsAndMiddleware(opts: {
- env: 'server' | 'ssr' | 'client'
-}): Plugin {
- let ROOT: string = process.cwd()
-
- return {
- name: 'vite-plugin-tanstack-start-create-server-fn',
- enforce: 'pre',
- configResolved: (config) => {
- ROOT = config.root
- },
- transform(code, id) {
- const url = pathToFileURL(id)
- url.searchParams.delete('v')
- id = fileURLToPath(url).replace(/\\/g, '/')
-
- const includesToken = tokenRegex.test(code)
- // const includesEitherFunc = eitherFuncRegex.test(code)
-
- if (
- !includesToken
- // includesEitherFunc
- // /node_modules/.test(id)
- ) {
- return null
- }
-
- if (code.includes('@react-refresh')) {
- throw new Error(
- `We detected that the '@vitejs/plugin-react' was passed before '@tanstack/start-plugin'. Please make sure that '@tanstack/router-vite-plugin' is passed before '@vitejs/plugin-react' and try again:
-e.g.
-
-plugins: [
- TanStackStartVite(), // Place this before viteReact()
- viteReact(),
-]
-`,
- )
- }
-
- if (debug) console.info(`${opts.env} Compiling Start: `, id)
-
- const compiled = compileStartOutput({
- code,
- root: ROOT,
- filename: id,
- env: opts.env,
- })
-
- if (debug) {
- logDiff(code, compiled.code)
- console.log('Output:\n', compiled.code + '\n\n')
- }
-
- return compiled
- },
- }
-}
diff --git a/packages/react-start-plugin/src/start-compiler-plugin.ts b/packages/react-start-plugin/src/start-compiler-plugin.ts
new file mode 100644
index 0000000000..2c42234c10
--- /dev/null
+++ b/packages/react-start-plugin/src/start-compiler-plugin.ts
@@ -0,0 +1,150 @@
+import { fileURLToPath, pathToFileURL } from 'node:url'
+import { logDiff } from '@tanstack/router-utils'
+import { compileStartOutput } from './compilers'
+
+import type { Plugin } from 'vite'
+
+const debug =
+ process.env.TSR_VITE_DEBUG &&
+ ['true', 'start-plugin'].includes(process.env.TSR_VITE_DEBUG)
+
+export type TanStackStartViteOptions = {
+ globalMiddlewareEntry: string
+}
+
+const transformFuncs = [
+ 'createServerFn',
+ 'createMiddleware',
+ 'serverOnly',
+ 'clientOnly',
+ 'createIsomorphicFn',
+]
+const tokenRegex = new RegExp(transformFuncs.join('|'))
+// const eitherFuncRegex = new RegExp(
+// `(function ${transformFuncs.join('|function ')})`,
+// )
+
+// TODO: Bring these back
+// (() => {
+// let entry: string | null = null
+// let ROOT: string = process.cwd()
+// return {
+// name: 'vite-plugin-tanstack-start-server-entry-client',
+// enforce: 'pre',
+// configResolved: (config) => {
+// ROOT = config.root
+// entry = path.resolve(ROOT, (config as any).router.handler)
+
+// if (!entry) {
+// throw new Error('@tanstack/start-plugin: No server entry found!')
+// }
+// },
+// transform(code, id) {
+// if (entry && id.includes(entry)) {
+// return {
+// code: `${code}\n\nimport '${path.resolve(ROOT, opts.globalMiddlewareEntry)}'`,
+// map: null,
+// }
+// }
+// return null
+// },
+// }
+// })(),
+
+export function TanStackStartCompilerPlugin(opts?: {
+ client?: {
+ envName?: string
+ }
+ server?: {
+ envName?: string
+ }
+}): Plugin {
+ opts = {
+ client: {
+ envName: 'client',
+ ...opts?.client,
+ },
+ server: {
+ envName: 'server',
+ ...opts?.server,
+ },
+ }
+
+ return {
+ name: 'vite-plugin-tanstack-start-create-server-fn',
+ enforce: 'pre',
+ applyToEnvironment(env) {
+ return [opts.client?.envName, opts.server?.envName].includes(env.name)
+ },
+ transform(code, id) {
+ const env =
+ this.environment.name === opts.client?.envName
+ ? 'client'
+ : this.environment.name === opts.server?.envName
+ ? 'server'
+ : (() => {
+ throw new Error(
+ `Environment ${this.environment.name} not configured`,
+ )
+ })()
+
+ return transformCode({
+ code,
+ id,
+ env,
+ })
+ },
+ }
+}
+
+function transformCode(opts: {
+ code: string
+ id: string
+ env: 'server' | 'client'
+}) {
+ const { code, env } = opts
+ let { id } = opts
+
+ const url = pathToFileURL(id)
+ url.searchParams.delete('v')
+ id = fileURLToPath(url).replace(/\\/g, '/')
+
+ const includesToken = tokenRegex.test(code)
+ // const includesEitherFunc = eitherFuncRegex.test(code)
+
+ if (
+ !includesToken
+ // includesEitherFunc
+ // /node_modules/.test(id)
+ ) {
+ return null
+ }
+
+ if (code.includes('@react-refresh')) {
+ throw new Error(
+ `We detected that the '@vitejs/plugin-react' was passed before '@tanstack/start-plugin'. Please make sure that '@tanstack/router-vite-plugin' is passed before '@vitejs/plugin-react' and try again:
+ e.g.
+
+ plugins: [
+ TanStackStartVite(), // Place this before viteReact()
+ viteReact(),
+ ]
+ `,
+ )
+ }
+
+ if (debug) console.info(`${env} Compiling Start: `, id)
+
+ const compiled = compileStartOutput({
+ code,
+ filename: id,
+ env,
+ })
+
+ if (debug) {
+ logDiff(code, compiled.code)
+ console.log('Output:\n', compiled.code + '\n\n')
+ }
+
+ return compiled
+}
diff --git a/packages/react-start-plugin/vite.config.ts b/packages/react-start-plugin/vite.config.ts
index 5389f0f739..2c711fd181 100644
--- a/packages/react-start-plugin/vite.config.ts
+++ b/packages/react-start-plugin/vite.config.ts
@@ -16,5 +16,6 @@ export default mergeConfig(
tanstackViteConfig({
entry: './src/index.ts',
srcDir: './src',
+ outDir: './dist',
}),
)
diff --git a/packages/react-start-router-manifest/README.md b/packages/react-start-router-manifest/README.md
deleted file mode 100644
index bb009b0c87..0000000000
--- a/packages/react-start-router-manifest/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-> 🤫 we're cooking up something special!
-
-
-
-# TanStack Start
-
-
-
-🤖 Type-safe router w/ built-in caching & URL state management for React!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Query](https://github.com/tannerlinsley/react-query), [React Table](https://github.com/tanstack/react-table), [React Charts](https://github.com/tannerlinsley/react-charts), [React Virtual](https://github.com/tannerlinsley/react-virtual)
-
-## Visit [tanstack.com/router](https://tanstack.com/router) for docs, guides, API and more!
diff --git a/packages/react-start-router-manifest/eslint.config.js b/packages/react-start-router-manifest/eslint.config.js
deleted file mode 100644
index 931f0ec774..0000000000
--- a/packages/react-start-router-manifest/eslint.config.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// @ts-check
-
-import pluginReact from '@eslint-react/eslint-plugin'
-import pluginReactHooks from 'eslint-plugin-react-hooks'
-import rootConfig from '../../eslint.config.js'
-
-export default [
- ...rootConfig,
- {
- ...pluginReact.configs.recommended,
- files: ['**/*.{ts,tsx}'],
- },
- {
- plugins: {
- 'react-hooks': pluginReactHooks,
- },
- rules: {
- '@eslint-react/no-unstable-context-value': 'off',
- '@eslint-react/no-unstable-default-props': 'off',
- '@eslint-react/dom/no-missing-button-type': 'off',
- 'react-hooks/exhaustive-deps': 'error',
- 'react-hooks/rules-of-hooks': 'error',
- },
- },
- {
- files: ['**/__tests__/**'],
- rules: {
- '@typescript-eslint/no-unnecessary-condition': 'off',
- },
- },
-]
diff --git a/packages/react-start-router-manifest/package.json b/packages/react-start-router-manifest/package.json
deleted file mode 100644
index 758b86367d..0000000000
--- a/packages/react-start-router-manifest/package.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "name": "@tanstack/react-start-router-manifest",
- "version": "1.114.3",
- "description": "Modern and scalable routing for React applications",
- "author": "Tanner Linsley",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/TanStack/router.git",
- "directory": "packages/react-start-router-manifest"
- },
- "homepage": "https://tanstack.com/start",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/tannerlinsley"
- },
- "keywords": [
- "react",
- "location",
- "router",
- "routing",
- "async",
- "async router",
- "typescript"
- ],
- "scripts": {
- "clean": "rimraf ./dist && rimraf ./coverage",
- "test": "pnpm test:eslint && pnpm test:types && pnpm test:build && pnpm test:unit",
- "test:unit": "exit 0; vitest",
- "test:eslint": "eslint ./src",
- "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"",
- "test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
- "test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
- "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js",
- "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js",
- "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js",
- "test:types:ts58": "tsc",
- "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
- "build": "tsc"
- },
- "type": "module",
- "types": "dist/esm/index.d.ts",
- "exports": {
- ".": {
- "import": {
- "types": "./dist/esm/index.d.ts",
- "default": "./dist/esm/index.js"
- }
- },
- "./package.json": "./package.json"
- },
- "sideEffects": false,
- "files": [
- "dist",
- "src"
- ],
- "engines": {
- "node": ">=12"
- },
- "dependencies": {
- "@tanstack/router-core": "workspace:^",
- "tiny-invariant": "^1.3.3"
- },
- "devDependencies": {
- "typescript": "^5.7.2"
- }
-}
diff --git a/packages/react-start-router-manifest/tsconfig.json b/packages/react-start-router-manifest/tsconfig.json
deleted file mode 100644
index 940a9cce0a..0000000000
--- a/packages/react-start-router-manifest/tsconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extends": "../../tsconfig.json",
- "include": ["src/index.ts"],
- "compilerOptions": {
- "rootDir": "src",
- "outDir": "dist/esm",
- "target": "esnext",
- "noEmit": false
- }
-}
diff --git a/packages/react-start-router-manifest/vite.config.ts b/packages/react-start-router-manifest/vite.config.ts
deleted file mode 100644
index d6472068fb..0000000000
--- a/packages/react-start-router-manifest/vite.config.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { defineConfig, mergeConfig } from 'vitest/config'
-import { tanstackViteConfig } from '@tanstack/config/vite'
-import packageJson from './package.json'
-import type { ViteUserConfig } from 'vitest/config'
-
-const config = defineConfig({
- plugins: [] as ViteUserConfig['plugins'],
- test: {
- name: packageJson.name,
- watch: false,
- environment: 'jsdom',
- },
-})
-
-export default mergeConfig(
- config,
- tanstackViteConfig({
- entry: './src/index.ts',
- srcDir: './src',
- externalDeps: ['tsr:routes-manifest'],
- }),
-)
diff --git a/packages/react-start-server-functions-handler/README.md b/packages/react-start-server-functions-handler/README.md
deleted file mode 100644
index bb009b0c87..0000000000
--- a/packages/react-start-server-functions-handler/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-> 🤫 we're cooking up something special!
-
-
-
-# TanStack Start
-
-
-
-🤖 Type-safe router w/ built-in caching & URL state management for React!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Query](https://github.com/tannerlinsley/react-query), [React Table](https://github.com/tanstack/react-table), [React Charts](https://github.com/tannerlinsley/react-charts), [React Virtual](https://github.com/tannerlinsley/react-virtual)
-
-## Visit [tanstack.com/router](https://tanstack.com/router) for docs, guides, API and more!
diff --git a/packages/react-start-server-functions-handler/eslint.config.js b/packages/react-start-server-functions-handler/eslint.config.js
deleted file mode 100644
index 931f0ec774..0000000000
--- a/packages/react-start-server-functions-handler/eslint.config.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// @ts-check
-
-import pluginReact from '@eslint-react/eslint-plugin'
-import pluginReactHooks from 'eslint-plugin-react-hooks'
-import rootConfig from '../../eslint.config.js'
-
-export default [
- ...rootConfig,
- {
- ...pluginReact.configs.recommended,
- files: ['**/*.{ts,tsx}'],
- },
- {
- plugins: {
- 'react-hooks': pluginReactHooks,
- },
- rules: {
- '@eslint-react/no-unstable-context-value': 'off',
- '@eslint-react/no-unstable-default-props': 'off',
- '@eslint-react/dom/no-missing-button-type': 'off',
- 'react-hooks/exhaustive-deps': 'error',
- 'react-hooks/rules-of-hooks': 'error',
- },
- },
- {
- files: ['**/__tests__/**'],
- rules: {
- '@typescript-eslint/no-unnecessary-condition': 'off',
- },
- },
-]
diff --git a/packages/react-start-server-functions-handler/package.json b/packages/react-start-server-functions-handler/package.json
deleted file mode 100644
index a34bf04530..0000000000
--- a/packages/react-start-server-functions-handler/package.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- "name": "@tanstack/react-start-server-functions-handler",
- "version": "1.114.3",
- "description": "Modern and scalable routing for React applications",
- "author": "Tanner Linsley",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/TanStack/router.git",
- "directory": "packages/react-start-server-functions-handler"
- },
- "homepage": "https://tanstack.com/start",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/tannerlinsley"
- },
- "keywords": [
- "react",
- "location",
- "router",
- "routing",
- "async",
- "async router",
- "typescript"
- ],
- "scripts": {
- "clean": "rimraf ./dist && rimraf ./coverage",
- "test": "pnpm test:eslint && pnpm test:types && pnpm test:build && pnpm test:unit",
- "test:unit": "exit 0; vitest",
- "test:eslint": "eslint ./src",
- "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"",
- "test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
- "test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
- "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js",
- "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js",
- "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js",
- "test:types:ts58": "tsc",
- "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
- "build": "vite build"
- },
- "type": "module",
- "types": "dist/esm/index.d.ts",
- "exports": {
- ".": {
- "import": {
- "types": "./dist/esm/index.d.ts",
- "default": "./dist/esm/index.js"
- },
- "require": {
- "types": "./dist/cjs/index.d.cts",
- "default": "./dist/cjs/index.cjs"
- }
- },
- "./package.json": "./package.json"
- },
- "sideEffects": false,
- "files": [
- "dist",
- "src"
- ],
- "engines": {
- "node": ">=12"
- },
- "dependencies": {
- "@tanstack/react-router": "workspace:^",
- "@tanstack/react-start-client": "workspace:^",
- "@tanstack/react-start-server": "workspace:^",
- "tiny-invariant": "^1.3.3"
- },
- "devDependencies": {
- "@vitejs/plugin-react": "^4.3.4",
- "react": "^19.0.0",
- "react-dom": "^19.0.0",
- "typescript": "^5.7.2"
- },
- "peerDependencies": {
- "react": ">=18.0.0 || >=19.0.0",
- "react-dom": ">=18.0.0 || >=19.0.0"
- }
-}
diff --git a/packages/react-start-server-functions-handler/tsconfig.json b/packages/react-start-server-functions-handler/tsconfig.json
deleted file mode 100644
index 0484835e6b..0000000000
--- a/packages/react-start-server-functions-handler/tsconfig.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "extends": "../../tsconfig.json",
- "compilerOptions": {
- "module": "esnext"
- },
- "include": ["src", "vite.config.ts"]
-}
diff --git a/packages/react-start-server-functions-handler/vite.config.ts b/packages/react-start-server-functions-handler/vite.config.ts
deleted file mode 100644
index 09a96c3c0a..0000000000
--- a/packages/react-start-server-functions-handler/vite.config.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { defineConfig, mergeConfig } from 'vitest/config'
-import { tanstackViteConfig } from '@tanstack/config/vite'
-import react from '@vitejs/plugin-react'
-import packageJson from './package.json'
-import type { ViteUserConfig } from 'vitest/config'
-
-const config = defineConfig({
- plugins: [react()] as ViteUserConfig['plugins'],
- test: {
- name: packageJson.name,
- watch: false,
- environment: 'jsdom',
- },
-})
-
-export default mergeConfig(
- config,
- tanstackViteConfig({
- entry: './src/index.ts',
- srcDir: './src',
- externalDeps: ['tsr:server-fn-manifest'],
- }),
-)
diff --git a/packages/react-start-server/src/createStartHandler.ts b/packages/react-start-server/src/createStartHandler.ts
index fcd381c492..90172fe71e 100644
--- a/packages/react-start-server/src/createStartHandler.ts
+++ b/packages/react-start-server/src/createStartHandler.ts
@@ -1,10 +1,13 @@
+import path from 'node:path'
import { createMemoryHistory } from '@tanstack/history'
import { mergeHeaders } from '@tanstack/react-start-client'
import { eventHandler, getResponseHeaders, toWebRequest } from 'h3'
import { attachRouterServerSsrUtils, dehydrateRouter } from './ssr-server'
+import serverFunctionsHandler from './server-functions-handler'
+import { getStartManifest } from './router-manifest'
import type { HandlerCallback } from './handlerCallback'
import type { EventHandlerResponse, H3Event } from 'h3'
-import type { AnyRouter, Manifest } from '@tanstack/router-core'
+import type { AnyRouter } from '@tanstack/router-core'
export type CustomizeStartHandler<
TRouter extends AnyRouter,
@@ -16,10 +19,8 @@ export function createStartHandler<
TResponse extends EventHandlerResponse = EventHandlerResponse,
>({
createRouter,
- getRouterManifest,
}: {
createRouter: () => TRouter
- getRouterManifest?: () => Manifest | Promise
}): CustomizeStartHandler {
return (cb) => {
return eventHandler(async (event) => {
@@ -28,6 +29,18 @@ export function createStartHandler<
const url = new URL(request.url)
const href = url.href.replace(url.origin, '')
+ if (!process.env.TSS_SERVER_FN_BASE) {
+ throw new Error(
+ 'tanstack/react-start-server: TSS_SERVER_FN_BASE must be defined in your environment for createStartHandler()',
+ )
+ }
+
+ if (
+ href.startsWith(path.join('/', process.env.TSS_SERVER_FN_BASE, '/'))
+ ) {
+ return await serverFunctionsHandler(event)
+ }
+
// Create a history for the router
const history = createMemoryHistory({
initialEntries: [href],
@@ -35,7 +48,7 @@ export function createStartHandler<
const router = createRouter()
- attachRouterServerSsrUtils(router, await getRouterManifest?.())
+ attachRouterServerSsrUtils(router, getStartManifest())
// Update the router with the history and context
router.update({
diff --git a/packages/react-start-server/src/h3.ts b/packages/react-start-server/src/h3.ts
new file mode 100644
index 0000000000..406cb93871
--- /dev/null
+++ b/packages/react-start-server/src/h3.ts
@@ -0,0 +1,498 @@
+import { AsyncLocalStorage } from 'node:async_hooks'
+import {
+ H3Event,
+ appendCorsHeaders as _appendCorsHeaders,
+ appendCorsPreflightHeaders as _appendCorsPreflightHeaders,
+ appendHeader as _appendHeader,
+ appendHeaders as _appendHeaders,
+ appendResponseHeader as _appendResponseHeader,
+ appendResponseHeaders as _appendResponseHeaders,
+ assertMethod as _assertMethod,
+ clearResponseHeaders as _clearResponseHeaders,
+ clearSession as _clearSession,
+ defaultContentType as _defaultContentType,
+ deleteCookie as _deleteCookie,
+ fetchWithEvent as _fetchWithEvent,
+ getCookie as _getCookie,
+ getHeader as _getHeader,
+ getHeaders as _getHeaders,
+ getProxyRequestHeaders as _getProxyRequestHeaders,
+ getQuery as _getQuery,
+ getRequestFingerprint as _getRequestFingerprint,
+ getRequestHeader as _getRequestHeader,
+ getRequestHeaders as _getRequestHeaders,
+ getRequestHost as _getRequestHost,
+ getRequestIP as _getRequestIP,
+ getRequestProtocol as _getRequestProtocol,
+ getRequestURL as _getRequestURL,
+ getRequestWebStream as _getRequestWebStream,
+ getResponseHeader as _getResponseHeader,
+ getResponseHeaders as _getResponseHeaders,
+ getResponseStatus as _getResponseStatus,
+ getResponseStatusText as _getResponseStatusText,
+ getRouterParam as _getRouterParam,
+ getRouterParams as _getRouterParams,
+ getSession as _getSession,
+ getValidatedQuery as _getValidatedQuery,
+ getValidatedRouterParams as _getValidatedRouterParams,
+ handleCacheHeaders as _handleCacheHeaders,
+ handleCors as _handleCors,
+ isMethod as _isMethod,
+ isPreflightRequest as _isPreflightRequest,
+ parseCookies as _parseCookies,
+ proxyRequest as _proxyRequest,
+ readBody as _readBody,
+ readFormData as _readFormData,
+ readMultipartFormData as _readMultipartFormData,
+ readRawBody as _readRawBody,
+ readValidatedBody as _readValidatedBody,
+ removeResponseHeader as _removeResponseHeader,
+ sealSession as _sealSession,
+ send as _send,
+ sendError as _sendError,
+ sendNoContent as _sendNoContent,
+ sendProxy as _sendProxy,
+ sendRedirect as _sendRedirect,
+ sendStream as _sendStream,
+ sendWebResponse as _sendWebResponse,
+ setCookie as _setCookie,
+ setHeader as _setHeader,
+ setHeaders as _setHeaders,
+ setResponseHeader as _setResponseHeader,
+ setResponseHeaders as _setResponseHeaders,
+ setResponseStatus as _setResponseStatus,
+ unsealSession as _unsealSession,
+ updateSession as _updateSession,
+ useSession as _useSession,
+ writeEarlyHints as _writeEarlyHints,
+} from 'h3'
+
+import { getContext as getUnctxContext } from 'unctx'
+
+import type {
+ Encoding,
+ HTTPHeaderName,
+ InferEventInput,
+ _RequestMiddleware,
+ _ResponseMiddleware,
+} from 'h3'
+
+function _setContext(event: H3Event, key: string, value: any) {
+ event.context[key] = value
+}
+
+function _getContext(event: H3Event, key: string) {
+ return event.context[key]
+}
+
+export function defineMiddleware(options: {
+ onRequest?: _RequestMiddleware | Array<_RequestMiddleware>
+ onBeforeResponse?: _ResponseMiddleware | Array<_ResponseMiddleware>
+}) {
+ return options
+}
+
+function toWebRequestH3(event: H3Event) {
+ /**
+ * @type {ReadableStream | undefined}
+ */
+ let readableStream: ReadableStream | undefined
+
+ const url = getRequestURL(event)
+ const base = {
+ // @ts-ignore Undici option
+ duplex: 'half',
+ method: event.method,
+ headers: event.headers,
+ }
+
+ if ((event.node.req as any).body instanceof ArrayBuffer) {
+ return new Request(url, {
+ ...base,
+ body: (event.node.req as any).body,
+ })
+ }
+
+ return new Request(url, {
+ ...base,
+ get body() {
+ if (readableStream) {
+ return readableStream
+ }
+ readableStream = getRequestWebStream(event)
+ return readableStream
+ },
+ })
+}
+
+export function toWebRequest(event: H3Event) {
+ event.web ??= {
+ request: toWebRequestH3(event),
+ url: getRequestURL(event),
+ }
+ return event.web.request
+}
+
+export {
+ H3Error,
+ H3Event,
+ MIMES,
+ callNodeListener,
+ createApp,
+ createAppEventHandler,
+ createEvent,
+ createRouter,
+ defineEventHandler,
+ defineLazyEventHandler,
+ defineNodeListener,
+ defineNodeMiddleware,
+ defineRequestMiddleware,
+ defineResponseMiddleware,
+ dynamicEventHandler,
+ defineWebSocket,
+ eventHandler,
+ splitCookiesString,
+ fromNodeMiddleware,
+ fromPlainHandler,
+ fromWebHandler,
+ isError,
+ isEventHandler,
+ isWebResponse,
+ lazyEventHandler,
+ promisifyNodeListener,
+ serveStatic,
+ toEventHandler,
+ toNodeListener,
+ toPlainHandler,
+ toWebHandler,
+ isCorsOriginAllowed,
+ isStream,
+ createError,
+ sanitizeStatusCode,
+ sanitizeStatusMessage,
+ useBase,
+ type AddRouteShortcuts,
+ type App,
+ type AppOptions,
+ type AppUse,
+ type CacheConditions,
+ type CreateRouterOptions,
+ type Duplex,
+ type DynamicEventHandler,
+ type Encoding,
+ type EventHandler,
+ type EventHandlerObject,
+ type EventHandlerRequest,
+ type EventHandlerResponse,
+ type H3CorsOptions,
+ type H3EventContext,
+ type HTTPHeaderName,
+ type HTTPMethod,
+ type InferEventInput,
+ type InputLayer,
+ type InputStack,
+ type Layer,
+ type LazyEventHandler,
+ type Matcher,
+ type MultiPartData,
+ type NodeEventContext,
+ type NodeListener,
+ type NodeMiddleware,
+ type NodePromisifiedHandler,
+ type PlainHandler,
+ type PlainRequest,
+ type PlainResponse,
+ type ProxyOptions,
+ type RequestFingerprintOptions,
+ type RequestHeaders,
+ type RouteNode,
+ type Router,
+ type RouterMethod,
+ type RouterUse,
+ type ServeStaticOptions,
+ type Session,
+ type SessionConfig,
+ type SessionData,
+ type Stack,
+ type StaticAssetMeta,
+ type ValidateFunction,
+ type ValidateResult,
+ type WebEventContext,
+ type WebHandler,
+ type _RequestMiddleware,
+ type _ResponseMiddleware,
+} from 'h3'
+
+function getHTTPEvent() {
+ return getEvent()
+}
+
+export function getEvent() {
+ const event = (getNitroAsyncContext().use() as any).event as
+ | H3Event
+ | undefined
+ if (!event) {
+ throw new Error(
+ `No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`,
+ )
+ }
+ return event
+}
+
+function getNitroAsyncContext() {
+ const nitroAsyncContext = getUnctxContext('nitro-app', {
+ asyncContext: true,
+ AsyncLocalStorage,
+ })
+
+ return nitroAsyncContext
+}
+
+export const HTTPEventSymbol = Symbol('$HTTPEvent')
+
+export function isEvent(
+ obj: any,
+): obj is H3Event | { [HTTPEventSymbol]: H3Event } {
+ return (
+ typeof obj === 'object' &&
+ (obj instanceof H3Event ||
+ obj?.[HTTPEventSymbol] instanceof H3Event ||
+ obj?.__is_event__ === true)
+ )
+ // Implement logic to check if obj is an H3Event
+}
+
+type Tail = T extends [any, ...infer U] ? U : never
+
+type PrependOverload<
+ TOriginal extends (...args: Array) => any,
+ TOverload extends (...args: Array) => any,
+> = TOverload & TOriginal
+
+// add an overload to the function without the event argument
+type WrapFunction) => any> = PrependOverload<
+ TFn,
+ (
+ ...args: Parameters extends [H3Event, ...infer TArgs]
+ ? TArgs
+ : Parameters
+ ) => ReturnType
+>
+
+function createWrapperFunction) => any>(
+ h3Function: TFn,
+): WrapFunction {
+ return function (...args: Array) {
+ const event = args[0]
+ if (!isEvent(event)) {
+ if (!(globalThis as any).app.config.server.experimental?.asyncContext) {
+ throw new Error(
+ 'AsyncLocalStorage was not enabled. Use the `server.experimental.asyncContext: true` option in your app configuration to enable it. Or, pass the instance of HTTPEvent that you have as the first argument to the function.',
+ )
+ }
+ args.unshift(getHTTPEvent())
+ } else {
+ args[0] =
+ event instanceof H3Event || (event as any).__is_event__
+ ? event
+ : event[HTTPEventSymbol]
+ }
+
+ return (h3Function as any)(...args)
+ } as any
+}
+
+// Creating wrappers for each utility and exporting them with their original names
+type WrappedReadRawBody = (
+ ...args: Tail>>
+) => ReturnType>
+export const readRawBody: PrependOverload<
+ typeof _readRawBody,
+ WrappedReadRawBody
+> = createWrapperFunction(_readRawBody)
+type WrappedReadBody = >(
+ ...args: Tail>>
+) => ReturnType>
+export const readBody: PrependOverload =
+ createWrapperFunction(_readBody)
+type WrappedGetQuery = <
+ T,
+ TEventInput = Exclude, undefined>,
+>(
+ ...args: Tail>>
+) => ReturnType>
+export const getQuery: PrependOverload =
+ createWrapperFunction(_getQuery)
+export const isMethod = createWrapperFunction(_isMethod)
+export const isPreflightRequest = createWrapperFunction(_isPreflightRequest)
+type WrappedGetValidatedQuery = <
+ T,
+ TEventInput = InferEventInput<'query', H3Event, T>,
+>(
+ ...args: Tail>>
+) => ReturnType>
+export const getValidatedQuery: PrependOverload<
+ typeof _getValidatedQuery,
+ WrappedGetValidatedQuery
+> = createWrapperFunction(_getValidatedQuery)
+export const getRouterParams = createWrapperFunction(_getRouterParams)
+export const getRouterParam = createWrapperFunction(_getRouterParam)
+type WrappedGetValidatedRouterParams = <
+ T,
+ TEventInput = InferEventInput<'routerParams', H3Event, T>,
+>(
+ ...args: Tail<
+ Parameters>
+ >
+) => ReturnType>
+export const getValidatedRouterParams: PrependOverload<
+ typeof _getValidatedRouterParams,
+ WrappedGetValidatedRouterParams
+> = createWrapperFunction(_getValidatedRouterParams)
+export const assertMethod = createWrapperFunction(_assertMethod)
+export const getRequestHeaders = createWrapperFunction(_getRequestHeaders)
+export const getRequestHeader = createWrapperFunction(_getRequestHeader)
+export const getRequestURL = createWrapperFunction(_getRequestURL)
+export const getRequestHost = createWrapperFunction(_getRequestHost)
+export const getRequestProtocol = createWrapperFunction(_getRequestProtocol)
+export const getRequestIP = createWrapperFunction(_getRequestIP)
+export const send = createWrapperFunction(_send)
+export const sendNoContent = createWrapperFunction(_sendNoContent)
+export const setResponseStatus = createWrapperFunction(_setResponseStatus)
+export const getResponseStatus = createWrapperFunction(_getResponseStatus)
+export const getResponseStatusText = createWrapperFunction(
+ _getResponseStatusText,
+)
+export const getResponseHeaders = createWrapperFunction(_getResponseHeaders)
+export const getResponseHeader = createWrapperFunction(_getResponseHeader)
+export const setResponseHeaders = createWrapperFunction(_setResponseHeaders)
+type WrappedSetResponseHeader = (
+ ...args: Tail>>
+) => ReturnType>
+export const setResponseHeader: PrependOverload<
+ typeof _setResponseHeader,
+ WrappedSetResponseHeader
+> = createWrapperFunction(_setResponseHeader)
+export const appendResponseHeaders = createWrapperFunction(
+ _appendResponseHeaders,
+)
+type WrappedAppendResponseHeader = (
+ ...args: Tail>>
+) => ReturnType>
+export const appendResponseHeader: PrependOverload<
+ typeof _appendResponseHeader,
+ WrappedAppendResponseHeader
+> = createWrapperFunction(_appendResponseHeader)
+export const defaultContentType = createWrapperFunction(_defaultContentType)
+export const sendRedirect = createWrapperFunction(_sendRedirect)
+export const sendStream = createWrapperFunction(_sendStream)
+export const writeEarlyHints = createWrapperFunction(_writeEarlyHints)
+export const sendError = createWrapperFunction(_sendError)
+export const sendProxy = createWrapperFunction(_sendProxy)
+export const proxyRequest = createWrapperFunction(_proxyRequest)
+type WrappedFetchWithEvent = <
+ T = unknown,
+ TResponse = any,
+ TFetch extends (req: RequestInfo | URL, opts?: any) => any = typeof fetch,
+>(
+ ...args: Tail>>
+) => ReturnType>
+export const fetchWithEvent: PrependOverload<
+ typeof _fetchWithEvent,
+ WrappedFetchWithEvent
+> = createWrapperFunction(_fetchWithEvent)
+export const getProxyRequestHeaders = createWrapperFunction(
+ _getProxyRequestHeaders,
+)
+
+export const parseCookies = createWrapperFunction(_parseCookies)
+export const getCookie = createWrapperFunction(_getCookie)
+export const setCookie = createWrapperFunction(_setCookie)
+export const deleteCookie = createWrapperFunction(_deleteCookie)
+// not exported :(
+type SessionDataT = Record
+type WrappedUseSession = (
+ ...args: Tail>>
+) => ReturnType>
+// we need to `as` these because the WrapFunction doesn't work for them
+// because they also accept CompatEvent instead of H3Event
+export const useSession = createWrapperFunction(_useSession) as PrependOverload<
+ typeof _useSession,
+ WrappedUseSession
+>
+type WrappedGetSession = (
+ ...args: Tail>>
+) => ReturnType>
+export const getSession = createWrapperFunction(_getSession) as PrependOverload<
+ typeof _getSession,
+ WrappedGetSession
+>
+type WrappedUpdateSession = (
+ ...args: Tail>>
+) => ReturnType>
+export const updateSession: PrependOverload<
+ typeof _updateSession,
+ WrappedUpdateSession
+> = createWrapperFunction(_updateSession)
+type WrappedSealSession = (
+ ...args: Tail>>
+) => ReturnType>
+export const sealSession = createWrapperFunction(
+ _sealSession,
+) as PrependOverload
+export const unsealSession = createWrapperFunction(_unsealSession)
+export const clearSession = createWrapperFunction(_clearSession)
+export const handleCacheHeaders = createWrapperFunction(_handleCacheHeaders)
+export const handleCors = createWrapperFunction(_handleCors)
+export const appendCorsHeaders = createWrapperFunction(_appendCorsHeaders)
+export const appendCorsPreflightHeaders = createWrapperFunction(
+ _appendCorsPreflightHeaders,
+)
+export const sendWebResponse = createWrapperFunction(_sendWebResponse)
+type WrappedAppendHeader = (
+ ...args: Tail>>
+) => ReturnType>
+export const appendHeader: PrependOverload<
+ typeof _appendHeader,
+ WrappedAppendHeader
+> = createWrapperFunction(_appendHeader)
+export const appendHeaders = createWrapperFunction(_appendHeaders)
+type WrappedSetHeader = (
+ ...args: Tail>>
+) => ReturnType>
+export const setHeader: PrependOverload =
+ createWrapperFunction(_setHeader)
+export const setHeaders = createWrapperFunction(_setHeaders)
+export const getHeader = createWrapperFunction(_getHeader)
+export const getHeaders = createWrapperFunction(_getHeaders)
+export const getRequestFingerprint = createWrapperFunction(
+ _getRequestFingerprint,
+)
+export const getRequestWebStream = createWrapperFunction(_getRequestWebStream)
+export const readFormData = createWrapperFunction(_readFormData)
+export const readMultipartFormData = createWrapperFunction(
+ _readMultipartFormData,
+)
+type WrappedReadValidatedBody = <
+ T,
+ TEventInput = InferEventInput<'body', H3Event, T>,
+>(
+ ...args: Tail>>
+) => ReturnType>
+export const readValidatedBody: PrependOverload<
+ typeof _readValidatedBody,
+ WrappedReadValidatedBody
+> = createWrapperFunction(_readValidatedBody)
+export const removeResponseHeader = createWrapperFunction(_removeResponseHeader)
+export const getContext = createWrapperFunction(_getContext)
+export const setContext = createWrapperFunction(_setContext)
+
+export const clearResponseHeaders = createWrapperFunction(_clearResponseHeaders)
+
+export const getWebRequest = createWrapperFunction(toWebRequest)
+
+export { createApp as createServer } from 'h3'
+
+export async function handleHTTPEvent(event: H3Event) {
+ return await (globalThis as any).$handle(event)
+}
diff --git a/packages/react-start-server/src/index.tsx b/packages/react-start-server/src/index.tsx
index d23e477dd7..de6dca17c9 100644
--- a/packages/react-start-server/src/index.tsx
+++ b/packages/react-start-server/src/index.tsx
@@ -1,508 +1,9 @@
-import { AsyncLocalStorage } from 'node:async_hooks'
-import {
- H3Event,
- appendCorsHeaders as _appendCorsHeaders,
- appendCorsPreflightHeaders as _appendCorsPreflightHeaders,
- appendHeader as _appendHeader,
- appendHeaders as _appendHeaders,
- appendResponseHeader as _appendResponseHeader,
- appendResponseHeaders as _appendResponseHeaders,
- assertMethod as _assertMethod,
- clearResponseHeaders as _clearResponseHeaders,
- clearSession as _clearSession,
- defaultContentType as _defaultContentType,
- deleteCookie as _deleteCookie,
- fetchWithEvent as _fetchWithEvent,
- getCookie as _getCookie,
- getHeader as _getHeader,
- getHeaders as _getHeaders,
- getProxyRequestHeaders as _getProxyRequestHeaders,
- getQuery as _getQuery,
- getRequestFingerprint as _getRequestFingerprint,
- getRequestHeader as _getRequestHeader,
- getRequestHeaders as _getRequestHeaders,
- getRequestHost as _getRequestHost,
- getRequestIP as _getRequestIP,
- getRequestProtocol as _getRequestProtocol,
- getRequestURL as _getRequestURL,
- getRequestWebStream as _getRequestWebStream,
- getResponseHeader as _getResponseHeader,
- getResponseHeaders as _getResponseHeaders,
- getResponseStatus as _getResponseStatus,
- getResponseStatusText as _getResponseStatusText,
- getRouterParam as _getRouterParam,
- getRouterParams as _getRouterParams,
- getSession as _getSession,
- getValidatedQuery as _getValidatedQuery,
- getValidatedRouterParams as _getValidatedRouterParams,
- handleCacheHeaders as _handleCacheHeaders,
- handleCors as _handleCors,
- isMethod as _isMethod,
- isPreflightRequest as _isPreflightRequest,
- parseCookies as _parseCookies,
- proxyRequest as _proxyRequest,
- readBody as _readBody,
- readFormData as _readFormData,
- readMultipartFormData as _readMultipartFormData,
- readRawBody as _readRawBody,
- readValidatedBody as _readValidatedBody,
- removeResponseHeader as _removeResponseHeader,
- sealSession as _sealSession,
- send as _send,
- sendError as _sendError,
- sendNoContent as _sendNoContent,
- sendProxy as _sendProxy,
- sendRedirect as _sendRedirect,
- sendStream as _sendStream,
- sendWebResponse as _sendWebResponse,
- setCookie as _setCookie,
- setHeader as _setHeader,
- setHeaders as _setHeaders,
- setResponseHeader as _setResponseHeader,
- setResponseHeaders as _setResponseHeaders,
- setResponseStatus as _setResponseStatus,
- unsealSession as _unsealSession,
- updateSession as _updateSession,
- useSession as _useSession,
- writeEarlyHints as _writeEarlyHints,
-} from 'h3'
-import { getContext as getUnctxContext } from 'unctx'
-import type {
- Encoding,
- HTTPHeaderName,
- InferEventInput,
- _RequestMiddleware,
- _ResponseMiddleware,
-} from 'h3'
-
export { StartServer } from './StartServer'
export { createStartHandler } from './createStartHandler'
export { createRequestHandler } from './createRequestHandler'
export { defaultStreamHandler } from './defaultStreamHandler'
export { defaultRenderHandler } from './defaultRenderHandler'
-
-function _setContext(event: H3Event, key: string, value: any) {
- event.context[key] = value
-}
-
-function _getContext(event: H3Event, key: string) {
- return event.context[key]
-}
-
-export function defineMiddleware(options: {
- onRequest?: _RequestMiddleware | Array<_RequestMiddleware>
- onBeforeResponse?: _ResponseMiddleware | Array<_ResponseMiddleware>
-}) {
- return options
-}
-
-function toWebRequestH3(event: H3Event) {
- /**
- * @type {ReadableStream | undefined}
- */
- let readableStream: ReadableStream | undefined
-
- const url = getRequestURL(event)
- const base = {
- // @ts-ignore Undici option
- duplex: 'half',
- method: event.method,
- headers: event.headers,
- }
-
- if ((event.node.req as any).body instanceof ArrayBuffer) {
- return new Request(url, {
- ...base,
- body: (event.node.req as any).body,
- })
- }
-
- return new Request(url, {
- ...base,
- get body() {
- if (readableStream) {
- return readableStream
- }
- readableStream = getRequestWebStream(event)
- return readableStream
- },
- })
-}
-
-export function toWebRequest(event: H3Event) {
- event.web ??= {
- request: toWebRequestH3(event),
- url: getRequestURL(event),
- }
- return event.web.request
-}
-
-export {
- H3Error,
- H3Event,
- MIMES,
- callNodeListener,
- createApp,
- createAppEventHandler,
- createEvent,
- createRouter,
- defineEventHandler,
- defineLazyEventHandler,
- defineNodeListener,
- defineNodeMiddleware,
- defineRequestMiddleware,
- defineResponseMiddleware,
- dynamicEventHandler,
- defineWebSocket,
- eventHandler,
- splitCookiesString,
- fromNodeMiddleware,
- fromPlainHandler,
- fromWebHandler,
- isError,
- isEventHandler,
- isWebResponse,
- lazyEventHandler,
- promisifyNodeListener,
- serveStatic,
- toEventHandler,
- toNodeListener,
- toPlainHandler,
- toWebHandler,
- isCorsOriginAllowed,
- isStream,
- createError,
- sanitizeStatusCode,
- sanitizeStatusMessage,
- useBase,
- type AddRouteShortcuts,
- type App,
- type AppOptions,
- type AppUse,
- type CacheConditions,
- type CreateRouterOptions,
- type Duplex,
- type DynamicEventHandler,
- type Encoding,
- type EventHandler,
- type EventHandlerObject,
- type EventHandlerRequest,
- type EventHandlerResponse,
- type H3CorsOptions,
- type H3EventContext,
- type HTTPHeaderName,
- type HTTPMethod,
- type InferEventInput,
- type InputLayer,
- type InputStack,
- type Layer,
- type LazyEventHandler,
- type Matcher,
- type MultiPartData,
- type NodeEventContext,
- type NodeListener,
- type NodeMiddleware,
- type NodePromisifiedHandler,
- type PlainHandler,
- type PlainRequest,
- type PlainResponse,
- type ProxyOptions,
- type RequestFingerprintOptions,
- type RequestHeaders,
- type RouteNode,
- type Router,
- type RouterMethod,
- type RouterUse,
- type ServeStaticOptions,
- type Session,
- type SessionConfig,
- type SessionData,
- type Stack,
- type StaticAssetMeta,
- type ValidateFunction,
- type ValidateResult,
- type WebEventContext,
- type WebHandler,
- type _RequestMiddleware,
- type _ResponseMiddleware,
-} from 'h3'
-
-function getHTTPEvent() {
- return getEvent()
-}
-
-export const HTTPEventSymbol = Symbol('$HTTPEvent')
-
-export function isEvent(
- obj: any,
-): obj is H3Event | { [HTTPEventSymbol]: H3Event } {
- return (
- typeof obj === 'object' &&
- (obj instanceof H3Event ||
- obj?.[HTTPEventSymbol] instanceof H3Event ||
- obj?.__is_event__ === true)
- )
- // Implement logic to check if obj is an H3Event
-}
-
-type Tail = T extends [any, ...infer U] ? U : never
-
-type PrependOverload<
- TOriginal extends (...args: Array) => any,
- TOverload extends (...args: Array) => any,
-> = TOverload & TOriginal
-
-// add an overload to the function without the event argument
-type WrapFunction) => any> = PrependOverload<
- TFn,
- (
- ...args: Parameters extends [H3Event, ...infer TArgs]
- ? TArgs
- : Parameters
- ) => ReturnType
->
-
-function createWrapperFunction) => any>(
- h3Function: TFn,
-): WrapFunction {
- return function (...args: Array) {
- const event = args[0]
- if (!isEvent(event)) {
- if (!(globalThis as any).app.config.server.experimental?.asyncContext) {
- throw new Error(
- 'AsyncLocalStorage was not enabled. Use the `server.experimental.asyncContext: true` option in your app configuration to enable it. Or, pass the instance of HTTPEvent that you have as the first argument to the function.',
- )
- }
- args.unshift(getHTTPEvent())
- } else {
- args[0] =
- event instanceof H3Event || (event as any).__is_event__
- ? event
- : event[HTTPEventSymbol]
- }
-
- return (h3Function as any)(...args)
- } as any
-}
-
-// Creating wrappers for each utility and exporting them with their original names
-type WrappedReadRawBody = (
- ...args: Tail>>
-) => ReturnType>
-export const readRawBody: PrependOverload<
- typeof _readRawBody,
- WrappedReadRawBody
-> = createWrapperFunction(_readRawBody)
-type WrappedReadBody = >(
- ...args: Tail>>
-) => ReturnType>
-export const readBody: PrependOverload =
- createWrapperFunction(_readBody)
-type WrappedGetQuery = <
- T,
- TEventInput = Exclude, undefined>,
->(
- ...args: Tail>>
-) => ReturnType>
-export const getQuery: PrependOverload =
- createWrapperFunction(_getQuery)
-export const isMethod = createWrapperFunction(_isMethod)
-export const isPreflightRequest = createWrapperFunction(_isPreflightRequest)
-type WrappedGetValidatedQuery = <
- T,
- TEventInput = InferEventInput<'query', H3Event, T>,
->(
- ...args: Tail>>
-) => ReturnType>
-export const getValidatedQuery: PrependOverload<
- typeof _getValidatedQuery,
- WrappedGetValidatedQuery
-> = createWrapperFunction(_getValidatedQuery)
-export const getRouterParams = createWrapperFunction(_getRouterParams)
-export const getRouterParam = createWrapperFunction(_getRouterParam)
-type WrappedGetValidatedRouterParams = <
- T,
- TEventInput = InferEventInput<'routerParams', H3Event, T>,
->(
- ...args: Tail<
- Parameters>
- >
-) => ReturnType>
-export const getValidatedRouterParams: PrependOverload<
- typeof _getValidatedRouterParams,
- WrappedGetValidatedRouterParams
-> = createWrapperFunction(_getValidatedRouterParams)
-export const assertMethod = createWrapperFunction(_assertMethod)
-export const getRequestHeaders = createWrapperFunction(_getRequestHeaders)
-export const getRequestHeader = createWrapperFunction(_getRequestHeader)
-export const getRequestURL = createWrapperFunction(_getRequestURL)
-export const getRequestHost = createWrapperFunction(_getRequestHost)
-export const getRequestProtocol = createWrapperFunction(_getRequestProtocol)
-export const getRequestIP = createWrapperFunction(_getRequestIP)
-export const send = createWrapperFunction(_send)
-export const sendNoContent = createWrapperFunction(_sendNoContent)
-export const setResponseStatus = createWrapperFunction(_setResponseStatus)
-export const getResponseStatus = createWrapperFunction(_getResponseStatus)
-export const getResponseStatusText = createWrapperFunction(
- _getResponseStatusText,
-)
-export const getResponseHeaders = createWrapperFunction(_getResponseHeaders)
-export const getResponseHeader = createWrapperFunction(_getResponseHeader)
-export const setResponseHeaders = createWrapperFunction(_setResponseHeaders)
-type WrappedSetResponseHeader = (
- ...args: Tail>>
-) => ReturnType>
-export const setResponseHeader: PrependOverload<
- typeof _setResponseHeader,
- WrappedSetResponseHeader
-> = createWrapperFunction(_setResponseHeader)
-export const appendResponseHeaders = createWrapperFunction(
- _appendResponseHeaders,
-)
-type WrappedAppendResponseHeader = (
- ...args: Tail>>
-) => ReturnType>
-export const appendResponseHeader: PrependOverload<
- typeof _appendResponseHeader,
- WrappedAppendResponseHeader
-> = createWrapperFunction(_appendResponseHeader)
-export const defaultContentType = createWrapperFunction(_defaultContentType)
-export const sendRedirect = createWrapperFunction(_sendRedirect)
-export const sendStream = createWrapperFunction(_sendStream)
-export const writeEarlyHints = createWrapperFunction(_writeEarlyHints)
-export const sendError = createWrapperFunction(_sendError)
-export const sendProxy = createWrapperFunction(_sendProxy)
-export const proxyRequest = createWrapperFunction(_proxyRequest)
-type WrappedFetchWithEvent = <
- T = unknown,
- TResponse = any,
- TFetch extends (req: RequestInfo | URL, opts?: any) => any = typeof fetch,
->(
- ...args: Tail>>
-) => ReturnType>
-export const fetchWithEvent: PrependOverload<
- typeof _fetchWithEvent,
- WrappedFetchWithEvent
-> = createWrapperFunction(_fetchWithEvent)
-export const getProxyRequestHeaders = createWrapperFunction(
- _getProxyRequestHeaders,
-)
-
-export const parseCookies = createWrapperFunction(_parseCookies)
-export const getCookie = createWrapperFunction(_getCookie)
-export const setCookie = createWrapperFunction(_setCookie)
-export const deleteCookie = createWrapperFunction(_deleteCookie)
-// not exported :(
-type SessionDataT = Record
-type WrappedUseSession = (
- ...args: Tail>>
-) => ReturnType>
-// we need to `as` these because the WrapFunction doesn't work for them
-// because they also accept CompatEvent instead of H3Event
-export const useSession = createWrapperFunction(_useSession) as PrependOverload<
- typeof _useSession,
- WrappedUseSession
->
-type WrappedGetSession = (
- ...args: Tail>>
-) => ReturnType>
-export const getSession = createWrapperFunction(_getSession) as PrependOverload<
- typeof _getSession,
- WrappedGetSession
->
-type WrappedUpdateSession = (
- ...args: Tail>>
-) => ReturnType>
-export const updateSession: PrependOverload<
- typeof _updateSession,
- WrappedUpdateSession
-> = createWrapperFunction(_updateSession)
-type WrappedSealSession = (
- ...args: Tail>>
-) => ReturnType>
-export const sealSession = createWrapperFunction(
- _sealSession,
-) as PrependOverload
-export const unsealSession = createWrapperFunction(_unsealSession)
-export const clearSession = createWrapperFunction(_clearSession)
-export const handleCacheHeaders = createWrapperFunction(_handleCacheHeaders)
-export const handleCors = createWrapperFunction(_handleCors)
-export const appendCorsHeaders = createWrapperFunction(_appendCorsHeaders)
-export const appendCorsPreflightHeaders = createWrapperFunction(
- _appendCorsPreflightHeaders,
-)
-export const sendWebResponse = createWrapperFunction(_sendWebResponse)
-type WrappedAppendHeader = (
- ...args: Tail>>
-) => ReturnType>
-export const appendHeader: PrependOverload<
- typeof _appendHeader,
- WrappedAppendHeader
-> = createWrapperFunction(_appendHeader)
-export const appendHeaders = createWrapperFunction(_appendHeaders)
-type WrappedSetHeader = (
- ...args: Tail>>
-) => ReturnType>
-export const setHeader: PrependOverload =
- createWrapperFunction(_setHeader)
-export const setHeaders = createWrapperFunction(_setHeaders)
-export const getHeader = createWrapperFunction(_getHeader)
-export const getHeaders = createWrapperFunction(_getHeaders)
-export const getRequestFingerprint = createWrapperFunction(
- _getRequestFingerprint,
-)
-export const getRequestWebStream = createWrapperFunction(_getRequestWebStream)
-export const readFormData = createWrapperFunction(_readFormData)
-export const readMultipartFormData = createWrapperFunction(
- _readMultipartFormData,
-)
-type WrappedReadValidatedBody = <
- T,
- TEventInput = InferEventInput<'body', H3Event, T>,
->(
- ...args: Tail>>
-) => ReturnType>
-export const readValidatedBody: PrependOverload<
- typeof _readValidatedBody,
- WrappedReadValidatedBody
-> = createWrapperFunction(_readValidatedBody)
-export const removeResponseHeader = createWrapperFunction(_removeResponseHeader)
-export const getContext = createWrapperFunction(_getContext)
-export const setContext = createWrapperFunction(_setContext)
-
-export const clearResponseHeaders = createWrapperFunction(_clearResponseHeaders)
-
-export const getWebRequest = createWrapperFunction(toWebRequest)
-
-export { createApp as createServer } from 'h3'
-
-function getNitroAsyncContext() {
- const nitroAsyncContext = getUnctxContext('nitro-app', {
- asyncContext: (globalThis as any).app.config.server.experimental
- ?.asyncContext
- ? true
- : false,
- AsyncLocalStorage,
- })
-
- return nitroAsyncContext
-}
-
-export function getEvent() {
- const event = (getNitroAsyncContext().use() as any).event as
- | H3Event
- | undefined
- if (!event) {
- throw new Error(
- `No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`,
- )
- }
- return event
-}
-
-export async function handleHTTPEvent(event: H3Event) {
- return await (globalThis as any).$handle(event)
-}
-
export { defineHandlerCallback } from './handlerCallback'
export type { HandlerCallback } from './handlerCallback'
+// Yes its a barrel file, sue me.
+export * from './h3'
diff --git a/packages/react-start-router-manifest/src/index.ts b/packages/react-start-server/src/router-manifest.ts
similarity index 63%
rename from packages/react-start-router-manifest/src/index.ts
rename to packages/react-start-server/src/router-manifest.ts
index c6749527d5..03c4f3fb2a 100644
--- a/packages/react-start-router-manifest/src/index.ts
+++ b/packages/react-start-server/src/router-manifest.ts
@@ -1,5 +1,6 @@
+import path from 'node:path'
// @ts-expect-error
-import tsrGetManifest from 'tsr:routes-manifest'
+import tsrStartManifest from 'tsr:start-manifest'
import type { Manifest } from '@tanstack/router-core'
function sanitizeBase(base: string) {
@@ -7,15 +8,16 @@ function sanitizeBase(base: string) {
}
/**
- * @description Returns the full, unfiltered router manifest. This includes relationships
- * between routes, assets, and preloads and is NOT what you want to serialize and
- * send to the client.
+ * @description Returns the router manifest that should be sent to the client.
+ * This includes only the assets and preloads for the current route and any
+ * special assets that are needed for the client. It does not include relationships
+ * between routes or any other data that is not needed for the client.
*/
-export function getFullRouterManifest() {
- const routerManifest = tsrGetManifest() as Manifest
+export function getStartManifest() {
+ const startManifest = tsrStartManifest() as Manifest
- const rootRoute = (routerManifest.routes.__root__ =
- routerManifest.routes.__root__ || {})
+ const rootRoute = (startManifest.routes.__root__ =
+ startManifest.routes.__root__ || {})
rootRoute.assets = rootRoute.assets || []
@@ -29,7 +31,7 @@ export function getFullRouterManifest() {
'tanstack/start-router-manifest: TSS_CLIENT_BASE must be defined in your environment for getFullRouterManifest()',
)
}
- script = `import RefreshRuntime from "/${CLIENT_BASE}/@react-refresh";
+ script = `import RefreshRuntime from "${path.join('/', '@react-refresh')}";
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
@@ -45,33 +47,29 @@ export function getFullRouterManifest() {
// invariant(importPath, 'Could not find client entry in vinxi manifest')
// }
- // rootRoute.assets.push({
- // tag: 'script',
- // attrs: {
- // type: 'module',
- // suppressHydrationWarning: true,
- // async: true,
- // },
- // children: `${script}import("${importPath}")`,
- // })
-
- return routerManifest
-}
+ if (!process.env.TSS_CLIENT_ENTRY) {
+ throw new Error(
+ 'tanstack/start-router-manifest: TSS_CLIENT_ENTRY must be defined in your environment for getStartManifest()',
+ )
+ }
-/**
- * @description Returns the router manifest that should be sent to the client.
- * This includes only the assets and preloads for the current route and any
- * special assets that are needed for the client. It does not include relationships
- * between routes or any other data that is not needed for the client.
- */
-export function getRouterManifest() {
- const routerManifest = getFullRouterManifest()
+ rootRoute.assets.push({
+ tag: 'script',
+ attrs: {
+ type: 'module',
+ suppressHydrationWarning: true,
+ async: true,
+ },
+ children: `${script};\nimport(${JSON.stringify(
+ path.join('/', process.env.TSS_CLIENT_ENTRY),
+ )})`,
+ })
// Strip out anything that isn't needed for the client
return {
- ...routerManifest,
+ ...startManifest,
routes: Object.fromEntries(
- Object.entries(routerManifest.routes).map(([k, v]: any) => {
+ Object.entries(startManifest.routes).map(([k, v]: any) => {
const { preloads, assets } = v
return [
k,
diff --git a/packages/react-start-server-functions-handler/src/index.ts b/packages/react-start-server/src/server-functions-handler.ts
similarity index 95%
rename from packages/react-start-server-functions-handler/src/index.ts
rename to packages/react-start-server/src/server-functions-handler.ts
index 4139afcd22..9f54774f05 100644
--- a/packages/react-start-server-functions-handler/src/index.ts
+++ b/packages/react-start-server/src/server-functions-handler.ts
@@ -1,19 +1,13 @@
-import { isNotFound, isRedirect } from '@tanstack/react-router'
-import invariant from 'tiny-invariant'
-import {
- eventHandler,
- getEvent,
- getResponseStatus,
- toWebRequest,
-} from '@tanstack/react-start-server'
+import { invariant, isNotFound, isRedirect } from '@tanstack/react-router'
import { startSerializer } from '@tanstack/react-start-client'
// @ts-expect-error
import _serverFnManifest from 'tsr:server-fn-manifest'
-import type { H3Event } from '@tanstack/react-start-server'
+import { eventHandler, getEvent, getResponseStatus, toWebRequest } from './h3'
+import type { H3Event } from './h3'
// NOTE: This is a dummy export to silence warnings about
// only having a default export.
-export const dummy = 1
+export const dummy = 2
export default eventHandler(handleServerAction)
@@ -94,9 +88,9 @@ async function handleServerRequest({
let fnModule: undefined | { [key: string]: any }
if (process.env.NODE_ENV === 'development') {
- fnModule = await (globalThis as any).app
- .getRouter('server')
- .internals.devServer.ssrLoadModule(serverFnInfo.extractedFilename)
+ fnModule = await (globalThis as any).viteDevServer.ssrLoadModule(
+ serverFnInfo.extractedFilename,
+ )
} else {
fnModule = await serverFnInfo.importer()
}
diff --git a/packages/react-start-server/tsconfig.json b/packages/react-start-server/tsconfig.json
index 134e51f065..108c78712f 100644
--- a/packages/react-start-server/tsconfig.json
+++ b/packages/react-start-server/tsconfig.json
@@ -4,10 +4,5 @@
"jsx": "react-jsx",
"module": "esnext"
},
- "include": [
- "src",
- "tests",
- "vite.config.ts",
- "../start-client/src/tsrScript.ts"
- ]
+ "include": ["src", "tests", "vite.config.ts"]
}
diff --git a/packages/react-start-server/vite.config.ts b/packages/react-start-server/vite.config.ts
index e05e5cc394..983ae16f57 100644
--- a/packages/react-start-server/vite.config.ts
+++ b/packages/react-start-server/vite.config.ts
@@ -19,5 +19,6 @@ export default mergeConfig(
tanstackViteConfig({
srcDir: './src',
entry: './src/index.tsx',
+ externalDeps: ['tsr:server-fn-manifest', 'tsr:start-manifest'],
}),
)
diff --git a/packages/react-start/package.json b/packages/react-start/package.json
index 9acc663ba4..be241be369 100644
--- a/packages/react-start/package.json
+++ b/packages/react-start/package.json
@@ -82,16 +82,6 @@
"default": "./dist/cjs/api.cjs"
}
},
- "./router-manifest": {
- "import": {
- "types": "./dist/esm/router-manifest.d.ts",
- "default": "./dist/esm/router-manifest.js"
- },
- "require": {
- "types": "./dist/cjs/router-manifest.d.cts",
- "default": "./dist/cjs/router-manifest.cjs"
- }
- },
"./server-functions-client": {
"import": {
"types": "./dist/esm/server-functions-client.d.ts",
@@ -112,16 +102,6 @@
"default": "./dist/cjs/server-functions-server.cjs"
}
},
- "./server-functions-handler": {
- "import": {
- "types": "./dist/esm/server-functions-handler.d.ts",
- "default": "./dist/esm/server-functions-handler.js"
- },
- "require": {
- "types": "./dist/cjs/server-functions-handler.d.cts",
- "default": "./dist/cjs/server-functions-handler.cjs"
- }
- },
"./server-functions-ssr": {
"import": {
"types": "./dist/esm/server-functions-ssr.d.ts",
@@ -146,10 +126,8 @@
"@tanstack/react-start-client": "workspace:^",
"@tanstack/react-start-server": "workspace:^",
"@tanstack/react-start-plugin": "workspace:^",
- "@tanstack/react-start-router-manifest": "workspace:^",
"@tanstack/react-start-server-functions-client": "workspace:^",
"@tanstack/start-server-functions-server": "workspace:^",
- "@tanstack/react-start-server-functions-handler": "workspace:^",
"@tanstack/react-start-server-functions-ssr": "workspace:^",
"@tanstack/react-start-api-routes": "workspace:^"
},
diff --git a/packages/react-start/src/router-manifest.tsx b/packages/react-start/src/router-manifest.tsx
deleted file mode 100644
index ce430d7884..0000000000
--- a/packages/react-start/src/router-manifest.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export * from '@tanstack/react-start-router-manifest'
diff --git a/packages/react-start/src/server-functions-handler.tsx b/packages/react-start/src/server-functions-handler.tsx
deleted file mode 100644
index 26e58e19e4..0000000000
--- a/packages/react-start/src/server-functions-handler.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export * from '@tanstack/react-start-server-functions-handler'
diff --git a/packages/react-start/vite.config.ts b/packages/react-start/vite.config.ts
index 8e960afd50..5b74f25498 100644
--- a/packages/react-start/vite.config.ts
+++ b/packages/react-start/vite.config.ts
@@ -18,7 +18,6 @@ export default mergeConfig(
'./src/client.tsx',
'./src/server.tsx',
'./src/plugin.ts',
- './src/router-manifest.tsx',
'./src/server-functions-client.tsx',
'./src/server-functions-server.tsx',
'./src/server-functions-ssr.tsx',
@@ -28,7 +27,6 @@ export default mergeConfig(
'@tanstack/react-start-client',
'@tanstack/react-start-server',
'@tanstack/react-start-plugin',
- '@tanstack/react-start-router-manifest',
'@tanstack/react-start-server-functions-client',
'@tanstack/start-server-functions-server',
'@tanstack/react-start-server-functions-ssr',
diff --git a/packages/router-plugin/src/core/code-splitter/compilers.ts b/packages/router-plugin/src/core/code-splitter/compilers.ts
index 6a4102ebc5..8646e4d779 100644
--- a/packages/router-plugin/src/core/code-splitter/compilers.ts
+++ b/packages/router-plugin/src/core/code-splitter/compilers.ts
@@ -117,6 +117,8 @@ export function compileCodeSplitReferenceRoute(
runtimeEnv: 'dev' | 'prod'
codeSplitGroupings: CodeSplitGroupings
targetFramework: Config['target']
+ filename: string
+ id: string
},
): GeneratorResult {
const ast = parseAst(opts)
@@ -406,6 +408,7 @@ export function compileCodeSplitReferenceRoute(
export function compileCodeSplitVirtualRoute(
opts: ParseAstOptions & {
splitTargets: Array
+ filename: string
},
): GeneratorResult {
const ast = parseAst(opts)
diff --git a/packages/router-plugin/src/core/router-code-splitter-plugin.ts b/packages/router-plugin/src/core/router-code-splitter-plugin.ts
index 7c1ecc17a8..6ad50650f5 100644
--- a/packages/router-plugin/src/core/router-code-splitter-plugin.ts
+++ b/packages/router-plugin/src/core/router-code-splitter-plugin.ts
@@ -104,8 +104,6 @@ export const unpluginRouterCodeSplitterFactory: UnpluginFactory<
const fromCode = detectCodeSplitGroupingsFromRoute({
code,
- root: ROOT,
- filename: id,
})
if (fromCode.groupings) {
@@ -139,11 +137,11 @@ export const unpluginRouterCodeSplitterFactory: UnpluginFactory<
const compiledReferenceRoute = compileCodeSplitReferenceRoute({
code,
- root: ROOT,
- filename: id,
runtimeEnv: isProduction ? 'prod' : 'dev',
codeSplitGroupings: splitGroupings,
targetFramework: userConfig.target,
+ filename: id,
+ id,
})
if (debug) {
@@ -178,7 +176,6 @@ export const unpluginRouterCodeSplitterFactory: UnpluginFactory<
const result = compileCodeSplitVirtualRoute({
code,
- root: ROOT,
filename: id,
splitTargets: grouping,
})
diff --git a/packages/router-utils/src/ast.ts b/packages/router-utils/src/ast.ts
index fbf6d970d5..87f175d2a3 100644
--- a/packages/router-utils/src/ast.ts
+++ b/packages/router-utils/src/ast.ts
@@ -6,9 +6,6 @@ import type * as _babel_types from '@babel/types'
export type ParseAstOptions = {
code: string
- filename: string
- root: string
- env?: 'server' | 'client' | 'ssr'
}
export function parseAst(
@@ -17,11 +14,6 @@ export function parseAst(
return parse(opts.code, {
plugins: ['jsx', 'typescript'],
sourceType: 'module',
- ...{
- root: opts.root,
- filename: opts.filename,
- env: opts.env,
- },
})
}
diff --git a/packages/server-functions-plugin/src/index.ts b/packages/server-functions-plugin/src/index.ts
index dfa8993b45..6f52ddda45 100644
--- a/packages/server-functions-plugin/src/index.ts
+++ b/packages/server-functions-plugin/src/index.ts
@@ -1,6 +1,9 @@
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'
import path from 'node:path'
-import { TanStackDirectiveFunctionsPlugin } from '@tanstack/directive-functions-plugin'
+import {
+ TanStackDirectiveFunctionsPlugin,
+ TanStackDirectiveFunctionsPluginEnv,
+} from '@tanstack/directive-functions-plugin'
import type { Plugin } from 'vite'
import type {
DirectiveFn,
@@ -79,7 +82,6 @@ export function createTanStackServerFnPlugin(opts: ServerFnPluginOpts): {
getRuntimeCode: opts.client.getRuntimeCode,
replacer: opts.client.replacer,
onDirectiveFnsById,
- // devSplitImporter: `(globalThis.app.getRouter('server').internals.devServer.ssrLoadModule)`,
}),
{
// Now that we have the directiveFnsById, we need to create a new
@@ -124,7 +126,6 @@ export function createTanStackServerFnPlugin(opts: ServerFnPluginOpts): {
getRuntimeCode: opts.ssr.getRuntimeCode,
replacer: opts.ssr.replacer,
onDirectiveFnsById,
- // devSplitImporter: `(globalThis.app.getRouter('server').internals.devServer.ssrLoadModule)`,
}),
],
server: [
@@ -185,3 +186,155 @@ export function createTanStackServerFnPlugin(opts: ServerFnPluginOpts): {
],
}
}
+
+export function TanStackServerFnPluginEnv(opts: {
+ manifestVirtualImportId: string
+ client: {
+ envName?: string
+ getRuntimeCode: () => string
+ replacer: ReplacerFn
+ }
+ server: {
+ envName?: string
+ getRuntimeCode: () => string
+ replacer: ReplacerFn
+ }
+}): Array {
+ const root = process.cwd()
+ const manifestFilename =
+ 'node_modules/.tanstack-start/server-functions-manifest.json'
+
+ globalThis.TSR_directiveFnsById = {}
+
+ const onDirectiveFnsById = (d: Record) => {
+ // When directives are compiled, save them to our global variable
+ // This variable will be used both during development to incrementally
+ // look up server functions and during build/production to produce a
+ // static manifest that can be read by the server build
+ Object.assign(
+ globalThis.TSR_directiveFnsById,
+ Object.fromEntries(
+ Object.entries(d).map(([id, fn]) => [
+ id,
+ {
+ ...fn,
+ // This importer is required for the development server to
+ // work. It's also required in production, but cannot be serialized
+ // into the manifest because it's a dynamic import. Instead, as you'll
+ // see below, we augment the manifest output with a code-generated importer
+ // that looks exactly like this.
+ importer: () => import(fn.extractedFilename),
+ },
+ ]),
+ ),
+ )
+ }
+
+ const directive = 'use server'
+ const directiveLabel = 'Server Function'
+
+ return [
+ // client: [
+ // The client plugin is used to compile the client directives
+ // and save them so we can create a manifest
+ TanStackDirectiveFunctionsPluginEnv({
+ directive,
+ directiveLabel,
+ onDirectiveFnsById,
+ environments: {
+ client: {
+ envLabel: 'Client',
+ getRuntimeCode: opts.client.getRuntimeCode,
+ replacer: opts.client.replacer,
+ },
+ server: {
+ envLabel: 'Server',
+ getRuntimeCode: opts.server.getRuntimeCode,
+ replacer: opts.server.replacer,
+ },
+ },
+ }),
+ {
+ // Now that we have the directiveFnsById, we need to create a new
+ // virtual module that can be used to import that manifest
+ name: 'tanstack-start-server-fn-vite-plugin-build-client',
+ applyToEnvironment(environment) {
+ return environment.name === opts.client.envName
+ },
+ generateBundle() {
+ // In production, we create a manifest so we can
+ // access it later in the server build, which likely does not run in the
+ // same vite build environment. This is essentially a
+ // serialized state transfer from the client build to the server
+ // build.
+
+ // Ensure the manifest directory exists
+ mkdirSync(path.dirname(manifestFilename), { recursive: true })
+
+ // Write the manifest to disk
+ writeFileSync(
+ path.join(root, manifestFilename),
+ JSON.stringify(
+ Object.fromEntries(
+ Object.entries(globalThis.TSR_directiveFnsById).map(
+ ([id, fn]) => [
+ id,
+ {
+ functionName: fn.functionName,
+ extractedFilename: fn.extractedFilename,
+ },
+ ],
+ ),
+ ),
+ ),
+ )
+ },
+ },
+ {
+ // On the server, we need to be able to read the server-function manifest from the client build.
+ // This is likely used in the handler for server functions, so we can find the server function
+ // by its ID, import it, and call it. We can't do this in memory here because the builds happen in isolation,
+ // so the manifest is like a serialized state from the client build to the server build
+ name: 'tanstack-start-server-fn-vite-plugin-manifest-server',
+ enforce: 'pre',
+ // applyToEnvironment(environment) {
+ // return environment.name === opts.server.envName
+ // },
+ resolveId: (id) => (id === opts.manifestVirtualImportId ? id : null),
+ load(id) {
+ if (id !== opts.manifestVirtualImportId) return null
+
+ // In development, we **can** use the in-memory manifest, and we should
+ // since it will be incrementally updated as we use the app and dynamic
+ // imports are triggered.
+ if (process.env.NODE_ENV === 'development') {
+ return `export default globalThis.TSR_directiveFnsById`
+ }
+
+ // In production, we need to read the manifest from the client build.
+ // The manifest at that point should contain the full set of server functions
+ // that were found in the client build.
+ const manifest = JSON.parse(
+ readFileSync(path.join(root, manifestFilename), 'utf-8'),
+ )
+
+ // The manifest has a lot of information, but for now we only need to
+ // provide the function ID for lookup and the importer for loading
+ // This should keep the manifest small for now.
+ const manifestWithImports = `
+ export default {${Object.entries(manifest)
+ .map(
+ ([id, fn]: any) =>
+ `'${id}': {
+ functionName: '${fn.functionName}',
+ importer: () => import(${JSON.stringify(fn.extractedFilename)})
+ }`,
+ )
+ .join(',')}}`
+
+ return manifestWithImports
+ },
+ },
+ // ],
+ ]
+}
diff --git a/packages/start-plugin/package.json b/packages/start-plugin/package.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/packages/start-plugin/package.json
@@ -0,0 +1 @@
+{}
diff --git a/packages/start-server-functions-server/package.json b/packages/start-server-functions-server/package.json
index 960bfbe322..be7b37de9b 100644
--- a/packages/start-server-functions-server/package.json
+++ b/packages/start-server-functions-server/package.json
@@ -63,7 +63,8 @@
},
"dependencies": {
"@tanstack/server-functions-plugin": "workspace:^",
- "tiny-invariant": "^1.3.3"
+ "tiny-invariant": "^1.3.3",
+ "vite": "6.1.0"
},
"devDependencies": {
"typescript": "^5.7.2"
diff --git a/packages/start/package.json b/packages/start/package.json
index 0457100311..72778d4b09 100644
--- a/packages/start/package.json
+++ b/packages/start/package.json
@@ -82,16 +82,6 @@
"default": "./dist/cjs/api.cjs"
}
},
- "./router-manifest": {
- "import": {
- "types": "./dist/esm/router-manifest.d.ts",
- "default": "./dist/esm/router-manifest.js"
- },
- "require": {
- "types": "./dist/cjs/router-manifest.d.cts",
- "default": "./dist/cjs/router-manifest.cjs"
- }
- },
"./server-functions-client": {
"import": {
"types": "./dist/esm/server-functions-client.d.ts",
@@ -112,16 +102,6 @@
"default": "./dist/cjs/server-functions-server.cjs"
}
},
- "./server-functions-handler": {
- "import": {
- "types": "./dist/esm/server-functions-handler.d.ts",
- "default": "./dist/esm/server-functions-handler.js"
- },
- "require": {
- "types": "./dist/cjs/server-functions-handler.d.cts",
- "default": "./dist/cjs/server-functions-handler.cjs"
- }
- },
"./server-functions-ssr": {
"import": {
"types": "./dist/esm/server-functions-ssr.d.ts",
@@ -146,10 +126,8 @@
"@tanstack/react-start-client": "workspace:^",
"@tanstack/react-start-server": "workspace:^",
"@tanstack/react-start-plugin": "workspace:^",
- "@tanstack/react-start-router-manifest": "workspace:^",
"@tanstack/react-start-server-functions-client": "workspace:^",
"@tanstack/start-server-functions-server": "workspace:^",
- "@tanstack/react-start-server-functions-handler": "workspace:^",
"@tanstack/react-start-server-functions-ssr": "workspace:^",
"@tanstack/react-start-api-routes": "workspace:^"
}
diff --git a/packages/start/src/router-manifest.tsx b/packages/start/src/router-manifest.tsx
deleted file mode 100644
index 10e98ba06d..0000000000
--- a/packages/start/src/router-manifest.tsx
+++ /dev/null
@@ -1,4 +0,0 @@
-console.warn(
- '[@tanstack/start] Warning: This package has moved to @tanstack/react-start. Please switch to the new package, as this package will be dropped soon.',
-)
-export * from '@tanstack/react-start-router-manifest'
diff --git a/packages/start/src/server-functions-handler.tsx b/packages/start/src/server-functions-handler.tsx
deleted file mode 100644
index 4ecd303e62..0000000000
--- a/packages/start/src/server-functions-handler.tsx
+++ /dev/null
@@ -1,4 +0,0 @@
-console.warn(
- '[@tanstack/start] Warning: This package has moved to @tanstack/react-start. Please switch to the new package, as this package will be dropped soon.',
-)
-export * from '@tanstack/react-start-server-functions-handler'
diff --git a/packages/start/vite.config.ts b/packages/start/vite.config.ts
index 8c696b7b37..86e0f4a63b 100644
--- a/packages/start/vite.config.ts
+++ b/packages/start/vite.config.ts
@@ -18,7 +18,6 @@ export default mergeConfig(
'./src/client.tsx',
'./src/server.tsx',
'./src/plugin.tsx',
- './src/router-manifest.tsx',
'./src/server-functions-client.tsx',
'./src/server-functions-server.tsx',
'./src/server-functions-ssr.tsx',
@@ -28,7 +27,6 @@ export default mergeConfig(
'@tanstack/react-start-client',
'@tanstack/react-start-server',
'@tanstack/react-start-plugin',
- '@tanstack/react-start-router-manifest',
'@tanstack/react-start-server-functions-client',
'@tanstack/start-server-functions-server',
'@tanstack/react-start-server-functions-ssr',
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 70a55473e2..afcc287938 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -34,7 +34,6 @@ overrides:
'@tanstack/react-start-server': workspace:*
'@tanstack/react-start-api-routes': workspace:*
'@tanstack/react-start-server-functions-fetcher': workspace:*
- '@tanstack/react-start-server-functions-handler': workspace:*
'@tanstack/react-start-server-functions-client': workspace:*
'@tanstack/react-start-server-functions-ssr': workspace:*
'@tanstack/start-server-functions-server': workspace:*
@@ -5699,18 +5698,12 @@ importers:
'@tanstack/react-start-plugin':
specifier: workspace:*
version: link:../react-start-plugin
- '@tanstack/react-start-router-manifest':
- specifier: workspace:*
- version: link:../react-start-router-manifest
'@tanstack/react-start-server':
specifier: workspace:*
version: link:../react-start-server
'@tanstack/react-start-server-functions-client':
specifier: workspace:*
version: link:../react-start-server-functions-client
- '@tanstack/react-start-server-functions-handler':
- specifier: workspace:*
- version: link:../react-start-server-functions-handler
'@tanstack/react-start-server-functions-ssr':
specifier: workspace:*
version: link:../react-start-server-functions-ssr
@@ -5891,6 +5884,9 @@ importers:
h3:
specifier: 1.13.0
version: 1.13.0
+ import-meta-resolve:
+ specifier: ^4.1.0
+ version: 4.1.0
nitropack:
specifier: ^2.10.4
version: 2.10.4(typescript@5.7.3)
@@ -5907,19 +5903,6 @@ importers:
specifier: ^3.24.2
version: 3.24.2
- packages/react-start-router-manifest:
- dependencies:
- '@tanstack/router-core':
- specifier: workspace:*
- version: link:../router-core
- tiny-invariant:
- specifier: ^1.3.3
- version: 1.3.3
- devDependencies:
- typescript:
- specifier: ^5.7.2
- version: 5.8.2
-
packages/react-start-server:
dependencies:
'@tanstack/history':
@@ -6007,34 +5990,6 @@ importers:
specifier: ^5.7.2
version: 5.8.2
- packages/react-start-server-functions-handler:
- dependencies:
- '@tanstack/react-router':
- specifier: workspace:*
- version: link:../react-router
- '@tanstack/react-start-client':
- specifier: workspace:*
- version: link:../react-start-client
- '@tanstack/react-start-server':
- specifier: workspace:*
- version: link:../react-start-server
- tiny-invariant:
- specifier: ^1.3.3
- version: 1.3.3
- devDependencies:
- '@vitejs/plugin-react':
- specifier: ^4.3.4
- version: 4.3.4(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
- react:
- specifier: ^19.0.0
- version: 19.0.0
- react-dom:
- specifier: ^19.0.0
- version: 19.0.0(react@19.0.0)
- typescript:
- specifier: ^5.7.2
- version: 5.8.2
-
packages/react-start-server-functions-ssr:
dependencies:
'@tanstack/react-start-client':
@@ -6355,7 +6310,7 @@ importers:
version: 2.11.6(@testing-library/jest-dom@6.6.3)(solid-js@1.9.5)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
zod:
specifier: ^3.23.8
- version: 3.24.1
+ version: 3.24.2
packages/solid-router-devtools:
dependencies:
@@ -6721,18 +6676,12 @@ importers:
'@tanstack/react-start-plugin':
specifier: workspace:*
version: link:../react-start-plugin
- '@tanstack/react-start-router-manifest':
- specifier: workspace:*
- version: link:../react-start-router-manifest
'@tanstack/react-start-server':
specifier: workspace:*
version: link:../react-start-server
'@tanstack/react-start-server-functions-client':
specifier: workspace:*
version: link:../react-start-server-functions-client
- '@tanstack/react-start-server-functions-handler':
- specifier: workspace:*
- version: link:../react-start-server-functions-handler
'@tanstack/react-start-server-functions-ssr':
specifier: workspace:*
version: link:../react-start-server-functions-ssr
@@ -6740,6 +6689,8 @@ importers:
specifier: workspace:*
version: link:../start-server-functions-server
+ packages/start-plugin: {}
+
packages/start-server-functions-server:
dependencies:
'@tanstack/server-functions-plugin':
@@ -6748,6 +6699,9 @@ importers:
tiny-invariant:
specifier: ^1.3.3
version: 1.3.3
+ vite:
+ specifier: 6.1.0
+ version: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
devDependencies:
typescript:
specifier: ^5.7.2
@@ -12051,6 +12005,9 @@ packages:
engines: {node: '>=8'}
hasBin: true
+ import-meta-resolve@4.1.0:
+ resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==}
+
imurmurhash@0.1.4:
resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
engines: {node: '>=0.8.19'}
@@ -15028,9 +14985,6 @@ packages:
resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==}
engines: {node: '>= 14'}
- zod@3.24.1:
- resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==}
-
zod@3.24.2:
resolution: {integrity: sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==}
@@ -20751,6 +20705,8 @@ snapshots:
pkg-dir: 4.2.0
resolve-cwd: 3.0.0
+ import-meta-resolve@4.1.0: {}
+
imurmurhash@0.1.4: {}
indent-string@4.0.0: {}
@@ -24112,6 +24068,4 @@ snapshots:
compress-commons: 6.0.2
readable-stream: 4.7.0
- zod@3.24.1: {}
-
zod@3.24.2: {}
diff --git a/scripts/publish.js b/scripts/publish.js
index 8d825110f7..bc0313f510 100644
--- a/scripts/publish.js
+++ b/scripts/publish.js
@@ -164,10 +164,6 @@ await publish({
name: '@tanstack/react-start-server-functions-fetcher',
packageDir: 'packages/react-start-server-functions-fetcher',
},
- {
- name: '@tanstack/react-start-server-functions-handler',
- packageDir: 'packages/react-start-server-functions-handler',
- },
{
name: '@tanstack/react-start-server-functions-client',
packageDir: 'packages/react-start-server-functions-client',
@@ -180,10 +176,6 @@ await publish({
name: '@tanstack/start-server-functions-server',
packageDir: 'packages/start-server-functions-server',
},
- {
- name: '@tanstack/react-start-router-manifest',
- packageDir: 'packages/react-start-router-manifest',
- },
{
name: '@tanstack/start',
packageDir: 'packages/start',
From 12ee34a157e2f211b0bbbbc45bb3baff828819c2 Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Fri, 7 Mar 2025 12:11:26 -0700
Subject: [PATCH 019/155] It's working!
---
examples/react/start-basic/app/ssr.tsx | 3 --
.../directive-functions-plugin/src/index.ts | 12 ++---
.../react-start-plugin/src/nitro/build-ssr.ts | 25 ----------
packages/react-start-server/src/h3.ts | 48 +++++++------------
.../src/server-functions-handler.ts | 12 +++--
5 files changed, 30 insertions(+), 70 deletions(-)
delete mode 100644 packages/react-start-plugin/src/nitro/build-ssr.ts
diff --git a/examples/react/start-basic/app/ssr.tsx b/examples/react/start-basic/app/ssr.tsx
index 07b04f617d..3cce9272c4 100644
--- a/examples/react/start-basic/app/ssr.tsx
+++ b/examples/react/start-basic/app/ssr.tsx
@@ -2,14 +2,11 @@ import {
createStartHandler,
defaultStreamHandler,
defineEventHandler,
- getWebRequest,
} from '@tanstack/react-start/server'
import { createRouter } from './router'
export default defineEventHandler((event) => {
- console.log(getWebRequest(event)?.url)
-
const startHandler = createStartHandler({
createRouter,
})(defaultStreamHandler)
diff --git a/packages/directive-functions-plugin/src/index.ts b/packages/directive-functions-plugin/src/index.ts
index be124822d4..d0fd8aee06 100644
--- a/packages/directive-functions-plugin/src/index.ts
+++ b/packages/directive-functions-plugin/src/index.ts
@@ -90,12 +90,12 @@ export function TanStackDirectiveFunctionsPluginEnv(
buildStart() {
root = this.environment.config.root
},
- applyToEnvironment(env) {
- return [
- opts.environments.client.envName,
- opts.environments.server.envName,
- ].includes(env.name)
- },
+ // applyToEnvironment(env) {
+ // return [
+ // opts.environments.client.envName,
+ // opts.environments.server.envName,
+ // ].includes(env.name)
+ // },
transform(code, id) {
const envOptions = [
opts.environments.client,
diff --git a/packages/react-start-plugin/src/nitro/build-ssr.ts b/packages/react-start-plugin/src/nitro/build-ssr.ts
deleted file mode 100644
index ff2a769437..0000000000
--- a/packages/react-start-plugin/src/nitro/build-ssr.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { resolve } from 'node:path'
-import { build, mergeConfig } from 'vite'
-import type { UserConfig } from 'vite'
-
-export async function buildSSRApp({
- root,
- viteConfig,
- ssrEntry,
-}: {
- root: string
- viteConfig: UserConfig
- ssrEntry: string
-}) {
- const ssrBuildConfig = mergeConfig(viteConfig, {
- build: {
- ssr: true,
- rollupOptions: {
- input: ssrEntry,
- },
- outDir: resolve(root, 'dist/ssr'),
- },
- })
-
- await build(ssrBuildConfig)
-}
diff --git a/packages/react-start-server/src/h3.ts b/packages/react-start-server/src/h3.ts
index 406cb93871..b58ba1e10a 100644
--- a/packages/react-start-server/src/h3.ts
+++ b/packages/react-start-server/src/h3.ts
@@ -11,6 +11,7 @@ import {
clearResponseHeaders as _clearResponseHeaders,
clearSession as _clearSession,
defaultContentType as _defaultContentType,
+ defineEventHandler as _defineEventHandler,
deleteCookie as _deleteCookie,
fetchWithEvent as _fetchWithEvent,
getCookie as _getCookie,
@@ -67,16 +68,17 @@ import {
writeEarlyHints as _writeEarlyHints,
} from 'h3'
-import { getContext as getUnctxContext } from 'unctx'
-
import type {
Encoding,
+ EventHandler,
HTTPHeaderName,
InferEventInput,
_RequestMiddleware,
_ResponseMiddleware,
} from 'h3'
+const eventStorage = new AsyncLocalStorage()
+
function _setContext(event: H3Event, key: string, value: any) {
event.context[key] = value
}
@@ -142,7 +144,6 @@ export {
createAppEventHandler,
createEvent,
createRouter,
- defineEventHandler,
defineLazyEventHandler,
defineNodeListener,
defineNodeMiddleware,
@@ -223,14 +224,21 @@ export {
type _ResponseMiddleware,
} from 'h3'
-function getHTTPEvent() {
- return getEvent()
+export function defineEventHandler(handler: EventHandler) {
+ return _defineEventHandler((event) => {
+ return runWithEvent(event, () => handler(event))
+ })
+}
+
+export async function runWithEvent(
+ event: H3Event,
+ fn: () => T | Promise,
+): Promise {
+ return eventStorage.run(event, fn)
}
export function getEvent() {
- const event = (getNitroAsyncContext().use() as any).event as
- | H3Event
- | undefined
+ const event = eventStorage.getStore() as H3Event | undefined
if (!event) {
throw new Error(
`No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`,
@@ -239,15 +247,6 @@ export function getEvent() {
return event
}
-function getNitroAsyncContext() {
- const nitroAsyncContext = getUnctxContext('nitro-app', {
- asyncContext: true,
- AsyncLocalStorage,
- })
-
- return nitroAsyncContext
-}
-
export const HTTPEventSymbol = Symbol('$HTTPEvent')
export function isEvent(
@@ -285,12 +284,7 @@ function createWrapperFunction) => any>(
return function (...args: Array) {
const event = args[0]
if (!isEvent(event)) {
- if (!(globalThis as any).app.config.server.experimental?.asyncContext) {
- throw new Error(
- 'AsyncLocalStorage was not enabled. Use the `server.experimental.asyncContext: true` option in your app configuration to enable it. Or, pass the instance of HTTPEvent that you have as the first argument to the function.',
- )
- }
- args.unshift(getHTTPEvent())
+ args.unshift(getEvent())
} else {
args[0] =
event instanceof H3Event || (event as any).__is_event__
@@ -486,13 +480,5 @@ export const readValidatedBody: PrependOverload<
export const removeResponseHeader = createWrapperFunction(_removeResponseHeader)
export const getContext = createWrapperFunction(_getContext)
export const setContext = createWrapperFunction(_setContext)
-
export const clearResponseHeaders = createWrapperFunction(_clearResponseHeaders)
-
export const getWebRequest = createWrapperFunction(toWebRequest)
-
-export { createApp as createServer } from 'h3'
-
-export async function handleHTTPEvent(event: H3Event) {
- return await (globalThis as any).$handle(event)
-}
diff --git a/packages/react-start-server/src/server-functions-handler.ts b/packages/react-start-server/src/server-functions-handler.ts
index 9f54774f05..87d8c51036 100644
--- a/packages/react-start-server/src/server-functions-handler.ts
+++ b/packages/react-start-server/src/server-functions-handler.ts
@@ -88,22 +88,24 @@ async function handleServerRequest({
let fnModule: undefined | { [key: string]: any }
if (process.env.NODE_ENV === 'development') {
- fnModule = await (globalThis as any).viteDevServer.ssrLoadModule(
- serverFnInfo.extractedFilename,
- )
+ const serverEnv = (globalThis as any).viteDevServer.environments['server']
+ if (!serverEnv) {
+ throw new Error(`'server' vite dev environment not found`)
+ }
+ fnModule = await serverEnv.runner.import(serverFnInfo.extractedFilename)
} else {
fnModule = await serverFnInfo.importer()
}
if (!fnModule) {
- console.log('serverFnManifest', serverFnManifest)
+ console.log('serverFnInfo', serverFnInfo)
throw new Error('Server function module not resolved for ' + serverFnId)
}
const action = fnModule[serverFnInfo.functionName]
if (!action) {
- console.log('serverFnManifest', serverFnManifest)
+ console.log('serverFnInfo', serverFnInfo)
console.log('fnModule', fnModule)
throw new Error(
`Server function module export not resolved for serverFn ID: ${serverFnId}`,
From 6fc0df9daf4d8d71367a00d67814d98a138c7837 Mon Sep 17 00:00:00 2001
From: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
Date: Sat, 8 Mar 2025 18:25:41 +1300
Subject: [PATCH 020/155] chore(root): regen lockfile
---
pnpm-lock.yaml | 243 ++++---------------------------------------------
1 file changed, 20 insertions(+), 223 deletions(-)
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index afcc287938..40ae2d4843 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -37,7 +37,6 @@ overrides:
'@tanstack/react-start-server-functions-client': workspace:*
'@tanstack/react-start-server-functions-ssr': workspace:*
'@tanstack/start-server-functions-server': workspace:*
- '@tanstack/react-start-router-manifest': workspace:*
'@tanstack/react-start-plugin': workspace:*
'@tanstack/eslint-plugin-router': workspace:*
'@tanstack/server-functions-plugin': workspace:*
@@ -1105,7 +1104,7 @@ importers:
dependencies:
'@clerk/tanstack-start':
specifier: ^0.11.0
- version: 0.11.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
+ version: 0.11.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -1913,7 +1912,7 @@ importers:
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.1
- version: 3.24.1
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -2002,7 +2001,7 @@ importers:
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.1
- version: 3.24.1
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -2063,7 +2062,7 @@ importers:
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.1
- version: 3.24.1
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -2124,7 +2123,7 @@ importers:
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.1
- version: 3.24.1
+ version: 3.24.2
devDependencies:
'@playwright/test':
specifier: ^1.50.1
@@ -2240,7 +2239,7 @@ importers:
version: 3.4.17
zod:
specifier: ^3.24.1
- version: 3.24.1
+ version: 3.24.2
devDependencies:
'@types/react':
specifier: ^19.0.8
@@ -4416,7 +4415,7 @@ importers:
dependencies:
'@clerk/tanstack-start':
specifier: 0.11.0
- version: 0.11.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
+ version: 0.11.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -4602,7 +4601,7 @@ importers:
version: 2.6.0
valibot:
specifier: ^1.0.0-beta.15
- version: 1.0.0-beta.15(typescript@5.7.3)
+ version: 1.0.0-beta.15(typescript@5.8.2)
devDependencies:
'@types/node':
specifier: ^22.5.4
@@ -4666,10 +4665,10 @@ importers:
version: 19.0.0(react@19.0.0)
vinxi:
specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0)
+ version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.1
- version: 3.24.1
+ version: 3.24.2
devDependencies:
'@types/node':
specifier: ^22.5.4
@@ -4682,10 +4681,10 @@ importers:
version: 19.0.3(@types/react@19.0.8)
typescript:
specifier: ^5.7.2
- version: 5.7.3
+ version: 5.8.2
vite-tsconfig-paths:
specifier: ^5.1.4
- version: 5.1.4(typescript@5.7.3)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
+ version: 5.1.4(typescript@5.8.2)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
examples/react/start-supabase-basic:
dependencies:
@@ -5064,7 +5063,7 @@ importers:
version: 3.4.17
zod:
specifier: ^3.24.1
- version: 3.24.1
+ version: 3.24.2
devDependencies:
'@tanstack/router-plugin':
specifier: workspace:*
@@ -5193,7 +5192,7 @@ importers:
version: 3.4.17
zod:
specifier: ^3.24.1
- version: 3.24.1
+ version: 3.24.2
devDependencies:
'@tanstack/router-plugin':
specifier: workspace:*
@@ -5276,7 +5275,7 @@ importers:
version: 3.4.17
zod:
specifier: ^3.24.1
- version: 3.24.1
+ version: 3.24.2
devDependencies:
'@tanstack/router-plugin':
specifier: workspace:*
@@ -5316,7 +5315,7 @@ importers:
version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.1
- version: 3.24.1
+ version: 3.24.2
devDependencies:
'@tailwindcss/vite':
specifier: ^4.0.8
@@ -5889,7 +5888,7 @@ importers:
version: 4.1.0
nitropack:
specifier: ^2.10.4
- version: 2.10.4(typescript@5.7.3)
+ version: 2.10.4(typescript@5.8.2)
tiny-invariant:
specifier: ^1.3.3
version: 1.3.3
@@ -6467,7 +6466,7 @@ importers:
version: 2.11.6(@testing-library/jest-dom@6.6.3)(solid-js@1.9.5)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
zod:
specifier: ^3.24.1
- version: 3.24.1
+ version: 3.24.2
packages/solid-start-plugin:
dependencies:
@@ -15306,7 +15305,7 @@ snapshots:
react: 19.0.0
react-dom: 19.0.0(react@19.0.0)
- '@clerk/tanstack-start@0.11.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)':
+ '@clerk/tanstack-start@0.11.0(@tanstack/react-router@packages+react-router)(@tanstack/react-start@packages+react-start)(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)':
dependencies:
'@clerk/backend': 1.24.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
'@clerk/clerk-react': 5.24.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
@@ -21402,104 +21401,6 @@ snapshots:
neo-async@2.6.2: {}
- nitropack@2.10.4(typescript@5.7.3):
- dependencies:
- '@cloudflare/kv-asset-handler': 0.3.4
- '@netlify/functions': 2.8.2
- '@rollup/plugin-alias': 5.1.1(rollup@4.34.0)
- '@rollup/plugin-commonjs': 28.0.2(rollup@4.34.0)
- '@rollup/plugin-inject': 5.0.5(rollup@4.34.0)
- '@rollup/plugin-json': 6.1.0(rollup@4.34.0)
- '@rollup/plugin-node-resolve': 15.3.1(rollup@4.34.0)
- '@rollup/plugin-replace': 6.0.2(rollup@4.34.0)
- '@rollup/plugin-terser': 0.4.4(rollup@4.34.0)
- '@rollup/pluginutils': 5.1.4(rollup@4.34.0)
- '@types/http-proxy': 1.17.15
- '@vercel/nft': 0.27.10(rollup@4.34.0)
- archiver: 7.0.1
- c12: 2.0.1(magicast@0.3.5)
- chokidar: 3.6.0
- citty: 0.1.6
- compatx: 0.1.8
- confbox: 0.1.8
- consola: 3.4.0
- cookie-es: 1.2.2
- croner: 9.0.0
- crossws: 0.3.3
- db0: 0.2.3
- defu: 6.1.4
- destr: 2.0.3
- dot-prop: 9.0.0
- esbuild: 0.24.2
- escape-string-regexp: 5.0.0
- etag: 1.8.1
- fs-extra: 11.3.0
- globby: 14.0.2
- gzip-size: 7.0.0
- h3: 1.13.0
- hookable: 5.5.3
- httpxy: 0.1.7
- ioredis: 5.4.2
- jiti: 2.4.2
- klona: 2.0.6
- knitwork: 1.2.0
- listhen: 1.9.0
- magic-string: 0.30.17
- magicast: 0.3.5
- mime: 4.0.6
- mlly: 1.7.4
- node-fetch-native: 1.6.6
- ofetch: 1.4.1
- ohash: 1.1.4
- openapi-typescript: 7.6.0(typescript@5.7.3)
- pathe: 1.1.2
- perfect-debounce: 1.0.0
- pkg-types: 1.3.1
- pretty-bytes: 6.1.1
- radix3: 1.1.2
- rollup: 4.34.0
- rollup-plugin-visualizer: 5.14.0(rollup@4.34.0)
- scule: 1.3.0
- semver: 7.7.0
- serve-placeholder: 2.0.2
- serve-static: 1.16.2
- std-env: 3.8.0
- ufo: 1.5.4
- uncrypto: 0.1.3
- unctx: 2.4.1
- unenv: 1.10.0
- unimport: 3.14.6(rollup@4.34.0)
- unstorage: 1.14.4(db0@0.2.3)(ioredis@5.4.2)
- untyped: 1.5.2
- unwasm: 0.3.9
- transitivePeerDependencies:
- - '@azure/app-configuration'
- - '@azure/cosmos'
- - '@azure/data-tables'
- - '@azure/identity'
- - '@azure/keyvault-secrets'
- - '@azure/storage-blob'
- - '@capacitor/preferences'
- - '@deno/kv'
- - '@electric-sql/pglite'
- - '@libsql/client'
- - '@netlify/blobs'
- - '@planetscale/database'
- - '@upstash/redis'
- - '@vercel/blob'
- - '@vercel/kv'
- - aws4fetch
- - better-sqlite3
- - drizzle-orm
- - encoding
- - idb-keyval
- - mysql2
- - rolldown
- - sqlite3
- - supports-color
- - typescript
- - uploadthing
-
nitropack@2.10.4(typescript@5.8.2):
dependencies:
'@cloudflare/kv-asset-handler': 0.3.4
@@ -21774,16 +21675,6 @@ snapshots:
is-docker: 2.2.1
is-wsl: 2.2.0
- openapi-typescript@7.6.0(typescript@5.7.3):
- dependencies:
- '@redocly/openapi-core': 1.28.0(supports-color@9.4.0)
- ansi-colors: 4.1.3
- change-case: 5.4.4
- parse-json: 8.1.0
- supports-color: 9.4.0
- typescript: 5.7.3
- yargs-parser: 21.1.1
-
openapi-typescript@7.6.0(typescript@5.8.2):
dependencies:
'@redocly/openapi-core': 1.28.0(supports-color@9.4.0)
@@ -23115,10 +23006,6 @@ snapshots:
ts-pattern@5.6.2: {}
- tsconfck@3.1.4(typescript@5.7.3):
- optionalDependencies:
- typescript: 5.7.3
-
tsconfck@3.1.4(typescript@5.8.2):
optionalDependencies:
typescript: 5.8.2
@@ -23421,85 +23308,6 @@ snapshots:
vary@1.1.2: {}
- vinxi@0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0):
- dependencies:
- '@babel/core': 7.26.8
- '@babel/plugin-syntax-jsx': 7.25.9(@babel/core@7.26.8)
- '@babel/plugin-syntax-typescript': 7.25.9(@babel/core@7.26.8)
- '@types/micromatch': 4.0.9
- '@vinxi/listhen': 1.5.6
- boxen: 7.1.1
- chokidar: 3.6.0
- citty: 0.1.6
- consola: 3.4.0
- crossws: 0.3.3
- dax-sh: 0.39.2
- defu: 6.1.4
- es-module-lexer: 1.6.0
- esbuild: 0.20.2
- fast-glob: 3.3.3
- get-port-please: 3.1.2
- h3: 1.13.0
- hookable: 5.5.3
- http-proxy: 1.18.1
- micromatch: 4.0.8
- nitropack: 2.10.4(typescript@5.7.3)
- node-fetch-native: 1.6.6
- path-to-regexp: 6.3.0
- pathe: 1.1.2
- radix3: 1.1.2
- resolve: 1.22.10
- serve-placeholder: 2.0.2
- serve-static: 1.16.2
- ufo: 1.5.4
- unctx: 2.4.1
- unenv: 1.10.0
- unstorage: 1.14.4(db0@0.2.3)(ioredis@5.4.2)
- vite: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
- zod: 3.24.2
- transitivePeerDependencies:
- - '@azure/app-configuration'
- - '@azure/cosmos'
- - '@azure/data-tables'
- - '@azure/identity'
- - '@azure/keyvault-secrets'
- - '@azure/storage-blob'
- - '@capacitor/preferences'
- - '@deno/kv'
- - '@electric-sql/pglite'
- - '@libsql/client'
- - '@netlify/blobs'
- - '@planetscale/database'
- - '@types/node'
- - '@upstash/redis'
- - '@vercel/blob'
- - '@vercel/kv'
- - aws4fetch
- - better-sqlite3
- - db0
- - debug
- - drizzle-orm
- - encoding
- - idb-keyval
- - ioredis
- - jiti
- - less
- - lightningcss
- - mysql2
- - rolldown
- - sass
- - sass-embedded
- - sqlite3
- - stylus
- - sugarss
- - supports-color
- - terser
- - tsx
- - typescript
- - uploadthing
- - xml2js
- - yaml
-
vinxi@0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0):
dependencies:
'@babel/core': 7.26.8
@@ -23535,7 +23343,7 @@ snapshots:
unenv: 1.10.0
unstorage: 1.14.4(db0@0.2.3)(ioredis@5.4.2)
vite: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
- zod: 3.24.1
+ zod: 3.24.2
transitivePeerDependencies:
- '@azure/app-configuration'
- '@azure/cosmos'
@@ -23658,17 +23466,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- vite-tsconfig-paths@5.1.4(typescript@5.7.3)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)):
- dependencies:
- debug: 4.4.0(supports-color@9.4.0)
- globrex: 0.1.2
- tsconfck: 3.1.4(typescript@5.7.3)
- optionalDependencies:
- vite: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
- transitivePeerDependencies:
- - supports-color
- - typescript
-
vite-tsconfig-paths@5.1.4(typescript@5.8.2)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)):
dependencies:
debug: 4.4.0(supports-color@9.4.0)
From 37812fcdede23a2844634ea65c74a7e4deea303b Mon Sep 17 00:00:00 2001
From: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
Date: Sat, 8 Mar 2025 18:33:17 +1300
Subject: [PATCH 021/155] fix(solid-start-plugin): build failures due to type
mismatches
---
packages/solid-start-plugin/src/compilers.ts | 7 ++++---
packages/solid-start-plugin/src/index.ts | 7 +++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/packages/solid-start-plugin/src/compilers.ts b/packages/solid-start-plugin/src/compilers.ts
index 0fd65af65c..cc1d890c68 100644
--- a/packages/solid-start-plugin/src/compilers.ts
+++ b/packages/solid-start-plugin/src/compilers.ts
@@ -17,6 +17,7 @@ const handleClientOnlyCallExpression =
type CompileOptions = ParseAstOptions & {
env: 'server' | 'client' | 'ssr'
dce?: boolean
+ filename: string
}
type IdentifierConfig = {
@@ -187,7 +188,7 @@ export function compileStartOutput(opts: CompileOptions): GeneratorResult {
function handleCreateServerFnCallExpression(
path: babel.NodePath,
- opts: ParseAstOptions,
+ opts: CompileOptions,
) {
// The function is the 'fn' property of the object passed to createServerFn
@@ -352,7 +353,7 @@ function handleCreateServerFnCallExpression(
function handleCreateMiddlewareCallExpression(
path: babel.NodePath,
- opts: ParseAstOptions,
+ opts: CompileOptions,
) {
const rootCallExpression = getRootCallExpression(path)
@@ -427,7 +428,7 @@ function handleCreateMiddlewareCallExpression(
function buildEnvOnlyCallExpressionHandler(env: 'client' | 'server') {
return function envOnlyCallExpressionHandler(
path: babel.NodePath,
- opts: ParseAstOptions,
+ opts: CompileOptions,
) {
// if (debug)
// console.info(`Handling ${env}Only call expression:`, path.toString())
diff --git a/packages/solid-start-plugin/src/index.ts b/packages/solid-start-plugin/src/index.ts
index f24f09d18a..1e856c0bda 100644
--- a/packages/solid-start-plugin/src/index.ts
+++ b/packages/solid-start-plugin/src/index.ts
@@ -86,13 +86,13 @@ export function createTanStackStartPlugin(opts: TanStackStartViteOptions): {
export function TanStackStartServerFnsAndMiddleware(opts: {
env: 'server' | 'ssr' | 'client'
}): Plugin {
- let ROOT: string = process.cwd()
+ // let ROOT: string = process.cwd()
return {
name: 'vite-plugin-tanstack-start-create-server-fn',
enforce: 'pre',
- configResolved: (config) => {
- ROOT = config.root
+ configResolved: (_config) => {
+ // ROOT = config.root
},
transform(code, id) {
const url = pathToFileURL(id)
@@ -114,7 +114,6 @@ export function TanStackStartServerFnsAndMiddleware(opts: {
const compiled = compileStartOutput({
code,
- root: ROOT,
filename: id,
env: opts.env,
})
From 4713ebf1a65a5745e795ad74e41b7e63952f9fbb Mon Sep 17 00:00:00 2001
From: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
Date: Sat, 8 Mar 2025 18:36:29 +1300
Subject: [PATCH 022/155] chore(start-plugin): cleanup this doesn't exist
anymore
---
packages/start-plugin/package.json | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 packages/start-plugin/package.json
diff --git a/packages/start-plugin/package.json b/packages/start-plugin/package.json
deleted file mode 100644
index 0967ef424b..0000000000
--- a/packages/start-plugin/package.json
+++ /dev/null
@@ -1 +0,0 @@
-{}
From 4bfb75b5567589d036ac88ec3d5c89fb8a2cceed Mon Sep 17 00:00:00 2001
From: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
Date: Sat, 8 Mar 2025 18:44:08 +1300
Subject: [PATCH 023/155] fix(react-start-plugin): use the
`__enableAPIRoutesGeneration` flag
---
packages/react-start-plugin/src/index.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/packages/react-start-plugin/src/index.ts b/packages/react-start-plugin/src/index.ts
index ca475b351e..a017bbff15 100644
--- a/packages/react-start-plugin/src/index.ts
+++ b/packages/react-start-plugin/src/index.ts
@@ -120,6 +120,7 @@ export function TanStackStartVitePlugin(
TanStackRouterVite({
...options.tsr,
enableRouteGeneration: true,
+ __enableAPIRoutesGeneration: true,
autoCodeSplitting: true,
}),
viteReact(options.react),
From 0d1fb0626998cf5392fefd0003bb82c170a461af Mon Sep 17 00:00:00 2001
From: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
Date: Sat, 8 Mar 2025 18:48:23 +1300
Subject: [PATCH 024/155] chore(root): sync lockfile and labeler config
---
.github/labeler.yml | 2 --
pnpm-lock.yaml | 2 --
2 files changed, 4 deletions(-)
diff --git a/.github/labeler.yml b/.github/labeler.yml
index 25014dccc5..a4272bf152 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -24,8 +24,6 @@
- 'packages/react-start-client/**/*'
'package: react-start-plugin':
- 'packages/react-start-plugin/**/*'
-'package: react-start-router-manifest':
- - 'packages/react-start-router-manifest/**/*'
'package: react-start-server':
- 'packages/react-start-server/**/*'
'package: react-start-server-functions-client':
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 40ae2d4843..24f48cc818 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -6688,8 +6688,6 @@ importers:
specifier: workspace:*
version: link:../start-server-functions-server
- packages/start-plugin: {}
-
packages/start-server-functions-server:
dependencies:
'@tanstack/server-functions-plugin':
From d4f0a6696641a85d026f5fa8af4b2d6d4221c246 Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Fri, 7 Mar 2025 23:03:58 -0700
Subject: [PATCH 025/155] checkpoint
---
.../framework/react/guide/tanstack-start.md | 55 +-
.../framework/react/build-from-scratch.md | 52 +-
.../start/framework/react/learn-the-basics.md | 18 +-
docs/start/framework/react/path-aliases.md | 2 +-
docs/start/framework/react/ssr.md | 4 +-
e2e/react-start/basic-auth/app/client.tsx | 7 -
.../basic-auth/tailwind.config.mjs | 2 +-
.../basic-react-query/app/client.tsx | 7 -
.../basic-react-query/tailwind.config.mjs | 2 +-
e2e/react-start/basic-rsc/app/client.tsx | 7 -
e2e/react-start/basic-rsc/tailwind.config.mjs | 2 +-
.../basic-tsr-config/src/app/client.tsx | 7 -
e2e/react-start/basic/app/client.tsx | 7 -
e2e/react-start/basic/app/ssr.tsx | 17 -
e2e/react-start/basic/tailwind.config.mjs | 2 +-
e2e/react-start/clerk-basic/app/client.tsx | 7 -
.../react-start/clerk-basic/app/server.tsx | 9 +-
.../clerk-basic/tailwind.config.mjs | 2 +-
.../scroll-restoration/app/client.tsx | 7 -
.../scroll-restoration/tailwind.config.mjs | 2 +-
.../server-functions/app/client.tsx | 7 -
.../server-functions/tailwind.config.mjs | 2 +-
.../server-functions/tsconfig.json | 2 +-
e2e/react-start/website/app/client.tsx | 7 -
e2e/react-start/website/tailwind.config.mjs | 2 +-
examples/react/start-bare/app/client.tsx | 7 -
.../react/start-bare/app/server.ts | 0
.../react/start-basic-auth/app/client.tsx | 7 -
.../react/start-basic-auth/app/server.ts | 0
examples/react/start-basic-auth/app/ssr.tsx | 12 -
.../start-basic-auth/tailwind.config.mjs | 2 +-
.../start-basic-react-query/app/client.tsx | 7 -
.../start-basic-react-query/app/server.ts | 0
.../react/start-basic-react-query/app/ssr.tsx | 12 -
.../tailwind.config.mjs | 2 +-
examples/react/start-basic-rsc/app/client.tsx | 7 -
.../react/start-basic-rsc/app/server.ts | 0
examples/react/start-basic-rsc/app/ssr.tsx | 12 -
.../react/start-basic-rsc/tailwind.config.mjs | 2 +-
.../react/start-basic-static/app/client.tsx | 7 -
.../react/start-basic-static/app/server.ts | 0
examples/react/start-basic-static/app/ssr.tsx | 12 -
.../start-basic-static/tailwind.config.cjs | 2 +-
examples/react/start-basic/app/api.ts | 6 -
examples/react/start-basic/app/client.tsx | 7 -
.../start-basic/app/global-middleware.ts | 6 -
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/components/PostError.tsx | 0
.../{app => src}/components/UserError.tsx | 0
.../react/start-basic/src/routeTree.gen.ts | 470 ++++++++++++++++++
.../react/start-basic/{app => src}/router.tsx | 0
.../react/start-basic/src/routes/__root.tsx | 139 ++++++
.../react/start-basic/src/routes/_layout.tsx | 16 +
.../src/routes/_layout/_layout-2.tsx | 34 ++
.../src/routes/_layout/_layout-2/layout-a.tsx | 9 +
.../src/routes/_layout/_layout-2/layout-b.tsx | 9 +
.../{app => src}/routes/api/users.$id.ts | 0
.../{app => src}/routes/api/users.ts | 0
.../{app => src}/routes/deferred.tsx | 0
.../start-basic/{app => src}/routes/index.tsx | 0
.../{app => src}/routes/posts.$postId.tsx | 0
.../{app => src}/routes/posts.index.tsx | 0
.../react/start-basic/src/routes/posts.tsx | 38 ++
.../routes/posts_.$postId.deep.tsx | 0
.../{app => src}/routes/redirect.tsx | 0
.../{app => src}/routes/users.$userId.tsx | 0
.../{app => src}/routes/users.index.tsx | 0
.../react/start-basic/src/routes/users.tsx | 48 ++
.../start-basic/{app => src}/styles/app.css | 0
.../{app => src}/utils/loggingMiddleware.tsx | 0
.../start-basic/{app => src}/utils/posts.tsx | 0
.../start-basic/{app => src}/utils/seo.ts | 0
.../start-basic/{app => src}/utils/users.tsx | 0
.../react/start-basic/tailwind.config.mjs | 2 +-
examples/react/start-basic/tsconfig.json | 2 +-
.../react/start-clerk-basic/app/client.tsx | 7 -
.../react/start-clerk-basic/app/server.ts | 0
examples/react/start-clerk-basic/app/ssr.tsx | 16 -
.../start-clerk-basic/tailwind.config.mjs | 2 +-
.../start-convex-trellaux/app/client.tsx | 7 -
.../react/start-convex-trellaux/app/server.ts | 0
.../react/start-convex-trellaux/app/ssr.tsx | 12 -
.../start-convex-trellaux/tailwind.config.mjs | 2 +-
examples/react/start-counter/app/client.tsx | 7 -
.../react/start-counter/app/server.ts | 0
examples/react/start-counter/app/ssr.tsx | 12 -
examples/react/start-large/app/client.tsx | 9 -
.../start-large/app/{ssr.tsx => server.ts} | 2 +-
.../react/start-large/tailwind.config.mjs | 2 +-
.../react/start-supabase-basic/app/client.tsx | 9 -
.../app/{ssr.tsx => server.ts} | 2 +-
.../start-supabase-basic/tailwind.config.mjs | 2 +-
examples/react/start-trellaux/app/client.tsx | 7 -
.../ssr.tsx => start-trellaux/app/server.ts} | 0
examples/react/start-trellaux/app/ssr.tsx | 12 -
.../react/start-trellaux/tailwind.config.mjs | 2 +-
.../with-trpc-react-query/tailwind.config.mjs | 2 +-
examples/react/with-trpc/tailwind.config.mjs | 2 +-
.../src/modules/core/template/app/ssr.tsx | 14 -
packages/react-start-plugin/src/index.ts | 44 ++
.../nitro/{plugins => }/dev-server-plugin.ts | 6 +-
.../src/nitro/nitro-plugin.ts | 6 +-
packages/react-start-plugin/src/schema.ts | 61 +--
.../src/createStartHandler.ts | 9 +
packages/react-start-server/src/h3.ts | 8 +-
.../react-start-server/src/router-manifest.ts | 2 +-
107 files changed, 913 insertions(+), 468 deletions(-)
delete mode 100644 e2e/react-start/basic-auth/app/client.tsx
delete mode 100644 e2e/react-start/basic-react-query/app/client.tsx
delete mode 100644 e2e/react-start/basic-rsc/app/client.tsx
delete mode 100644 e2e/react-start/basic-tsr-config/src/app/client.tsx
delete mode 100644 e2e/react-start/basic/app/client.tsx
delete mode 100644 e2e/react-start/basic/app/ssr.tsx
delete mode 100644 e2e/react-start/clerk-basic/app/client.tsx
rename examples/react/start-basic/app/ssr.tsx => e2e/react-start/clerk-basic/app/server.tsx (58%)
delete mode 100644 e2e/react-start/scroll-restoration/app/client.tsx
delete mode 100644 e2e/react-start/server-functions/app/client.tsx
delete mode 100644 e2e/react-start/website/app/client.tsx
delete mode 100644 examples/react/start-bare/app/client.tsx
rename e2e/react-start/basic-auth/app/ssr.tsx => examples/react/start-bare/app/server.ts (100%)
delete mode 100644 examples/react/start-basic-auth/app/client.tsx
rename e2e/react-start/basic-react-query/app/ssr.tsx => examples/react/start-basic-auth/app/server.ts (100%)
delete mode 100644 examples/react/start-basic-auth/app/ssr.tsx
delete mode 100644 examples/react/start-basic-react-query/app/client.tsx
rename e2e/react-start/basic-rsc/app/ssr.tsx => examples/react/start-basic-react-query/app/server.ts (100%)
delete mode 100644 examples/react/start-basic-react-query/app/ssr.tsx
delete mode 100644 examples/react/start-basic-rsc/app/client.tsx
rename e2e/react-start/basic-tsr-config/src/app/ssr.tsx => examples/react/start-basic-rsc/app/server.ts (100%)
delete mode 100644 examples/react/start-basic-rsc/app/ssr.tsx
delete mode 100644 examples/react/start-basic-static/app/client.tsx
rename e2e/react-start/scroll-restoration/app/ssr.tsx => examples/react/start-basic-static/app/server.ts (100%)
delete mode 100644 examples/react/start-basic-static/app/ssr.tsx
delete mode 100644 examples/react/start-basic/app/api.ts
delete mode 100644 examples/react/start-basic/app/client.tsx
delete mode 100644 examples/react/start-basic/app/global-middleware.ts
rename examples/react/start-basic/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename examples/react/start-basic/{app => src}/components/NotFound.tsx (100%)
rename examples/react/start-basic/{app => src}/components/PostError.tsx (100%)
rename examples/react/start-basic/{app => src}/components/UserError.tsx (100%)
create mode 100644 examples/react/start-basic/src/routeTree.gen.ts
rename examples/react/start-basic/{app => src}/router.tsx (100%)
create mode 100644 examples/react/start-basic/src/routes/__root.tsx
create mode 100644 examples/react/start-basic/src/routes/_layout.tsx
create mode 100644 examples/react/start-basic/src/routes/_layout/_layout-2.tsx
create mode 100644 examples/react/start-basic/src/routes/_layout/_layout-2/layout-a.tsx
create mode 100644 examples/react/start-basic/src/routes/_layout/_layout-2/layout-b.tsx
rename examples/react/start-basic/{app => src}/routes/api/users.$id.ts (100%)
rename examples/react/start-basic/{app => src}/routes/api/users.ts (100%)
rename examples/react/start-basic/{app => src}/routes/deferred.tsx (100%)
rename examples/react/start-basic/{app => src}/routes/index.tsx (100%)
rename examples/react/start-basic/{app => src}/routes/posts.$postId.tsx (100%)
rename examples/react/start-basic/{app => src}/routes/posts.index.tsx (100%)
create mode 100644 examples/react/start-basic/src/routes/posts.tsx
rename examples/react/start-basic/{app => src}/routes/posts_.$postId.deep.tsx (100%)
rename examples/react/start-basic/{app => src}/routes/redirect.tsx (100%)
rename examples/react/start-basic/{app => src}/routes/users.$userId.tsx (100%)
rename examples/react/start-basic/{app => src}/routes/users.index.tsx (100%)
create mode 100644 examples/react/start-basic/src/routes/users.tsx
rename examples/react/start-basic/{app => src}/styles/app.css (100%)
rename examples/react/start-basic/{app => src}/utils/loggingMiddleware.tsx (100%)
rename examples/react/start-basic/{app => src}/utils/posts.tsx (100%)
rename examples/react/start-basic/{app => src}/utils/seo.ts (100%)
rename examples/react/start-basic/{app => src}/utils/users.tsx (100%)
delete mode 100644 examples/react/start-clerk-basic/app/client.tsx
rename e2e/react-start/clerk-basic/app/ssr.tsx => examples/react/start-clerk-basic/app/server.ts (100%)
delete mode 100644 examples/react/start-clerk-basic/app/ssr.tsx
delete mode 100644 examples/react/start-convex-trellaux/app/client.tsx
rename e2e/react-start/server-functions/app/ssr.tsx => examples/react/start-convex-trellaux/app/server.ts (100%)
delete mode 100644 examples/react/start-convex-trellaux/app/ssr.tsx
delete mode 100644 examples/react/start-counter/app/client.tsx
rename e2e/react-start/website/app/ssr.tsx => examples/react/start-counter/app/server.ts (100%)
delete mode 100644 examples/react/start-counter/app/ssr.tsx
delete mode 100644 examples/react/start-large/app/client.tsx
rename examples/react/start-large/app/{ssr.tsx => server.ts} (94%)
delete mode 100644 examples/react/start-supabase-basic/app/client.tsx
rename examples/react/start-supabase-basic/app/{ssr.tsx => server.ts} (94%)
delete mode 100644 examples/react/start-trellaux/app/client.tsx
rename examples/react/{start-bare/app/ssr.tsx => start-trellaux/app/server.ts} (100%)
delete mode 100644 examples/react/start-trellaux/app/ssr.tsx
delete mode 100644 packages/create-start/src/modules/core/template/app/ssr.tsx
rename packages/react-start-plugin/src/nitro/{plugins => }/dev-server-plugin.ts (95%)
diff --git a/docs/router/framework/react/guide/tanstack-start.md b/docs/router/framework/react/guide/tanstack-start.md
index 900ed67df2..776cf10d80 100644
--- a/docs/router/framework/react/guide/tanstack-start.md
+++ b/docs/router/framework/react/guide/tanstack-start.md
@@ -94,12 +94,10 @@ export default defineConfig({})
# Add the Basic Templating
-There are four required files for TanStack Start usage:
+There are 2 required files for TanStack Start usage:
1. The router configuration
-2. The server entry point
-3. The client entry point
-4. The root of your application
+2. The root of your application
Once configuration is done, we'll have a file tree that looks like the following:
@@ -108,10 +106,8 @@ Once configuration is done, we'll have a file tree that looks like the following
├── app/
│ ├── routes/
│ │ └── `__root.tsx`
-│ ├── `client.tsx`
│ ├── `router.tsx`
│ ├── `routeTree.gen.ts`
-│ └── `ssr.tsx`
├── `.gitignore`
├── `app.config.ts`
├── `package.json`
@@ -120,7 +116,7 @@ Once configuration is done, we'll have a file tree that looks like the following
## The Router Configuration
-This is the file that will dictate the behavior of TanStack Router used within Start. Here, you can configure everything
+This is the file that will dictate the behavior of TanStack Router used within Start for both the server and the client. Here, you can configure everything
from the default [preloading functionality](./preloading.md) to [caching staleness](./data-loading.md).
```tsx
@@ -146,52 +142,9 @@ declare module '@tanstack/react-router' {
> `routeTree.gen.ts` is not a file you're expected to have at this point.
> It will be generated when you run TanStack Start (via `npm run dev` or `npm run start`) for the first time.
-## The Server Entry Point
-
-As TanStack Start is an [SSR](https://unicorn-utterances.com/posts/what-is-ssr-and-ssg) framework, we need to pipe this router
-information to our server entry point:
-
-```tsx
-// app/ssr.tsx
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
-```
-
-This allows us to know what routes and loaders we need to execute when the user hits a given route.
-
-## The Client Entry Point
-
-Now we need a way to hydrate our client-side JavaScript once the route resolves to the client. We do this by piping the same
-router information to our client entry point:
-
-```tsx
-// app/client.tsx
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter({
- scrollRestoration: true,
-})
-
-hydrateRoot(document!, )
-```
-
-This enables us to kick off client-side routing once the user's initial server request has fulfilled.
-
## The Root of Your Application
-Finally, we need to create the root of our application. This is the entry point for all other routes. The code in this file will wrap all other routes in the application.
+Finally, we need to create the root of our application. This is the entry point for all application routes. The code in this file will wrap all other routes in the application.
```tsx
// app/routes/__root.tsx
diff --git a/docs/start/framework/react/build-from-scratch.md b/docs/start/framework/react/build-from-scratch.md
index a09e7ff678..c6761297c1 100644
--- a/docs/start/framework/react/build-from-scratch.md
+++ b/docs/start/framework/react/build-from-scratch.md
@@ -104,12 +104,10 @@ export default defineConfig({
## Add the Basic Templating
-There are four required files for TanStack Start usage:
+There are 2 required files for TanStack Start usage:
1. The router configuration
-2. The server entry point
-3. The client entry point
-4. The root of your application
+2. The root of your application
Once configuration is done, we'll have a file tree that looks like the following:
@@ -118,10 +116,8 @@ Once configuration is done, we'll have a file tree that looks like the following
├── app/
│ ├── routes/
│ │ └── `__root.tsx`
-│ ├── `client.tsx`
│ ├── `router.tsx`
│ ├── `routeTree.gen.ts`
-│ └── `ssr.tsx`
├── `.gitignore`
├── `app.config.ts`
├── `package.json`
@@ -154,50 +150,6 @@ declare module '@tanstack/react-router' {
}
```
-> `routeTree.gen.ts` is not a file you're expected to have at this point.
-> It will be generated when you run TanStack Start (via `npm run dev` or `npm run start`) for the first time.
-
-## The Server Entry Point
-
-As TanStack Start is an [SSR](https://unicorn-utterances.com/posts/what-is-ssr-and-ssg) framework, we need to pipe this router
-information to our server entry point:
-
-```tsx
-// app/ssr.tsx
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
-```
-
-This allows us to know what routes and loaders we need to execute when the user hits a given route.
-
-## The Client Entry Point
-
-Now we need a way to hydrate our client-side JavaScript once the route resolves to the client. We do this by piping the same
-router information to our client entry point:
-
-```tsx
-// app/client.tsx
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
-```
-
-This enables us to kick off client-side routing once the user's initial server request has fulfilled.
-
## The Root of Your Application
Finally, we need to create the root of our application. This is the entry point for all other routes. The code in this file will wrap all other routes in the application.
diff --git a/docs/start/framework/react/learn-the-basics.md b/docs/start/framework/react/learn-the-basics.md
index 95ac917a6c..3df3844980 100644
--- a/docs/start/framework/react/learn-the-basics.md
+++ b/docs/start/framework/react/learn-the-basics.md
@@ -45,14 +45,15 @@ declare module '@tanstack/react-router' {
The `routeTree.gen.ts` file is generated when you run TanStack Start (via `npm run dev` or `npm run start`) for the first time. This file contains the generated route tree and a handful of TS utilities that make TanStack Start fully type-safe.
-## The Server Entry Point
+## The Server Entry Point (Optional)
-Although TanStack Start is designed with client-first APIs, it is by and large, a full-stack framework. This means that all use cases, including both dynamic and static rely on a server or build-time entry to render our application's initial HTML payload.
+> [!NOTE]
+> The server entry point is **optional** out of the box. If not provided, TanStack Start will automatically handle the server entry point for you using the below as a default.
-This is done via the `app/ssr.tsx` file:
+This is done via the `src/server.tsx` file:
```tsx
-// app/ssr.tsx
+// src/server.tsx
import {
createStartHandler,
defaultStreamHandler,
@@ -67,13 +68,16 @@ export default createStartHandler({
})(defaultStreamHandler)
```
-Whether we are statically generating our app or serving it dynamically, the `ssr.tsx` file is the entry point for doing all SSR-related work.
+Whether we are statically generating our app or serving it dynamically, the `server.tsx` file is the entry point for doing all SSR-related work.
- It's important that a new router is created for each request. This ensures that any data handled by the router is unique to the request.
- The `getRouterManifest` function is used to generate the router manifest, which is used to determine many aspects of asset management and preloading for our application.
- The `defaultStreamHandler` function is used to render our application to a stream, allowing us to take advantage of streaming HTML to the client. (This is the default handler, but you can also use other handlers like `defaultRenderHandler`, or even build your own)
-## The Client Entry Point
+## The Client Entry Point (Optional)
+
+> [!NOTE]
+> The client entry point is **optional** out of the box. If not provided, TanStack Start will automatically handle the client entry point for you using the below as a default.
Getting our html to the client is only half the battle. Once there, we need to hydrate our client-side JavaScript once the route resolves to the client. We do this by hydrating the root of our application with the `StartClient` component:
@@ -92,7 +96,7 @@ This enables us to kick off client-side routing once the user's initial server r
## The Root of Your Application
-Other than the client entry point, the `__root` route of your application is the entry point for your application. The code in this file will wrap all other routes in the app, including your home page. It behaves like a pathless layout route for your whole application.
+Other than the client entry point (which is optional by default), the `__root` route of your application is the entry point for your application. The code in this file will wrap all other routes in the app, including your home page. It behaves like a pathless layout route for your whole application.
Because it is **always rendered**, it is the perfect place to construct your application shell and take care of any global logic.
diff --git a/docs/start/framework/react/path-aliases.md b/docs/start/framework/react/path-aliases.md
index 28ecf7aa1a..ef65f4771b 100644
--- a/docs/start/framework/react/path-aliases.md
+++ b/docs/start/framework/react/path-aliases.md
@@ -12,7 +12,7 @@ By default, TanStack Start does not include path aliases. However, you can easil
"compilerOptions": {
"baseUrl": ".",
"paths": {
- "~/*": ["app/*"]
+ "~/*": ["src/*"]
}
}
}
diff --git a/docs/start/framework/react/ssr.md b/docs/start/framework/react/ssr.md
index f509d47f72..b932548555 100644
--- a/docs/start/framework/react/ssr.md
+++ b/docs/start/framework/react/ssr.md
@@ -7,10 +7,10 @@ Server-side rendering (SSR) is the process of rendering your application on the
## SSR Basics
-TanStack Start supports server-side rendering out of the box. To enable server-side rendering, create an `app/ssr.tsx` file in your project:
+TanStack Start supports server-side rendering out of the box. To enable server-side rendering, create an `src/server.tsx` file in your project:
```tsx
-// app/ssr.tsx
+// src/server.tsx
import {
createStartHandler,
diff --git a/e2e/react-start/basic-auth/app/client.tsx b/e2e/react-start/basic-auth/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/e2e/react-start/basic-auth/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/basic-auth/tailwind.config.mjs b/e2e/react-start/basic-auth/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/e2e/react-start/basic-auth/tailwind.config.mjs
+++ b/e2e/react-start/basic-auth/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/e2e/react-start/basic-react-query/app/client.tsx b/e2e/react-start/basic-react-query/app/client.tsx
deleted file mode 100644
index 9fb62bd3c2..0000000000
--- a/e2e/react-start/basic-react-query/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document!, )
diff --git a/e2e/react-start/basic-react-query/tailwind.config.mjs b/e2e/react-start/basic-react-query/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/e2e/react-start/basic-react-query/tailwind.config.mjs
+++ b/e2e/react-start/basic-react-query/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/e2e/react-start/basic-rsc/app/client.tsx b/e2e/react-start/basic-rsc/app/client.tsx
deleted file mode 100644
index 9fb62bd3c2..0000000000
--- a/e2e/react-start/basic-rsc/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document!, )
diff --git a/e2e/react-start/basic-rsc/tailwind.config.mjs b/e2e/react-start/basic-rsc/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/e2e/react-start/basic-rsc/tailwind.config.mjs
+++ b/e2e/react-start/basic-rsc/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/e2e/react-start/basic-tsr-config/src/app/client.tsx b/e2e/react-start/basic-tsr-config/src/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/e2e/react-start/basic-tsr-config/src/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/basic/app/client.tsx b/e2e/react-start/basic/app/client.tsx
deleted file mode 100644
index ffee5f382c..0000000000
--- a/e2e/react-start/basic/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/basic/app/ssr.tsx b/e2e/react-start/basic/app/ssr.tsx
deleted file mode 100644
index de2ca15a47..0000000000
--- a/e2e/react-start/basic/app/ssr.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
- defineEventHandler,
-} from '@tanstack/start/server'
-import { getRouterManifest } from '@tanstack/start/router-manifest'
-
-import { createRouter } from './router'
-
-export default defineEventHandler((event) => {
- const startHandler = createStartHandler({
- createRouter,
- getRouterManifest,
- })(defaultStreamHandler)
-
- return startHandler(event)
-})
diff --git a/e2e/react-start/basic/tailwind.config.mjs b/e2e/react-start/basic/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/e2e/react-start/basic/tailwind.config.mjs
+++ b/e2e/react-start/basic/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/e2e/react-start/clerk-basic/app/client.tsx b/e2e/react-start/clerk-basic/app/client.tsx
deleted file mode 100644
index 9fb62bd3c2..0000000000
--- a/e2e/react-start/clerk-basic/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document!, )
diff --git a/examples/react/start-basic/app/ssr.tsx b/e2e/react-start/clerk-basic/app/server.tsx
similarity index 58%
rename from examples/react/start-basic/app/ssr.tsx
rename to e2e/react-start/clerk-basic/app/server.tsx
index 3cce9272c4..3283a1ba85 100644
--- a/examples/react/start-basic/app/ssr.tsx
+++ b/e2e/react-start/clerk-basic/app/server.tsx
@@ -3,13 +3,16 @@ import {
defaultStreamHandler,
defineEventHandler,
} from '@tanstack/react-start/server'
-
+import { createClerkHandler } from '@clerk/tanstack-start/server'
import { createRouter } from './router'
export default defineEventHandler((event) => {
const startHandler = createStartHandler({
createRouter,
- })(defaultStreamHandler)
+ })
+
+ const withClerkHandler =
+ createClerkHandler(startHandler)(defaultStreamHandler)
- return startHandler(event)
+ return withClerkHandler(event)
})
diff --git a/e2e/react-start/clerk-basic/tailwind.config.mjs b/e2e/react-start/clerk-basic/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/e2e/react-start/clerk-basic/tailwind.config.mjs
+++ b/e2e/react-start/clerk-basic/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/e2e/react-start/scroll-restoration/app/client.tsx b/e2e/react-start/scroll-restoration/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/e2e/react-start/scroll-restoration/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/scroll-restoration/tailwind.config.mjs b/e2e/react-start/scroll-restoration/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/e2e/react-start/scroll-restoration/tailwind.config.mjs
+++ b/e2e/react-start/scroll-restoration/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/e2e/react-start/server-functions/app/client.tsx b/e2e/react-start/server-functions/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/e2e/react-start/server-functions/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/server-functions/tailwind.config.mjs b/e2e/react-start/server-functions/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/e2e/react-start/server-functions/tailwind.config.mjs
+++ b/e2e/react-start/server-functions/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/e2e/react-start/server-functions/tsconfig.json b/e2e/react-start/server-functions/tsconfig.json
index 15d0654dae..2c6f205688 100644
--- a/e2e/react-start/server-functions/tsconfig.json
+++ b/e2e/react-start/server-functions/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": "",
"paths": {
- "~/*": ["app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/e2e/react-start/website/app/client.tsx b/e2e/react-start/website/app/client.tsx
deleted file mode 100644
index 9fb62bd3c2..0000000000
--- a/e2e/react-start/website/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document!, )
diff --git a/e2e/react-start/website/tailwind.config.mjs b/e2e/react-start/website/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/e2e/react-start/website/tailwind.config.mjs
+++ b/e2e/react-start/website/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/examples/react/start-bare/app/client.tsx b/examples/react/start-bare/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/examples/react/start-bare/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/basic-auth/app/ssr.tsx b/examples/react/start-bare/app/server.ts
similarity index 100%
rename from e2e/react-start/basic-auth/app/ssr.tsx
rename to examples/react/start-bare/app/server.ts
diff --git a/examples/react/start-basic-auth/app/client.tsx b/examples/react/start-basic-auth/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/examples/react/start-basic-auth/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/basic-react-query/app/ssr.tsx b/examples/react/start-basic-auth/app/server.ts
similarity index 100%
rename from e2e/react-start/basic-react-query/app/ssr.tsx
rename to examples/react/start-basic-auth/app/server.ts
diff --git a/examples/react/start-basic-auth/app/ssr.tsx b/examples/react/start-basic-auth/app/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/examples/react/start-basic-auth/app/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-basic-auth/tailwind.config.mjs b/examples/react/start-basic-auth/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/examples/react/start-basic-auth/tailwind.config.mjs
+++ b/examples/react/start-basic-auth/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/examples/react/start-basic-react-query/app/client.tsx b/examples/react/start-basic-react-query/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/examples/react/start-basic-react-query/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/basic-rsc/app/ssr.tsx b/examples/react/start-basic-react-query/app/server.ts
similarity index 100%
rename from e2e/react-start/basic-rsc/app/ssr.tsx
rename to examples/react/start-basic-react-query/app/server.ts
diff --git a/examples/react/start-basic-react-query/app/ssr.tsx b/examples/react/start-basic-react-query/app/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/examples/react/start-basic-react-query/app/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-basic-react-query/tailwind.config.mjs b/examples/react/start-basic-react-query/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/examples/react/start-basic-react-query/tailwind.config.mjs
+++ b/examples/react/start-basic-react-query/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/examples/react/start-basic-rsc/app/client.tsx b/examples/react/start-basic-rsc/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/examples/react/start-basic-rsc/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/basic-tsr-config/src/app/ssr.tsx b/examples/react/start-basic-rsc/app/server.ts
similarity index 100%
rename from e2e/react-start/basic-tsr-config/src/app/ssr.tsx
rename to examples/react/start-basic-rsc/app/server.ts
diff --git a/examples/react/start-basic-rsc/app/ssr.tsx b/examples/react/start-basic-rsc/app/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/examples/react/start-basic-rsc/app/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-basic-rsc/tailwind.config.mjs b/examples/react/start-basic-rsc/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/examples/react/start-basic-rsc/tailwind.config.mjs
+++ b/examples/react/start-basic-rsc/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/examples/react/start-basic-static/app/client.tsx b/examples/react/start-basic-static/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/examples/react/start-basic-static/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/scroll-restoration/app/ssr.tsx b/examples/react/start-basic-static/app/server.ts
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/ssr.tsx
rename to examples/react/start-basic-static/app/server.ts
diff --git a/examples/react/start-basic-static/app/ssr.tsx b/examples/react/start-basic-static/app/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/examples/react/start-basic-static/app/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-basic-static/tailwind.config.cjs b/examples/react/start-basic-static/tailwind.config.cjs
index 75fe25dbf7..10c9224f8c 100644
--- a/examples/react/start-basic-static/tailwind.config.cjs
+++ b/examples/react/start-basic-static/tailwind.config.cjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
- content: ['./app/**/*.{js,ts,jsx,tsx}'],
+ content: ['./src/**/*.{js,ts,jsx,tsx}'],
}
diff --git a/examples/react/start-basic/app/api.ts b/examples/react/start-basic/app/api.ts
deleted file mode 100644
index 8b9fef1667..0000000000
--- a/examples/react/start-basic/app/api.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import {
- createStartAPIHandler,
- defaultAPIFileRouteHandler,
-} from '@tanstack/react-start/api'
-
-export default createStartAPIHandler(defaultAPIFileRouteHandler)
diff --git a/examples/react/start-basic/app/client.tsx b/examples/react/start-basic/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/examples/react/start-basic/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/examples/react/start-basic/app/global-middleware.ts b/examples/react/start-basic/app/global-middleware.ts
deleted file mode 100644
index c7e7af599f..0000000000
--- a/examples/react/start-basic/app/global-middleware.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { registerGlobalMiddleware } from '@tanstack/react-start'
-import { logMiddleware } from './utils/loggingMiddleware'
-
-registerGlobalMiddleware({
- middleware: [logMiddleware],
-})
diff --git a/examples/react/start-basic/app/components/DefaultCatchBoundary.tsx b/examples/react/start-basic/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from examples/react/start-basic/app/components/DefaultCatchBoundary.tsx
rename to examples/react/start-basic/src/components/DefaultCatchBoundary.tsx
diff --git a/examples/react/start-basic/app/components/NotFound.tsx b/examples/react/start-basic/src/components/NotFound.tsx
similarity index 100%
rename from examples/react/start-basic/app/components/NotFound.tsx
rename to examples/react/start-basic/src/components/NotFound.tsx
diff --git a/examples/react/start-basic/app/components/PostError.tsx b/examples/react/start-basic/src/components/PostError.tsx
similarity index 100%
rename from examples/react/start-basic/app/components/PostError.tsx
rename to examples/react/start-basic/src/components/PostError.tsx
diff --git a/examples/react/start-basic/app/components/UserError.tsx b/examples/react/start-basic/src/components/UserError.tsx
similarity index 100%
rename from examples/react/start-basic/app/components/UserError.tsx
rename to examples/react/start-basic/src/components/UserError.tsx
diff --git a/examples/react/start-basic/src/routeTree.gen.ts b/examples/react/start-basic/src/routeTree.gen.ts
new file mode 100644
index 0000000000..9f7ab8107b
--- /dev/null
+++ b/examples/react/start-basic/src/routeTree.gen.ts
@@ -0,0 +1,470 @@
+/* eslint-disable */
+
+// @ts-nocheck
+
+// noinspection JSUnusedGlobalSymbols
+
+// This file was automatically generated by TanStack Router.
+// You should NOT make any changes in this file as it will be overwritten.
+// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
+
+// Import Routes
+
+import { Route as rootRoute } from './routes/__root'
+import { Route as UsersImport } from './routes/users'
+import { Route as RedirectImport } from './routes/redirect'
+import { Route as PostsImport } from './routes/posts'
+import { Route as DeferredImport } from './routes/deferred'
+import { Route as LayoutImport } from './routes/_layout'
+import { Route as IndexImport } from './routes/index'
+import { Route as UsersIndexImport } from './routes/users.index'
+import { Route as PostsIndexImport } from './routes/posts.index'
+import { Route as UsersUserIdImport } from './routes/users.$userId'
+import { Route as PostsPostIdImport } from './routes/posts.$postId'
+import { Route as LayoutLayout2Import } from './routes/_layout/_layout-2'
+import { Route as PostsPostIdDeepImport } from './routes/posts_.$postId.deep'
+import { Route as LayoutLayout2LayoutBImport } from './routes/_layout/_layout-2/layout-b'
+import { Route as LayoutLayout2LayoutAImport } from './routes/_layout/_layout-2/layout-a'
+
+// Create/Update Routes
+
+const UsersRoute = UsersImport.update({
+ id: '/users',
+ path: '/users',
+ getParentRoute: () => rootRoute,
+} as any)
+
+const RedirectRoute = RedirectImport.update({
+ id: '/redirect',
+ path: '/redirect',
+ getParentRoute: () => rootRoute,
+} as any)
+
+const PostsRoute = PostsImport.update({
+ id: '/posts',
+ path: '/posts',
+ getParentRoute: () => rootRoute,
+} as any)
+
+const DeferredRoute = DeferredImport.update({
+ id: '/deferred',
+ path: '/deferred',
+ getParentRoute: () => rootRoute,
+} as any)
+
+const LayoutRoute = LayoutImport.update({
+ id: '/_layout',
+ getParentRoute: () => rootRoute,
+} as any)
+
+const IndexRoute = IndexImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => rootRoute,
+} as any)
+
+const UsersIndexRoute = UsersIndexImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => UsersRoute,
+} as any)
+
+const PostsIndexRoute = PostsIndexImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => PostsRoute,
+} as any)
+
+const UsersUserIdRoute = UsersUserIdImport.update({
+ id: '/$userId',
+ path: '/$userId',
+ getParentRoute: () => UsersRoute,
+} as any)
+
+const PostsPostIdRoute = PostsPostIdImport.update({
+ id: '/$postId',
+ path: '/$postId',
+ getParentRoute: () => PostsRoute,
+} as any)
+
+const LayoutLayout2Route = LayoutLayout2Import.update({
+ id: '/_layout-2',
+ getParentRoute: () => LayoutRoute,
+} as any)
+
+const PostsPostIdDeepRoute = PostsPostIdDeepImport.update({
+ id: '/posts_/$postId/deep',
+ path: '/posts/$postId/deep',
+ getParentRoute: () => rootRoute,
+} as any)
+
+const LayoutLayout2LayoutBRoute = LayoutLayout2LayoutBImport.update({
+ id: '/layout-b',
+ path: '/layout-b',
+ getParentRoute: () => LayoutLayout2Route,
+} as any)
+
+const LayoutLayout2LayoutARoute = LayoutLayout2LayoutAImport.update({
+ id: '/layout-a',
+ path: '/layout-a',
+ getParentRoute: () => LayoutLayout2Route,
+} as any)
+
+// Populate the FileRoutesByPath interface
+
+declare module '@tanstack/react-router' {
+ interface FileRoutesByPath {
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexImport
+ parentRoute: typeof rootRoute
+ }
+ '/_layout': {
+ id: '/_layout'
+ path: ''
+ fullPath: ''
+ preLoaderRoute: typeof LayoutImport
+ parentRoute: typeof rootRoute
+ }
+ '/deferred': {
+ id: '/deferred'
+ path: '/deferred'
+ fullPath: '/deferred'
+ preLoaderRoute: typeof DeferredImport
+ parentRoute: typeof rootRoute
+ }
+ '/posts': {
+ id: '/posts'
+ path: '/posts'
+ fullPath: '/posts'
+ preLoaderRoute: typeof PostsImport
+ parentRoute: typeof rootRoute
+ }
+ '/redirect': {
+ id: '/redirect'
+ path: '/redirect'
+ fullPath: '/redirect'
+ preLoaderRoute: typeof RedirectImport
+ parentRoute: typeof rootRoute
+ }
+ '/users': {
+ id: '/users'
+ path: '/users'
+ fullPath: '/users'
+ preLoaderRoute: typeof UsersImport
+ parentRoute: typeof rootRoute
+ }
+ '/_layout/_layout-2': {
+ id: '/_layout/_layout-2'
+ path: ''
+ fullPath: ''
+ preLoaderRoute: typeof LayoutLayout2Import
+ parentRoute: typeof LayoutImport
+ }
+ '/posts/$postId': {
+ id: '/posts/$postId'
+ path: '/$postId'
+ fullPath: '/posts/$postId'
+ preLoaderRoute: typeof PostsPostIdImport
+ parentRoute: typeof PostsImport
+ }
+ '/users/$userId': {
+ id: '/users/$userId'
+ path: '/$userId'
+ fullPath: '/users/$userId'
+ preLoaderRoute: typeof UsersUserIdImport
+ parentRoute: typeof UsersImport
+ }
+ '/posts/': {
+ id: '/posts/'
+ path: '/'
+ fullPath: '/posts/'
+ preLoaderRoute: typeof PostsIndexImport
+ parentRoute: typeof PostsImport
+ }
+ '/users/': {
+ id: '/users/'
+ path: '/'
+ fullPath: '/users/'
+ preLoaderRoute: typeof UsersIndexImport
+ parentRoute: typeof UsersImport
+ }
+ '/_layout/_layout-2/layout-a': {
+ id: '/_layout/_layout-2/layout-a'
+ path: '/layout-a'
+ fullPath: '/layout-a'
+ preLoaderRoute: typeof LayoutLayout2LayoutAImport
+ parentRoute: typeof LayoutLayout2Import
+ }
+ '/_layout/_layout-2/layout-b': {
+ id: '/_layout/_layout-2/layout-b'
+ path: '/layout-b'
+ fullPath: '/layout-b'
+ preLoaderRoute: typeof LayoutLayout2LayoutBImport
+ parentRoute: typeof LayoutLayout2Import
+ }
+ '/posts_/$postId/deep': {
+ id: '/posts_/$postId/deep'
+ path: '/posts/$postId/deep'
+ fullPath: '/posts/$postId/deep'
+ preLoaderRoute: typeof PostsPostIdDeepImport
+ parentRoute: typeof rootRoute
+ }
+ }
+}
+
+// Create and export the route tree
+
+interface LayoutLayout2RouteChildren {
+ LayoutLayout2LayoutARoute: typeof LayoutLayout2LayoutARoute
+ LayoutLayout2LayoutBRoute: typeof LayoutLayout2LayoutBRoute
+}
+
+const LayoutLayout2RouteChildren: LayoutLayout2RouteChildren = {
+ LayoutLayout2LayoutARoute: LayoutLayout2LayoutARoute,
+ LayoutLayout2LayoutBRoute: LayoutLayout2LayoutBRoute,
+}
+
+const LayoutLayout2RouteWithChildren = LayoutLayout2Route._addFileChildren(
+ LayoutLayout2RouteChildren,
+)
+
+interface LayoutRouteChildren {
+ LayoutLayout2Route: typeof LayoutLayout2RouteWithChildren
+}
+
+const LayoutRouteChildren: LayoutRouteChildren = {
+ LayoutLayout2Route: LayoutLayout2RouteWithChildren,
+}
+
+const LayoutRouteWithChildren =
+ LayoutRoute._addFileChildren(LayoutRouteChildren)
+
+interface PostsRouteChildren {
+ PostsPostIdRoute: typeof PostsPostIdRoute
+ PostsIndexRoute: typeof PostsIndexRoute
+}
+
+const PostsRouteChildren: PostsRouteChildren = {
+ PostsPostIdRoute: PostsPostIdRoute,
+ PostsIndexRoute: PostsIndexRoute,
+}
+
+const PostsRouteWithChildren = PostsRoute._addFileChildren(PostsRouteChildren)
+
+interface UsersRouteChildren {
+ UsersUserIdRoute: typeof UsersUserIdRoute
+ UsersIndexRoute: typeof UsersIndexRoute
+}
+
+const UsersRouteChildren: UsersRouteChildren = {
+ UsersUserIdRoute: UsersUserIdRoute,
+ UsersIndexRoute: UsersIndexRoute,
+}
+
+const UsersRouteWithChildren = UsersRoute._addFileChildren(UsersRouteChildren)
+
+export interface FileRoutesByFullPath {
+ '/': typeof IndexRoute
+ '': typeof LayoutLayout2RouteWithChildren
+ '/deferred': typeof DeferredRoute
+ '/posts': typeof PostsRouteWithChildren
+ '/redirect': typeof RedirectRoute
+ '/users': typeof UsersRouteWithChildren
+ '/posts/$postId': typeof PostsPostIdRoute
+ '/users/$userId': typeof UsersUserIdRoute
+ '/posts/': typeof PostsIndexRoute
+ '/users/': typeof UsersIndexRoute
+ '/layout-a': typeof LayoutLayout2LayoutARoute
+ '/layout-b': typeof LayoutLayout2LayoutBRoute
+ '/posts/$postId/deep': typeof PostsPostIdDeepRoute
+}
+
+export interface FileRoutesByTo {
+ '/': typeof IndexRoute
+ '': typeof LayoutLayout2RouteWithChildren
+ '/deferred': typeof DeferredRoute
+ '/redirect': typeof RedirectRoute
+ '/posts/$postId': typeof PostsPostIdRoute
+ '/users/$userId': typeof UsersUserIdRoute
+ '/posts': typeof PostsIndexRoute
+ '/users': typeof UsersIndexRoute
+ '/layout-a': typeof LayoutLayout2LayoutARoute
+ '/layout-b': typeof LayoutLayout2LayoutBRoute
+ '/posts/$postId/deep': typeof PostsPostIdDeepRoute
+}
+
+export interface FileRoutesById {
+ __root__: typeof rootRoute
+ '/': typeof IndexRoute
+ '/_layout': typeof LayoutRouteWithChildren
+ '/deferred': typeof DeferredRoute
+ '/posts': typeof PostsRouteWithChildren
+ '/redirect': typeof RedirectRoute
+ '/users': typeof UsersRouteWithChildren
+ '/_layout/_layout-2': typeof LayoutLayout2RouteWithChildren
+ '/posts/$postId': typeof PostsPostIdRoute
+ '/users/$userId': typeof UsersUserIdRoute
+ '/posts/': typeof PostsIndexRoute
+ '/users/': typeof UsersIndexRoute
+ '/_layout/_layout-2/layout-a': typeof LayoutLayout2LayoutARoute
+ '/_layout/_layout-2/layout-b': typeof LayoutLayout2LayoutBRoute
+ '/posts_/$postId/deep': typeof PostsPostIdDeepRoute
+}
+
+export interface FileRouteTypes {
+ fileRoutesByFullPath: FileRoutesByFullPath
+ fullPaths:
+ | '/'
+ | ''
+ | '/deferred'
+ | '/posts'
+ | '/redirect'
+ | '/users'
+ | '/posts/$postId'
+ | '/users/$userId'
+ | '/posts/'
+ | '/users/'
+ | '/layout-a'
+ | '/layout-b'
+ | '/posts/$postId/deep'
+ fileRoutesByTo: FileRoutesByTo
+ to:
+ | '/'
+ | ''
+ | '/deferred'
+ | '/redirect'
+ | '/posts/$postId'
+ | '/users/$userId'
+ | '/posts'
+ | '/users'
+ | '/layout-a'
+ | '/layout-b'
+ | '/posts/$postId/deep'
+ id:
+ | '__root__'
+ | '/'
+ | '/_layout'
+ | '/deferred'
+ | '/posts'
+ | '/redirect'
+ | '/users'
+ | '/_layout/_layout-2'
+ | '/posts/$postId'
+ | '/users/$userId'
+ | '/posts/'
+ | '/users/'
+ | '/_layout/_layout-2/layout-a'
+ | '/_layout/_layout-2/layout-b'
+ | '/posts_/$postId/deep'
+ fileRoutesById: FileRoutesById
+}
+
+export interface RootRouteChildren {
+ IndexRoute: typeof IndexRoute
+ LayoutRoute: typeof LayoutRouteWithChildren
+ DeferredRoute: typeof DeferredRoute
+ PostsRoute: typeof PostsRouteWithChildren
+ RedirectRoute: typeof RedirectRoute
+ UsersRoute: typeof UsersRouteWithChildren
+ PostsPostIdDeepRoute: typeof PostsPostIdDeepRoute
+}
+
+const rootRouteChildren: RootRouteChildren = {
+ IndexRoute: IndexRoute,
+ LayoutRoute: LayoutRouteWithChildren,
+ DeferredRoute: DeferredRoute,
+ PostsRoute: PostsRouteWithChildren,
+ RedirectRoute: RedirectRoute,
+ UsersRoute: UsersRouteWithChildren,
+ PostsPostIdDeepRoute: PostsPostIdDeepRoute,
+}
+
+export const routeTree = rootRoute
+ ._addFileChildren(rootRouteChildren)
+ ._addFileTypes()
+
+/* ROUTE_MANIFEST_START
+{
+ "routes": {
+ "__root__": {
+ "filePath": "__root.tsx",
+ "children": [
+ "/",
+ "/_layout",
+ "/deferred",
+ "/posts",
+ "/redirect",
+ "/users",
+ "/posts_/$postId/deep"
+ ]
+ },
+ "/": {
+ "filePath": "index.tsx"
+ },
+ "/_layout": {
+ "filePath": "_layout.tsx",
+ "children": [
+ "/_layout/_layout-2"
+ ]
+ },
+ "/deferred": {
+ "filePath": "deferred.tsx"
+ },
+ "/posts": {
+ "filePath": "posts.tsx",
+ "children": [
+ "/posts/$postId",
+ "/posts/"
+ ]
+ },
+ "/redirect": {
+ "filePath": "redirect.tsx"
+ },
+ "/users": {
+ "filePath": "users.tsx",
+ "children": [
+ "/users/$userId",
+ "/users/"
+ ]
+ },
+ "/_layout/_layout-2": {
+ "filePath": "_layout/_layout-2.tsx",
+ "parent": "/_layout",
+ "children": [
+ "/_layout/_layout-2/layout-a",
+ "/_layout/_layout-2/layout-b"
+ ]
+ },
+ "/posts/$postId": {
+ "filePath": "posts.$postId.tsx",
+ "parent": "/posts"
+ },
+ "/users/$userId": {
+ "filePath": "users.$userId.tsx",
+ "parent": "/users"
+ },
+ "/posts/": {
+ "filePath": "posts.index.tsx",
+ "parent": "/posts"
+ },
+ "/users/": {
+ "filePath": "users.index.tsx",
+ "parent": "/users"
+ },
+ "/_layout/_layout-2/layout-a": {
+ "filePath": "_layout/_layout-2/layout-a.tsx",
+ "parent": "/_layout/_layout-2"
+ },
+ "/_layout/_layout-2/layout-b": {
+ "filePath": "_layout/_layout-2/layout-b.tsx",
+ "parent": "/_layout/_layout-2"
+ },
+ "/posts_/$postId/deep": {
+ "filePath": "posts_.$postId.deep.tsx"
+ }
+ }
+}
+ROUTE_MANIFEST_END */
diff --git a/examples/react/start-basic/app/router.tsx b/examples/react/start-basic/src/router.tsx
similarity index 100%
rename from examples/react/start-basic/app/router.tsx
rename to examples/react/start-basic/src/router.tsx
diff --git a/examples/react/start-basic/src/routes/__root.tsx b/examples/react/start-basic/src/routes/__root.tsx
new file mode 100644
index 0000000000..f6d8d8cf97
--- /dev/null
+++ b/examples/react/start-basic/src/routes/__root.tsx
@@ -0,0 +1,139 @@
+import {
+ HeadContent,
+ Link,
+ Outlet,
+ Scripts,
+ createRootRoute,
+} from '@tanstack/react-router'
+import { TanStackRouterDevtools } from '@tanstack/router-devtools'
+import * as React from 'react'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
+import { NotFound } from 'src/components/NotFound'
+import { seo } from 'src/utils/seo'
+import appCss from '~/styles/app.css?url'
+
+export const Route = createRootRoute({
+ head: () => ({
+ meta: [
+ {
+ charSet: 'utf-8',
+ },
+ {
+ name: 'viewport',
+ content: 'width=device-width, initial-scale=1',
+ },
+ ...seo({
+ title:
+ 'TanStack Start | Type-Safe, Client-First, Full-Stack React Framework',
+ description: `TanStack Start is a type-safe, client-first, full-stack React framework. `,
+ }),
+ ],
+ links: [
+ { rel: 'stylesheet', href: appCss },
+ {
+ rel: 'apple-touch-icon',
+ sizes: '180x180',
+ href: '/apple-touch-icon.png',
+ },
+ {
+ rel: 'icon',
+ type: 'image/png',
+ sizes: '32x32',
+ href: '/favicon-32x32.png',
+ },
+ {
+ rel: 'icon',
+ type: 'image/png',
+ sizes: '16x16',
+ href: '/favicon-16x16.png',
+ },
+ { rel: 'manifest', href: '/site.webmanifest', color: '#fffff' },
+ { rel: 'icon', href: '/favicon.ico' },
+ ],
+ }),
+ errorComponent: (props) => {
+ return (
+
+
+
+ )
+ },
+ notFoundComponent: () => ,
+ component: RootComponent,
+})
+
+function RootComponent() {
+ return (
+
+
+
+ )
+}
+
+function RootDocument({ children }: { children: React.ReactNode }) {
+ return (
+
+
+
+
+
+
+
+ Home
+ {' '}
+
+ Posts
+ {' '}
+
+ Users
+ {' '}
+
+ Layout
+ {' '}
+
+ Deferred
+ {' '}
+
+ This Route Does Not Exist
+
+
+
+ {children}
+
+
+
+
+ )
+}
diff --git a/examples/react/start-basic/src/routes/_layout.tsx b/examples/react/start-basic/src/routes/_layout.tsx
new file mode 100644
index 0000000000..02ddbb1cd9
--- /dev/null
+++ b/examples/react/start-basic/src/routes/_layout.tsx
@@ -0,0 +1,16 @@
+import { Outlet, createFileRoute } from '@tanstack/react-router'
+
+export const Route = createFileRoute('/_layout')({
+ component: LayoutComponent,
+})
+
+function LayoutComponent() {
+ return (
+
+ )
+}
diff --git a/examples/react/start-basic/src/routes/_layout/_layout-2.tsx b/examples/react/start-basic/src/routes/_layout/_layout-2.tsx
new file mode 100644
index 0000000000..3b7dbf2903
--- /dev/null
+++ b/examples/react/start-basic/src/routes/_layout/_layout-2.tsx
@@ -0,0 +1,34 @@
+import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
+
+export const Route = createFileRoute('/_layout/_layout-2')({
+ component: LayoutComponent,
+})
+
+function LayoutComponent() {
+ return (
+
+
I'm a nested layout
+
+
+ Layout A
+
+
+ Layout B
+
+
+
+
+
+
+ )
+}
diff --git a/examples/react/start-basic/src/routes/_layout/_layout-2/layout-a.tsx b/examples/react/start-basic/src/routes/_layout/_layout-2/layout-a.tsx
new file mode 100644
index 0000000000..61e19b4d9f
--- /dev/null
+++ b/examples/react/start-basic/src/routes/_layout/_layout-2/layout-a.tsx
@@ -0,0 +1,9 @@
+import { createFileRoute } from '@tanstack/react-router'
+
+export const Route = createFileRoute('/_layout/_layout-2/layout-a')({
+ component: LayoutAComponent,
+})
+
+function LayoutAComponent() {
+ return I'm layout A!
+}
diff --git a/examples/react/start-basic/src/routes/_layout/_layout-2/layout-b.tsx b/examples/react/start-basic/src/routes/_layout/_layout-2/layout-b.tsx
new file mode 100644
index 0000000000..cceed1fb9a
--- /dev/null
+++ b/examples/react/start-basic/src/routes/_layout/_layout-2/layout-b.tsx
@@ -0,0 +1,9 @@
+import { createFileRoute } from '@tanstack/react-router'
+
+export const Route = createFileRoute('/_layout/_layout-2/layout-b')({
+ component: LayoutBComponent,
+})
+
+function LayoutBComponent() {
+ return I'm layout B!
+}
diff --git a/examples/react/start-basic/app/routes/api/users.$id.ts b/examples/react/start-basic/src/routes/api/users.$id.ts
similarity index 100%
rename from examples/react/start-basic/app/routes/api/users.$id.ts
rename to examples/react/start-basic/src/routes/api/users.$id.ts
diff --git a/examples/react/start-basic/app/routes/api/users.ts b/examples/react/start-basic/src/routes/api/users.ts
similarity index 100%
rename from examples/react/start-basic/app/routes/api/users.ts
rename to examples/react/start-basic/src/routes/api/users.ts
diff --git a/examples/react/start-basic/app/routes/deferred.tsx b/examples/react/start-basic/src/routes/deferred.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/deferred.tsx
rename to examples/react/start-basic/src/routes/deferred.tsx
diff --git a/examples/react/start-basic/app/routes/index.tsx b/examples/react/start-basic/src/routes/index.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/index.tsx
rename to examples/react/start-basic/src/routes/index.tsx
diff --git a/examples/react/start-basic/app/routes/posts.$postId.tsx b/examples/react/start-basic/src/routes/posts.$postId.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/posts.$postId.tsx
rename to examples/react/start-basic/src/routes/posts.$postId.tsx
diff --git a/examples/react/start-basic/app/routes/posts.index.tsx b/examples/react/start-basic/src/routes/posts.index.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/posts.index.tsx
rename to examples/react/start-basic/src/routes/posts.index.tsx
diff --git a/examples/react/start-basic/src/routes/posts.tsx b/examples/react/start-basic/src/routes/posts.tsx
new file mode 100644
index 0000000000..ae49032459
--- /dev/null
+++ b/examples/react/start-basic/src/routes/posts.tsx
@@ -0,0 +1,38 @@
+import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
+import { fetchPosts } from '../utils/posts'
+
+export const Route = createFileRoute('/posts')({
+ loader: async () => fetchPosts(),
+ component: PostsComponent,
+})
+
+function PostsComponent() {
+ const posts = Route.useLoaderData()
+
+ return (
+
+ )
+}
diff --git a/examples/react/start-basic/app/routes/posts_.$postId.deep.tsx b/examples/react/start-basic/src/routes/posts_.$postId.deep.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/posts_.$postId.deep.tsx
rename to examples/react/start-basic/src/routes/posts_.$postId.deep.tsx
diff --git a/examples/react/start-basic/app/routes/redirect.tsx b/examples/react/start-basic/src/routes/redirect.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/redirect.tsx
rename to examples/react/start-basic/src/routes/redirect.tsx
diff --git a/examples/react/start-basic/app/routes/users.$userId.tsx b/examples/react/start-basic/src/routes/users.$userId.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/users.$userId.tsx
rename to examples/react/start-basic/src/routes/users.$userId.tsx
diff --git a/examples/react/start-basic/app/routes/users.index.tsx b/examples/react/start-basic/src/routes/users.index.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/users.index.tsx
rename to examples/react/start-basic/src/routes/users.index.tsx
diff --git a/examples/react/start-basic/src/routes/users.tsx b/examples/react/start-basic/src/routes/users.tsx
new file mode 100644
index 0000000000..1c51b659d9
--- /dev/null
+++ b/examples/react/start-basic/src/routes/users.tsx
@@ -0,0 +1,48 @@
+import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
+import axios from 'redaxios'
+import { DEPLOY_URL } from '../utils/users'
+import type { User } from '../utils/users'
+
+export const Route = createFileRoute('/users')({
+ loader: async () => {
+ return await axios
+ .get>(DEPLOY_URL + '/api/users')
+ .then((r) => r.data)
+ .catch(() => {
+ throw new Error('Failed to fetch users')
+ })
+ },
+ component: UsersComponent,
+})
+
+function UsersComponent() {
+ const users = Route.useLoaderData()
+
+ return (
+
+
+ {[
+ ...users,
+ { id: 'i-do-not-exist', name: 'Non-existent User', email: '' },
+ ].map((user) => {
+ return (
+
+
+ {user.name}
+
+
+ )
+ })}
+
+
+
+
+ )
+}
diff --git a/examples/react/start-basic/app/styles/app.css b/examples/react/start-basic/src/styles/app.css
similarity index 100%
rename from examples/react/start-basic/app/styles/app.css
rename to examples/react/start-basic/src/styles/app.css
diff --git a/examples/react/start-basic/app/utils/loggingMiddleware.tsx b/examples/react/start-basic/src/utils/loggingMiddleware.tsx
similarity index 100%
rename from examples/react/start-basic/app/utils/loggingMiddleware.tsx
rename to examples/react/start-basic/src/utils/loggingMiddleware.tsx
diff --git a/examples/react/start-basic/app/utils/posts.tsx b/examples/react/start-basic/src/utils/posts.tsx
similarity index 100%
rename from examples/react/start-basic/app/utils/posts.tsx
rename to examples/react/start-basic/src/utils/posts.tsx
diff --git a/examples/react/start-basic/app/utils/seo.ts b/examples/react/start-basic/src/utils/seo.ts
similarity index 100%
rename from examples/react/start-basic/app/utils/seo.ts
rename to examples/react/start-basic/src/utils/seo.ts
diff --git a/examples/react/start-basic/app/utils/users.tsx b/examples/react/start-basic/src/utils/users.tsx
similarity index 100%
rename from examples/react/start-basic/app/utils/users.tsx
rename to examples/react/start-basic/src/utils/users.tsx
diff --git a/examples/react/start-basic/tailwind.config.mjs b/examples/react/start-basic/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/examples/react/start-basic/tailwind.config.mjs
+++ b/examples/react/start-basic/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/examples/react/start-basic/tsconfig.json b/examples/react/start-basic/tsconfig.json
index d1b5b77660..9a7cf62c30 100644
--- a/examples/react/start-basic/tsconfig.json
+++ b/examples/react/start-basic/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/examples/react/start-clerk-basic/app/client.tsx b/examples/react/start-clerk-basic/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/examples/react/start-clerk-basic/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/clerk-basic/app/ssr.tsx b/examples/react/start-clerk-basic/app/server.ts
similarity index 100%
rename from e2e/react-start/clerk-basic/app/ssr.tsx
rename to examples/react/start-clerk-basic/app/server.ts
diff --git a/examples/react/start-clerk-basic/app/ssr.tsx b/examples/react/start-clerk-basic/app/ssr.tsx
deleted file mode 100644
index ef5ba0bc95..0000000000
--- a/examples/react/start-clerk-basic/app/ssr.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-import { createClerkHandler } from '@clerk/tanstack-start/server'
-import { createRouter } from './router'
-
-const handler = createStartHandler({
- createRouter,
- getRouterManifest,
-})
-
-const clerkHandler = createClerkHandler(handler)
-
-export default clerkHandler(defaultStreamHandler)
diff --git a/examples/react/start-clerk-basic/tailwind.config.mjs b/examples/react/start-clerk-basic/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/examples/react/start-clerk-basic/tailwind.config.mjs
+++ b/examples/react/start-clerk-basic/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/examples/react/start-convex-trellaux/app/client.tsx b/examples/react/start-convex-trellaux/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/examples/react/start-convex-trellaux/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/server-functions/app/ssr.tsx b/examples/react/start-convex-trellaux/app/server.ts
similarity index 100%
rename from e2e/react-start/server-functions/app/ssr.tsx
rename to examples/react/start-convex-trellaux/app/server.ts
diff --git a/examples/react/start-convex-trellaux/app/ssr.tsx b/examples/react/start-convex-trellaux/app/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/examples/react/start-convex-trellaux/app/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-convex-trellaux/tailwind.config.mjs b/examples/react/start-convex-trellaux/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/examples/react/start-convex-trellaux/tailwind.config.mjs
+++ b/examples/react/start-convex-trellaux/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/examples/react/start-counter/app/client.tsx b/examples/react/start-counter/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/examples/react/start-counter/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/website/app/ssr.tsx b/examples/react/start-counter/app/server.ts
similarity index 100%
rename from e2e/react-start/website/app/ssr.tsx
rename to examples/react/start-counter/app/server.ts
diff --git a/examples/react/start-counter/app/ssr.tsx b/examples/react/start-counter/app/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/examples/react/start-counter/app/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-large/app/client.tsx b/examples/react/start-large/app/client.tsx
deleted file mode 100644
index 6ef47afdd4..0000000000
--- a/examples/react/start-large/app/client.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-// app/client.tsx
-
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/examples/react/start-large/app/ssr.tsx b/examples/react/start-large/app/server.ts
similarity index 94%
rename from examples/react/start-large/app/ssr.tsx
rename to examples/react/start-large/app/server.ts
index b25c3c5648..cb5ab731aa 100644
--- a/examples/react/start-large/app/ssr.tsx
+++ b/examples/react/start-large/app/server.ts
@@ -1,4 +1,4 @@
-// app/ssr.tsx
+// src/server.tsx
import {
createStartHandler,
diff --git a/examples/react/start-large/tailwind.config.mjs b/examples/react/start-large/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/examples/react/start-large/tailwind.config.mjs
+++ b/examples/react/start-large/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/examples/react/start-supabase-basic/app/client.tsx b/examples/react/start-supabase-basic/app/client.tsx
deleted file mode 100644
index 6ef47afdd4..0000000000
--- a/examples/react/start-supabase-basic/app/client.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-// app/client.tsx
-
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/examples/react/start-supabase-basic/app/ssr.tsx b/examples/react/start-supabase-basic/app/server.ts
similarity index 94%
rename from examples/react/start-supabase-basic/app/ssr.tsx
rename to examples/react/start-supabase-basic/app/server.ts
index b25c3c5648..cb5ab731aa 100644
--- a/examples/react/start-supabase-basic/app/ssr.tsx
+++ b/examples/react/start-supabase-basic/app/server.ts
@@ -1,4 +1,4 @@
-// app/ssr.tsx
+// src/server.tsx
import {
createStartHandler,
diff --git a/examples/react/start-supabase-basic/tailwind.config.mjs b/examples/react/start-supabase-basic/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/examples/react/start-supabase-basic/tailwind.config.mjs
+++ b/examples/react/start-supabase-basic/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/examples/react/start-trellaux/app/client.tsx b/examples/react/start-trellaux/app/client.tsx
deleted file mode 100644
index c5fbaa3c67..0000000000
--- a/examples/react/start-trellaux/app/client.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/examples/react/start-bare/app/ssr.tsx b/examples/react/start-trellaux/app/server.ts
similarity index 100%
rename from examples/react/start-bare/app/ssr.tsx
rename to examples/react/start-trellaux/app/server.ts
diff --git a/examples/react/start-trellaux/app/ssr.tsx b/examples/react/start-trellaux/app/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/examples/react/start-trellaux/app/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-trellaux/tailwind.config.mjs b/examples/react/start-trellaux/tailwind.config.mjs
index 07c3598bac..e49f4eb776 100644
--- a/examples/react/start-trellaux/tailwind.config.mjs
+++ b/examples/react/start-trellaux/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
diff --git a/examples/react/with-trpc-react-query/tailwind.config.mjs b/examples/react/with-trpc-react-query/tailwind.config.mjs
index 1d2eca8aa7..4986094b9d 100644
--- a/examples/react/with-trpc-react-query/tailwind.config.mjs
+++ b/examples/react/with-trpc-react-query/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}', './index.html'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}', './index.html'],
}
diff --git a/examples/react/with-trpc/tailwind.config.mjs b/examples/react/with-trpc/tailwind.config.mjs
index 1d2eca8aa7..4986094b9d 100644
--- a/examples/react/with-trpc/tailwind.config.mjs
+++ b/examples/react/with-trpc/tailwind.config.mjs
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
- content: ['./app/**/*.{js,jsx,ts,tsx}', './index.html'],
+ content: ['./src/**/*.{js,jsx,ts,tsx}', './index.html'],
}
diff --git a/packages/create-start/src/modules/core/template/app/ssr.tsx b/packages/create-start/src/modules/core/template/app/ssr.tsx
deleted file mode 100644
index 017f4efa21..0000000000
--- a/packages/create-start/src/modules/core/template/app/ssr.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-// @ts-nocheck
-
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/packages/react-start-plugin/src/index.ts b/packages/react-start-plugin/src/index.ts
index a017bbff15..3ab92a4701 100644
--- a/packages/react-start-plugin/src/index.ts
+++ b/packages/react-start-plugin/src/index.ts
@@ -1,3 +1,4 @@
+import path from 'node:path'
import { TanStackServerFnPluginEnv } from '@tanstack/server-functions-plugin'
import { createNitro } from 'nitropack'
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
@@ -94,6 +95,49 @@ export function TanStackStartVitePlugin(
return config
},
+ resolveId(id) {
+ if (
+ [
+ '/~start/default-server-entry',
+ '/~start/default-client-entry',
+ ].includes(id)
+ ) {
+ return `${id}.tsx`
+ }
+
+ return null
+ },
+ load(id) {
+ const routerImportPath = JSON.stringify(
+ path.resolve(options.root, options.tsr.srcDirectory, 'router'),
+ )
+
+ if (id === '/~start/default-client-entry.tsx') {
+ return `
+import { hydrateRoot } from 'react-dom/client'
+import { StartClient } from '@tanstack/react-start'
+import { createRouter } from ${routerImportPath}
+
+const router = createRouter()
+
+hydrateRoot(document, )
+`
+ }
+
+ if (id === '/~start/default-server-entry.tsx') {
+ console.log('routerImportPath', routerImportPath)
+ return `
+import { createStartHandler, defaultStreamHandler } from '@tanstack/react-start/server'
+import { createRouter } from ${routerImportPath}
+
+export default createStartHandler({
+ createRouter,
+})(defaultStreamHandler)
+`
+ }
+
+ return null
+ },
},
TanStackStartCompilerPlugin(),
TanStackServerFnPluginEnv({
diff --git a/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts b/packages/react-start-plugin/src/nitro/dev-server-plugin.ts
similarity index 95%
rename from packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts
rename to packages/react-start-plugin/src/nitro/dev-server-plugin.ts
index 995a9b7a0a..9f6c156b45 100644
--- a/packages/react-start-plugin/src/nitro/plugins/dev-server-plugin.ts
+++ b/packages/react-start-plugin/src/nitro/dev-server-plugin.ts
@@ -4,7 +4,7 @@
import { createEvent, getHeader, sendWebResponse } from 'h3'
import { isRunnableDevEnvironment } from 'vite'
import type { Connect, Environment, Plugin, ViteDevServer } from 'vite'
-import type { TanStackStartOutputConfig } from '../../schema.js'
+import type { TanStackStartOutputConfig } from '../schema.js'
export function devServerPlugin(options: TanStackStartOutputConfig): Plugin {
// let config: UserConfig
@@ -19,7 +19,7 @@ export function devServerPlugin(options: TanStackStartOutputConfig): Plugin {
return {
resolve: {
alias: {
- '~start/ssr-entry': options.ssrEntryPath,
+ '/~start/ssr-entry': options.serverEntryPath,
},
},
}
@@ -44,7 +44,7 @@ export function devServerPlugin(options: TanStackStartOutputConfig): Plugin {
}
const serverEntry =
- await serverEnv.runner.import('~start/ssr-entry')
+ await serverEnv.runner.import('/~start/ssr-entry')
const response = await serverEntry['default'](event)
diff --git a/packages/react-start-plugin/src/nitro/nitro-plugin.ts b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
index 7b198e80e8..13af417ecb 100644
--- a/packages/react-start-plugin/src/nitro/nitro-plugin.ts
+++ b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
@@ -5,7 +5,7 @@ import { getRollupConfig } from 'nitropack/rollup'
import { createNitro } from 'nitropack'
import { buildSitemap } from './build-sitemap.js'
-import { devServerPlugin } from './plugins/dev-server-plugin.js'
+import { devServerPlugin } from './dev-server-plugin.js'
import type { NitroConfig } from 'nitropack'
import type { TanStackStartOutputConfig } from '../schema.js'
@@ -36,8 +36,8 @@ export function nitroPlugin(
preset: buildPreset,
compatibilityDate: '2024-11-19',
logLevel: options.server.logLevel || 0,
- srcDir: normalizePath(options.tsr.appDirectory),
- renderer: filePrefix + normalizePath(options.ssrEntryPath),
+ srcDir: normalizePath(options.tsr.srcDirectory),
+ // renderer: filePrefix + normalizePath(options.ssrEntryPath),
}
const nitro = await createNitro({
diff --git a/packages/react-start-plugin/src/schema.ts b/packages/react-start-plugin/src/schema.ts
index e0882a17d4..ac120b642d 100644
--- a/packages/react-start-plugin/src/schema.ts
+++ b/packages/react-start-plugin/src/schema.ts
@@ -35,7 +35,7 @@ const viteReactSchema = z.custom()
const routersSchema = z.object({
ssr: z
.object({
- entry: z.string().optional().default('ssr.tsx'),
+ entry: z.string().optional(),
// middleware: z.string().optional(),
vite: viteSchema.optional(),
})
@@ -43,7 +43,7 @@ const routersSchema = z.object({
.default({}),
client: z
.object({
- entry: z.string().optional().default('client.tsx'),
+ entry: z.string().optional(),
base: z.string().optional().default('/_build'),
vite: viteSchema.optional(),
})
@@ -61,15 +61,6 @@ const routersSchema = z.object({
})
.optional()
.default({}),
- api: z
- .object({
- base: z.string().optional().default('/api'),
- entry: z.string().optional().default('api.ts'),
- // middleware: z.string().optional(),
- vite: viteSchema.optional(),
- })
- .optional()
- .default({}),
public: z
.object({
dir: z.string().optional().default('public'),
@@ -84,8 +75,7 @@ const sitemapSchema = z.object({
})
const tsrConfig = configSchema.partial().extend({
- // Normally these are `./src/___`, but we're using `./app/___` for Start stuff
- appDirectory: z.string().optional().default('app'),
+ srcDirectory: z.string().optional().default('src'),
})
const TanStackStartOptionsSchema = z
@@ -104,20 +94,38 @@ const TanStackStartOptionsSchema = z
export function getTanStackStartOptions(opts?: TanStackStartInputConfig) {
const options = TanStackStartOptionsSchema.parse(opts)
- const appDirectory = options.tsr.appDirectory
+ const srcDirectory = options.tsr.srcDirectory
+
const routesDirectory =
- options.tsr.routesDirectory ?? path.join(appDirectory, 'routes')
+ options.tsr.routesDirectory ?? path.join(srcDirectory, 'routes')
+
const generatedRouteTree =
options.tsr.generatedRouteTree ??
- path.join(appDirectory, 'routeTree.gen.ts')
- const clientEntryPath = path.join(appDirectory, options.routers.client.entry)
- const ssrEntryPath = path.join(appDirectory, options.routers.ssr.entry)
- const apiEntryPath = path.join(appDirectory, options.routers.api.entry)
- const globalMiddlewareEntryPath = path.join(
- appDirectory,
- options.routers.server.globalMiddlewareEntry,
- )
- const hasApiEntry = existsSync(apiEntryPath)
+ path.join(srcDirectory, 'routeTree.gen.ts')
+
+ const clientEntryPath = (() => {
+ if (options.routers.client.entry) {
+ return path.join(srcDirectory, options.routers.client.entry)
+ }
+
+ if (existsSync(path.join(srcDirectory, 'client.tsx'))) {
+ return path.join(srcDirectory, 'client.tsx')
+ }
+
+ return '/~start/default-client-entry'
+ })()
+
+ const serverEntryPath = (() => {
+ if (options.routers.ssr.entry) {
+ return path.join(srcDirectory, options.routers.ssr.entry)
+ }
+
+ if (existsSync(path.join(srcDirectory, 'server.tsx'))) {
+ return path.join(srcDirectory, 'server.tsx')
+ }
+
+ return '/~start/default-server-entry'
+ })()
return {
...options,
@@ -130,10 +138,7 @@ export function getTanStackStartOptions(opts?: TanStackStartInputConfig) {
}),
},
clientEntryPath,
- ssrEntryPath,
- apiEntryPath,
- globalMiddlewareEntryPath,
- hasApiEntry,
+ serverEntryPath,
}
}
diff --git a/packages/react-start-server/src/createStartHandler.ts b/packages/react-start-server/src/createStartHandler.ts
index 90172fe71e..60c6a28638 100644
--- a/packages/react-start-server/src/createStartHandler.ts
+++ b/packages/react-start-server/src/createStartHandler.ts
@@ -35,12 +35,21 @@ export function createStartHandler<
)
}
+ // Handle server functions
if (
href.startsWith(path.join('/', process.env.TSS_SERVER_FN_BASE, '/'))
) {
return await serverFunctionsHandler(event)
}
+ // Handle API routes
+ // handleApiRoutes(event)
+ // if (event.handled) {
+ // return
+ // }
+
+ // If no API routes returned, then fallback to SSR on the router
+
// Create a history for the router
const history = createMemoryHistory({
initialEntries: [href],
diff --git a/packages/react-start-server/src/h3.ts b/packages/react-start-server/src/h3.ts
index b58ba1e10a..8e7dbc049c 100644
--- a/packages/react-start-server/src/h3.ts
+++ b/packages/react-start-server/src/h3.ts
@@ -13,6 +13,7 @@ import {
defaultContentType as _defaultContentType,
defineEventHandler as _defineEventHandler,
deleteCookie as _deleteCookie,
+ eventHandler as _eventHandler,
fetchWithEvent as _fetchWithEvent,
getCookie as _getCookie,
getHeader as _getHeader,
@@ -151,7 +152,6 @@ export {
defineResponseMiddleware,
dynamicEventHandler,
defineWebSocket,
- eventHandler,
splitCookiesString,
fromNodeMiddleware,
fromPlainHandler,
@@ -230,6 +230,12 @@ export function defineEventHandler(handler: EventHandler) {
})
}
+export function eventHandler(handler: EventHandler) {
+ return _eventHandler((event) => {
+ return runWithEvent(event, () => handler(event))
+ })
+}
+
export async function runWithEvent(
event: H3Event,
fn: () => T | Promise,
diff --git a/packages/react-start-server/src/router-manifest.ts b/packages/react-start-server/src/router-manifest.ts
index 03c4f3fb2a..44e851527d 100644
--- a/packages/react-start-server/src/router-manifest.ts
+++ b/packages/react-start-server/src/router-manifest.ts
@@ -61,7 +61,7 @@ export function getStartManifest() {
async: true,
},
children: `${script};\nimport(${JSON.stringify(
- path.join('/', process.env.TSS_CLIENT_ENTRY),
+ process.env.TSS_CLIENT_ENTRY,
)})`,
})
From 1c5acbbb782d716870d54f81764abb9b6a933416 Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Fri, 7 Mar 2025 23:17:55 -0700
Subject: [PATCH 026/155] rename app to src
---
.../{app => src}/components/Auth.tsx | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/Login.tsx | 2 +-
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/hooks/useMutation.ts | 0
.../basic-auth/{app => src}/routeTree.gen.ts | 0
.../basic-auth/{app => src}/router.tsx | 0
.../basic-auth/{app => src}/routes/__root.tsx | 8 +-
.../{app => src}/routes/_authed.tsx | 6 +-
.../src}/routes/_authed/posts.$postId.tsx | 4 +-
.../routes/_authed/posts.index.tsx | 0
.../{app => src}/routes/_authed/posts.tsx | 2 +-
.../basic-auth/{app => src}/routes/index.tsx | 0
.../basic-auth/{app => src}/routes/login.tsx | 2 +-
.../basic-auth/{app => src}/routes/logout.tsx | 2 +-
.../basic-auth/{app => src}/routes/signup.tsx | 8 +-
.../basic-auth/{app => src}/styles/app.css | 0
.../basic-auth/{app => src}/utils/posts.ts | 0
.../basic-auth/{app => src}/utils/prisma.ts | 0
.../basic-auth/{app => src}/utils/seo.ts | 0
.../basic-auth/{app => src}/utils/session.ts | 0
e2e/react-start/basic-auth/tsconfig.json | 2 +-
.../basic-react-query/{app => src}/api.ts | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/routeTree.gen.ts | 0
.../basic-react-query/{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 6 +-
.../{app => src}/routes/_layout.tsx | 0
.../{app => src}/routes/_layout/_layout-2.tsx | 0
.../routes/_layout/_layout-2/layout-a.tsx | 0
.../routes/_layout/_layout-2/layout-b.tsx | 0
.../{app => src}/routes/api.users.ts | 0
.../{app => src}/routes/api/users.$id.ts | 0
.../{app => src}/routes/deferred.tsx | 0
.../{app => src}/routes/index.tsx | 0
.../{app => src}/routes/posts.$postId.tsx | 4 +-
.../{app => src}/routes/posts.index.tsx | 0
.../{app => src}/routes/posts.tsx | 2 +-
.../routes/posts_.$postId.deep.tsx | 0
.../{app => src}/routes/redirect.tsx | 0
.../{app => src}/routes/users.$userId.tsx | 4 +-
.../{app => src}/routes/users.index.tsx | 0
.../{app => src}/routes/users.tsx | 2 +-
.../{app => src}/styles/app.css | 0
.../{app => src}/utils/posts.tsx | 0
.../{app => src}/utils/seo.ts | 0
.../{app => src}/utils/users.tsx | 0
.../basic-react-query/tsconfig.json | 2 +-
.../src/{app => }/routeTree.gen.ts | 0
.../basic-tsr-config/src/{app => }/router.tsx | 0
.../src/{app => }/routes/__root.tsx | 0
.../src/{app => }/routes/index.tsx | 0
e2e/react-start/basic/{app => src}/api.ts | 0
.../{app => src}/components/CustomMessage.tsx | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../components/RedirectOnClick.tsx | 0
.../{app => src}/components/throwRedirect.ts | 0
.../basic/{app => src}/routeTree.gen.ts | 0
e2e/react-start/basic/{app => src}/router.tsx | 0
.../basic/{app => src}/routes/__root.tsx | 6 +-
.../basic/{app => src}/routes/_layout.tsx | 0
.../{app => src}/routes/_layout/_layout-2.tsx | 0
.../routes/_layout/_layout-2/layout-a.tsx | 0
.../routes/_layout/_layout-2/layout-b.tsx | 0
.../basic/{app => src}/routes/api.users.ts | 0
.../{app => src}/routes/api/users.$id.ts | 0
.../basic/{app => src}/routes/deferred.tsx | 0
.../basic/{app => src}/routes/index.tsx | 2 +-
.../basic/{app => src}/routes/links.tsx | 0
.../{app => src}/routes/not-found/index.tsx | 0
.../{app => src}/routes/not-found/route.tsx | 0
.../routes/not-found/via-beforeLoad.tsx | 0
.../routes/not-found/via-loader.tsx | 0
.../{app => src}/routes/posts.$postId.tsx | 4 +-
.../basic/{app => src}/routes/posts.index.tsx | 0
.../basic/{app => src}/routes/posts.tsx | 2 +-
.../routes/posts_.$postId.deep.tsx | 0
.../{app => src}/routes/redirect/$target.tsx | 0
.../routes/redirect/$target/index.tsx | 0
.../redirect/$target/serverFn/index.tsx | 0
.../$target/serverFn/via-beforeLoad.tsx | 0
.../redirect/$target/serverFn/via-loader.tsx | 0
.../$target/serverFn/via-useServerFn.tsx | 0
.../redirect/$target/via-beforeLoad.tsx | 0
.../routes/redirect/$target/via-loader.tsx | 0
.../{app => src}/routes/redirect/index.tsx | 0
.../basic/{app => src}/routes/scripts.tsx | 0
.../{app => src}/routes/search-params.tsx | 0
.../basic/{app => src}/routes/stream.tsx | 0
.../{app => src}/routes/users.$userId.tsx | 6 +-
.../basic/{app => src}/routes/users.index.tsx | 0
.../basic/{app => src}/routes/users.tsx | 4 +-
.../basic/{app => src}/styles/app.css | 0
.../basic/{app => src}/utils/posts.tsx | 0
.../basic/{app => src}/utils/seo.ts | 0
.../basic/{app => src}/utils/users.tsx | 0
e2e/react-start/basic/tsconfig.json | 2 +-
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../clerk-basic/{app => src}/routeTree.gen.ts | 0
.../clerk-basic/{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 4 +-
.../{app => src}/routes/_authed.tsx | 0
.../src}/routes/_authed/posts.$postId.tsx | 4 +-
.../routes/_authed/posts.index.tsx | 0
.../{app => src}/routes/_authed/posts.tsx | 2 +-
.../{app => src}/routes/_authed/profile.$.tsx | 2 +-
.../clerk-basic/{app => src}/routes/index.tsx | 0
.../clerk-basic/{app => src}/server.tsx | 0
.../clerk-basic/{app => src}/styles/app.css | 0
.../clerk-basic/{app => src}/utils/posts.ts | 0
.../clerk-basic/{app => src}/utils/seo.ts | 0
e2e/react-start/clerk-basic/tsconfig.json | 2 +-
.../scroll-restoration/{app => src}/api.ts | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/routeTree.gen.ts | 0
.../{app => src}/router.tsx | 0
.../routes/(tests)/normal-page.tsx | 0
.../routes/(tests)/with-loader.tsx | 2 +-
.../routes/(tests)/with-search.tsx | 0
.../routes/-components/scroll-block.tsx | 0
.../{app => src}/routes/__root.tsx | 8 +-
.../{app => src}/routes/index.tsx | 0
.../{app => src}/styles/app.css | 0
.../{app => src}/utils/posts.tsx | 0
.../{app => src}/utils/seo.ts | 0
.../{app => src}/utils/users.tsx | 0
.../scroll-restoration/tsconfig.json | 2 +-
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/routeTree.gen.ts | 0
.../server-functions/{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 0
.../{app => src}/routes/abort-signal.tsx | 0
.../{app => src}/routes/consistent.tsx | 0
.../{app => src}/routes/cookies/index.tsx | 0
.../{app => src}/routes/cookies/set.tsx | 0
.../routes/dead-code-preserve.tsx | 0
.../{app => src}/routes/env-only.tsx | 0
.../{app => src}/routes/headers.tsx | 0
.../{app => src}/routes/index.tsx | 0
.../{app => src}/routes/isomorphic-fns.tsx | 0
.../{app => src}/routes/multipart.tsx | 0
.../{app => src}/routes/raw-response.tsx | 0
.../{app => src}/routes/return-null.tsx | 0
.../routes/serialize-form-data.tsx | 0
.../{app => src}/routes/status.tsx | 0
.../routes/submit-post-formdata.tsx | 0
.../{app => src}/styles/app.css | 0
.../basic-tsr-config/src}/client.tsx | 2 +-
.../src/{app => }/routeTree.gen.ts | 2 +-
.../basic-tsr-config/src/{app => }/router.tsx | 2 +-
.../src/{app => }/routes/__root.tsx | 0
.../src/{app => }/routes/index.tsx | 0
.../app => basic-tsr-config/src}/ssr.tsx | 2 +-
.../scroll-restoration/{app => src}/api.ts | 0
.../app => scroll-restoration/src}/client.tsx | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/routeTree.gen.ts | 0
.../{app => src}/router.tsx | 0
.../routes/(tests)/normal-page.tsx | 0
.../routes/(tests)/with-loader.tsx | 0
.../routes/(tests)/with-search.tsx | 0
.../routes/-components/scroll-block.tsx | 0
.../{app => src}/routes/__root.tsx | 6 +-
.../{app => src}/routes/index.tsx | 0
.../scroll-restoration/{app => src}/ssr.tsx | 0
.../{app => src}/styles/app.css | 0
.../{app => src}/utils/posts.tsx | 0
.../{app => src}/utils/seo.ts | 0
.../{app => src}/utils/users.tsx | 0
.../scroll-restoration/tsconfig.json | 2 +-
.../app => server-functions/src}/client.tsx | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/routeTree.gen.ts | 0
.../server-functions/{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 4 +-
.../{app => src}/routes/abort-signal.tsx | 0
.../{app => src}/routes/consistent.tsx | 0
.../{app => src}/routes/cookies/index.tsx | 0
.../{app => src}/routes/cookies/set.tsx | 0
.../routes/dead-code-preserve.tsx | 0
.../{app => src}/routes/env-only.tsx | 0
.../{app => src}/routes/headers.tsx | 0
.../{app => src}/routes/index.tsx | 0
.../{app => src}/routes/isomorphic-fns.tsx | 0
.../{app => src}/routes/multipart.tsx | 0
.../{app => src}/routes/raw-response.tsx | 0
.../{app => src}/routes/return-null.tsx | 0
.../routes/serialize-form-data.tsx | 0
.../{app => src}/routes/status.tsx | 0
.../routes/submit-post-formdata.tsx | 0
.../server-functions/{app => src}/ssr.tsx | 0
.../{app => src}/styles/app.css | 0
.../server-functions/tsconfig.json | 2 +-
.../app => website/src}/client.tsx | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../website/{app => src}/routeTree.gen.ts | 0
.../website/{app => src}/router.tsx | 0
...t.$version.docs.framework.$framework.$.tsx | 0
...n.docs.framework.$framework.examples.$.tsx | 0
...ersion.docs.framework.$framework.index.tsx | 0
...ect.$version.docs.framework.$framework.tsx | 0
.../routes/$project.$version.docs.index.tsx | 0
.../{app => src}/routes/$project.index.tsx | 0
.../website/{app => src}/routes/__root.tsx | 4 +-
.../_library.$project.$version.index.tsx | 0
.../{app => src}/routes/_library.$project.tsx | 4 +-
.../{app => src}/routes/_library.index.tsx | 0
.../website/{app => src}/routes/_library.tsx | 2 +-
.../website/{app => src}/server/document.tsx | 0
.../website/{app => src}/server/projects.tsx | 0
.../src/app => website/src}/ssr.tsx | 0
.../website/{app => src}/styles/app.css | 0
.../website/{app => src}/utils/seo.ts | 0
e2e/solid-start/website/tsconfig.json | 2 +-
examples/react/start-bare/{app => src}/api.ts | 0
.../{app => src}/components/Counter.css | 0
.../{app => src}/components/Counter.tsx | 0
.../start-bare/{app => src}/routeTree.gen.ts | 0
.../react/start-bare/{app => src}/router.tsx | 0
.../start-bare/{app => src}/routes/__root.tsx | 0
.../start-bare/{app => src}/routes/about.tsx | 0
.../start-bare/{app => src}/routes/index.tsx | 2 +-
.../start-bare/{app => src}/styles/app.css | 0
examples/react/start-bare/tsconfig.json | 2 +-
.../{app => src}/components/Auth.tsx | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/Login.tsx | 2 +-
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/hooks/useMutation.ts | 0
.../{app => src}/routeTree.gen.ts | 0
.../start-basic-auth/{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 8 +-
.../{app => src}/routes/_authed.tsx | 6 +-
.../src}/routes/_authed/posts.$postId.tsx | 4 +-
.../routes/_authed/posts.index.tsx | 0
.../routes/_authed/posts.route.tsx | 2 +-
.../{app => src}/routes/index.tsx | 0
.../{app => src}/routes/login.tsx | 2 +-
.../{app => src}/routes/logout.tsx | 2 +-
.../{app => src}/routes/signup.tsx | 8 +-
.../app => start-basic-auth/src}/server.ts | 0
.../{app => src}/styles/app.css | 0
.../{app => src}/utils/posts.ts | 0
.../{app => src}/utils/prisma.ts | 0
.../{app => src}/utils/seo.ts | 0
.../{app => src}/utils/session.ts | 0
examples/react/start-basic-auth/tsconfig.json | 2 +-
.../{app => src}/api.ts | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/routeTree.gen.ts | 0
.../{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 0
.../{app => src}/routes/_pathlessLayout.tsx | 0
.../routes/_pathlessLayout/_nested-layout.tsx | 0
.../_nested-layout/route-a.tsx | 0
.../_nested-layout/route-b.tsx | 0
.../{app => src}/routes/api.users.ts | 0
.../{app => src}/routes/api/users.$id.ts | 0
.../{app => src}/routes/deferred.tsx | 0
.../{app => src}/routes/index.tsx | 0
.../{app => src}/routes/posts.$postId.tsx | 0
.../{app => src}/routes/posts.index.tsx | 0
.../{app => src}/routes/posts.route.tsx | 0
.../routes/posts_.$postId.deep.tsx | 0
.../{app => src}/routes/redirect.tsx | 0
.../{app => src}/routes/users.$userId.tsx | 0
.../{app => src}/routes/users.index.tsx | 0
.../{app => src}/routes/users.route.tsx | 0
.../src}/server.ts | 0
.../{app => src}/styles/app.css | 0
.../{app => src}/utils/posts.tsx | 0
.../{app => src}/utils/seo.ts | 0
.../{app => src}/utils/users.tsx | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/routeTree.gen.ts | 0
.../start-basic-rsc/{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 6 +-
.../{app => src}/routes/_pathlessLayout.tsx | 0
.../routes/_pathlessLayout/_nested-layout.tsx | 0
.../_nested-layout/route-a.tsx | 0
.../_nested-layout/route-b.tsx | 0
.../{app => src}/routes/index.tsx | 0
.../{app => src}/routes/posts.$postId.tsx | 2 +-
.../{app => src}/routes/posts.index.tsx | 0
.../{app => src}/routes/posts.tsx | 2 +-
.../routes/posts_.$postId.deep.tsx | 0
.../app => start-basic-rsc/src}/server.ts | 0
.../{app => src}/styles/app.css | 0
.../{app => src}/utils/posts.tsx | 0
.../{app => src}/utils/renderPosts.tsx | 0
.../start-basic-rsc/{app => src}/utils/seo.ts | 0
examples/react/start-basic-rsc/tsconfig.json | 2 +-
.../start-basic-static/app/routes/__root.tsx | 139 -----
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/routeTree.gen.ts | 0
.../{app => src}/router.tsx | 0
.../src}/routes/__root.tsx | 6 +-
.../{app => src}/routes/_pathlessLayout.tsx | 0
.../routes/_pathlessLayout/_nested-layout.tsx | 0
.../_nested-layout/route-a.tsx | 0
.../_nested-layout/route-b.tsx | 0
.../{app => src}/routes/deferred.tsx | 0
.../{app => src}/routes/index.tsx | 0
.../{app => src}/routes/posts.$postId.tsx | 2 +-
.../{app => src}/routes/posts.index.tsx | 0
.../{app => src}/routes/posts.tsx | 0
.../routes/posts_.$postId.deep.tsx | 0
.../{app => src}/routes/redirect.tsx | 0
.../{app => src}/routes/users.$userId.tsx | 4 +-
.../{app => src}/routes/users.index.tsx | 0
.../{app => src}/routes/users.tsx | 0
.../app => start-basic-static/src}/server.ts | 0
.../{app => src}/styles/app.css | 0
.../{app => src}/utils/loggingMiddleware.tsx | 0
.../{app => src}/utils/posts.tsx | 0
.../{app => src}/utils/seo.ts | 0
.../{app => src}/utils/users.tsx | 0
.../react/start-basic-static/tsconfig.json | 2 +-
.../react/start-basic/app/routeTree.gen.ts | 479 ------------------
.../react/start-basic/src/routeTree.gen.ts | 270 ++++++----
.../react/start-basic/src/routes/__root.tsx | 10 +-
.../src/routes/_layout/_layout-2.tsx | 34 --
.../src/routes/_layout/_layout-2/layout-a.tsx | 9 -
.../src/routes/_layout/_layout-2/layout-b.tsx | 9 -
.../{app => src}/routes/_pathlessLayout.tsx | 0
.../routes/_pathlessLayout/_nested-layout.tsx | 0
.../_nested-layout/route-a.tsx | 0
.../_nested-layout/route-b.tsx | 0
.../{app => src}/routes/posts.route.tsx | 0
.../{app => src}/routes/users.route.tsx | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/routeTree.gen.ts | 0
.../start-clerk-basic/{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 4 +-
.../{app => src}/routes/_authed.tsx | 0
.../src}/routes/_authed/posts.$postId.tsx | 4 +-
.../routes/_authed/posts.index.tsx | 0
.../{app => src}/routes/_authed/posts.tsx | 2 +-
.../{app => src}/routes/_authed/profile.$.tsx | 2 +-
.../{app => src}/routes/index.tsx | 0
.../start-clerk-basic/{app => src}/server.ts | 0
.../{app => src}/styles/app.css | 0
.../{app => src}/utils/posts.ts | 0
.../{app => src}/utils/seo.ts | 0
.../react/start-clerk-basic/tsconfig.json | 2 +-
.../{app => src}/components/Board.tsx | 0
.../{app => src}/components/CancelButton.tsx | 0
.../{app => src}/components/Card.tsx | 0
.../{app => src}/components/Column.tsx | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/EditableText.tsx | 0
.../{app => src}/components/IconLink.tsx | 0
.../{app => src}/components/Loader.tsx | 0
.../{app => src}/components/NewCard.tsx | 0
.../{app => src}/components/NewColumn.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/components/SaveButton.tsx | 0
.../{app => src}/db/schema.ts | 0
.../hooks/useOfflineIndicator.tsx | 0
.../{app => src}/icons/icons.svg | 0
.../{app => src}/icons/icons.tsx | 0
.../{app => src}/queries.ts | 0
.../{app => src}/routeTree.gen.ts | 0
.../{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 0
.../{app => src}/routes/boards.$boardId.tsx | 0
.../{app => src}/routes/index.tsx | 0
.../src}/server.ts | 0
.../{app => src}/styles/app.css | 0
.../{app => src}/types.ts | 0
.../{app => src}/utils/posts.tsx | 0
.../{app => src}/utils/seo.ts | 0
.../{app => src}/routeTree.gen.ts | 0
.../start-counter/{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 0
.../{app => src}/routes/index.tsx | 0
.../app => start-counter/src}/server.ts | 0
.../start-large/{app => src}/createRoutes.mjs | 0
.../start-large/{app => src}/routeTree.gen.ts | 0
.../react/start-large/{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 0
.../{app => src}/routes/absolute.tsx | 0
.../start-large/{app => src}/routes/index.tsx | 0
.../{app => src}/routes/linkProps.tsx | 2 +-
.../routes/params/$paramsPlaceholder.tsx | 0
.../{app => src}/routes/params/route.tsx | 0
.../{app => src}/routes/relative.tsx | 0
.../{app => src}/routes/search/route.tsx | 0
.../routes/search/searchPlaceholder.tsx | 0
.../react/start-large/{app => src}/server.ts | 0
.../react/start-large/{app => src}/styles.css | 0
.../{app => src}/typePrimitives.tsx | 0
examples/react/start-large/tsconfig.json | 2 +-
.../start-material-ui/{app => src}/client.tsx | 0
.../{app => src}/components/Counter.tsx | 2 +-
.../components/CustomButtonLink.tsx | 0
.../{app => src}/components/CustomLink.tsx | 0
.../{app => src}/components/Header.tsx | 0
.../{app => src}/routeTree.gen.ts | 0
.../start-material-ui/{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 4 +-
.../{app => src}/routes/about.tsx | 0
.../{app => src}/routes/index.tsx | 2 +-
.../{app => src}/setup/theme.ts | 0
.../start-material-ui/{app => src}/ssr.tsx | 0
.../react/start-material-ui/tsconfig.json | 2 +-
.../{app => src}/components/Auth.tsx | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/Login.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/hooks/useMutation.ts | 0
.../{app => src}/routeTree.gen.ts | 0
.../{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 0
.../{app => src}/routes/_authed.tsx | 0
.../routes/_authed/posts.$postId.tsx | 4 +-
.../routes/_authed/posts.index.tsx | 0
.../{app => src}/routes/_authed/posts.tsx | 0
.../{app => src}/routes/index.tsx | 0
.../{app => src}/routes/login.tsx | 0
.../{app => src}/routes/logout.tsx | 0
.../{app => src}/routes/signup.tsx | 0
.../{app => src}/server.ts | 0
.../{app => src}/styles/app.css | 0
.../{app => src}/utils/posts.ts | 0
.../{app => src}/utils/seo.ts | 0
.../{app => src}/utils/supabase.ts | 0
.../react/start-supabase-basic/tsconfig.json | 2 +-
examples/react/start-trellaux/app/server.ts | 12 -
.../{app => src}/assets/react.svg | 0
.../{app => src}/components/Board.tsx | 0
.../{app => src}/components/CancelButton.tsx | 0
.../{app => src}/components/Card.tsx | 0
.../{app => src}/components/Column.tsx | 0
.../components/DefaultCatchBoundary.tsx | 0
.../{app => src}/components/EditableText.tsx | 0
.../{app => src}/components/IconLink.tsx | 0
.../{app => src}/components/Loader.tsx | 0
.../{app => src}/components/NewCard.tsx | 0
.../{app => src}/components/NewColumn.tsx | 0
.../{app => src}/components/NotFound.tsx | 0
.../{app => src}/components/SaveButton.tsx | 0
.../start-trellaux/{app => src}/db/board.ts | 0
.../start-trellaux/{app => src}/db/schema.ts | 0
.../hooks/useOfflineIndicator.tsx | 0
.../{app => src}/icons/icons.svg | 0
.../{app => src}/icons/icons.tsx | 0
.../start-trellaux/{app => src}/queries.ts | 0
.../{app => src}/routeTree.gen.ts | 0
.../start-trellaux/{app => src}/router.tsx | 0
.../{app => src}/routes/__root.tsx | 0
.../{app => src}/routes/boards.$boardId.tsx | 0
.../{app => src}/routes/index.tsx | 0
.../app => start-trellaux/src}/server.ts | 0
.../{app => src}/styles/app.css | 0
.../start-trellaux/{app => src}/types.ts | 0
.../{app => src}/utils/posts.tsx | 0
.../start-trellaux/{app => src}/utils/seo.ts | 0
.../{app => src}/main.tsx | 0
.../{app => src}/routeTree.gen.ts | 0
.../{app => src}/router.tsx | 0
.../routes/-components/spinner.tsx | 0
.../{app => src}/routes/__root.tsx | 0
.../{app => src}/routes/dashboard.index.tsx | 0
.../routes/dashboard.posts.$postId.tsx | 0
.../routes/dashboard.posts.index.tsx | 0
.../{app => src}/routes/dashboard.posts.tsx | 0
.../{app => src}/routes/dashboard.tsx | 0
.../{app => src}/routes/index.tsx | 0
.../{app => src}/styles.css | 0
.../react/with-trpc/{app => src}/main.tsx | 0
.../with-trpc/{app => src}/routeTree.gen.ts | 0
.../routes/-components/spinner.tsx | 0
.../with-trpc/{app => src}/routes/__root.tsx | 0
.../{app => src}/routes/dashboard.index.tsx | 0
.../routes/dashboard.posts.$postId.tsx | 0
.../routes/dashboard.posts.index.tsx | 0
.../{app => src}/routes/dashboard.posts.tsx | 0
.../{app => src}/routes/dashboard.tsx | 0
.../with-trpc/{app => src}/routes/index.tsx | 0
.../react/with-trpc/{app => src}/styles.css | 0
examples/react/with-trpc/{app => src}/trpc.ts | 0
.../solid/start-bare/src}/client.tsx | 0
.../{app => src}/components/Counter.css | 0
.../{app => src}/components/Counter.tsx | 0
.../start-bare/{app => src}/routeTree.gen.ts | 0
.../solid/start-bare/{app => src}/router.tsx | 0
.../start-bare/{app => src}/routes/__root.tsx | 0
.../start-bare/{app => src}/routes/about.tsx | 0
.../start-bare/{app => src}/routes/index.tsx | 2 +-
.../solid/start-bare/{app => src}/ssr.tsx | 0
.../start-bare/{app => src}/styles/app.css | 0
examples/solid/start-bare/tsconfig.json | 2 +-
.../core/template/{app => src}/client.tsx | 0
.../core/template/{app => src}/router.tsx | 0
.../template/{app => src}/routes/__root.tsx | 0
508 files changed, 296 insertions(+), 912 deletions(-)
rename e2e/react-start/basic-auth/{app => src}/components/Auth.tsx (100%)
rename e2e/react-start/basic-auth/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename e2e/react-start/basic-auth/{app => src}/components/Login.tsx (97%)
rename e2e/react-start/basic-auth/{app => src}/components/NotFound.tsx (100%)
rename e2e/react-start/basic-auth/{app => src}/hooks/useMutation.ts (100%)
rename e2e/react-start/basic-auth/{app => src}/routeTree.gen.ts (100%)
rename e2e/react-start/basic-auth/{app => src}/router.tsx (100%)
rename e2e/react-start/basic-auth/{app => src}/routes/__root.tsx (93%)
rename e2e/react-start/basic-auth/{app => src}/routes/_authed.tsx (89%)
rename e2e/react-start/{clerk-basic/app => basic-auth/src}/routes/_authed/posts.$postId.tsx (88%)
rename e2e/react-start/basic-auth/{app => src}/routes/_authed/posts.index.tsx (100%)
rename e2e/react-start/basic-auth/{app => src}/routes/_authed/posts.tsx (95%)
rename e2e/react-start/basic-auth/{app => src}/routes/index.tsx (100%)
rename e2e/react-start/basic-auth/{app => src}/routes/login.tsx (80%)
rename e2e/react-start/basic-auth/{app => src}/routes/logout.tsx (88%)
rename e2e/react-start/basic-auth/{app => src}/routes/signup.tsx (91%)
rename e2e/react-start/basic-auth/{app => src}/styles/app.css (100%)
rename e2e/react-start/basic-auth/{app => src}/utils/posts.ts (100%)
rename e2e/react-start/basic-auth/{app => src}/utils/prisma.ts (100%)
rename e2e/react-start/basic-auth/{app => src}/utils/seo.ts (100%)
rename e2e/react-start/basic-auth/{app => src}/utils/session.ts (100%)
rename e2e/react-start/basic-react-query/{app => src}/api.ts (100%)
rename e2e/react-start/basic-react-query/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/components/NotFound.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routeTree.gen.ts (100%)
rename e2e/react-start/basic-react-query/{app => src}/router.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/__root.tsx (95%)
rename e2e/react-start/basic-react-query/{app => src}/routes/_layout.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/_layout/_layout-2.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/_layout/_layout-2/layout-a.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/_layout/_layout-2/layout-b.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/api.users.ts (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/api/users.$id.ts (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/deferred.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/index.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/posts.$postId.tsx (93%)
rename e2e/react-start/basic-react-query/{app => src}/routes/posts.index.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/posts.tsx (95%)
rename e2e/react-start/basic-react-query/{app => src}/routes/posts_.$postId.deep.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/redirect.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/users.$userId.tsx (90%)
rename e2e/react-start/basic-react-query/{app => src}/routes/users.index.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/routes/users.tsx (95%)
rename e2e/react-start/basic-react-query/{app => src}/styles/app.css (100%)
rename e2e/react-start/basic-react-query/{app => src}/utils/posts.tsx (100%)
rename e2e/react-start/basic-react-query/{app => src}/utils/seo.ts (100%)
rename e2e/react-start/basic-react-query/{app => src}/utils/users.tsx (100%)
rename e2e/react-start/basic-tsr-config/src/{app => }/routeTree.gen.ts (100%)
rename e2e/react-start/basic-tsr-config/src/{app => }/router.tsx (100%)
rename e2e/react-start/basic-tsr-config/src/{app => }/routes/__root.tsx (100%)
rename e2e/react-start/basic-tsr-config/src/{app => }/routes/index.tsx (100%)
rename e2e/react-start/basic/{app => src}/api.ts (100%)
rename e2e/react-start/basic/{app => src}/components/CustomMessage.tsx (100%)
rename e2e/react-start/basic/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename e2e/react-start/basic/{app => src}/components/NotFound.tsx (100%)
rename e2e/react-start/basic/{app => src}/components/RedirectOnClick.tsx (100%)
rename e2e/react-start/basic/{app => src}/components/throwRedirect.ts (100%)
rename e2e/react-start/basic/{app => src}/routeTree.gen.ts (100%)
rename e2e/react-start/basic/{app => src}/router.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/__root.tsx (95%)
rename e2e/react-start/basic/{app => src}/routes/_layout.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/_layout/_layout-2.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/_layout/_layout-2/layout-a.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/_layout/_layout-2/layout-b.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/api.users.ts (100%)
rename e2e/react-start/basic/{app => src}/routes/api/users.$id.ts (100%)
rename e2e/react-start/basic/{app => src}/routes/deferred.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/index.tsx (82%)
rename e2e/react-start/basic/{app => src}/routes/links.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/not-found/index.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/not-found/route.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/not-found/via-beforeLoad.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/not-found/via-loader.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/posts.$postId.tsx (91%)
rename e2e/react-start/basic/{app => src}/routes/posts.index.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/posts.tsx (96%)
rename e2e/react-start/basic/{app => src}/routes/posts_.$postId.deep.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/redirect/$target.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/redirect/$target/index.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/redirect/$target/serverFn/index.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/redirect/$target/serverFn/via-beforeLoad.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/redirect/$target/serverFn/via-loader.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/redirect/$target/serverFn/via-useServerFn.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/redirect/$target/via-beforeLoad.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/redirect/$target/via-loader.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/redirect/index.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/scripts.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/search-params.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/stream.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/users.$userId.tsx (87%)
rename e2e/react-start/basic/{app => src}/routes/users.index.tsx (100%)
rename e2e/react-start/basic/{app => src}/routes/users.tsx (93%)
rename e2e/react-start/basic/{app => src}/styles/app.css (100%)
rename e2e/react-start/basic/{app => src}/utils/posts.tsx (100%)
rename e2e/react-start/basic/{app => src}/utils/seo.ts (100%)
rename e2e/react-start/basic/{app => src}/utils/users.tsx (100%)
rename e2e/react-start/clerk-basic/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename e2e/react-start/clerk-basic/{app => src}/components/NotFound.tsx (100%)
rename e2e/react-start/clerk-basic/{app => src}/routeTree.gen.ts (100%)
rename e2e/react-start/clerk-basic/{app => src}/router.tsx (100%)
rename e2e/react-start/clerk-basic/{app => src}/routes/__root.tsx (95%)
rename e2e/react-start/clerk-basic/{app => src}/routes/_authed.tsx (100%)
rename e2e/react-start/{basic-auth/app => clerk-basic/src}/routes/_authed/posts.$postId.tsx (88%)
rename e2e/react-start/clerk-basic/{app => src}/routes/_authed/posts.index.tsx (100%)
rename e2e/react-start/clerk-basic/{app => src}/routes/_authed/posts.tsx (95%)
rename e2e/react-start/clerk-basic/{app => src}/routes/_authed/profile.$.tsx (95%)
rename e2e/react-start/clerk-basic/{app => src}/routes/index.tsx (100%)
rename e2e/react-start/clerk-basic/{app => src}/server.tsx (100%)
rename e2e/react-start/clerk-basic/{app => src}/styles/app.css (100%)
rename e2e/react-start/clerk-basic/{app => src}/utils/posts.ts (100%)
rename e2e/react-start/clerk-basic/{app => src}/utils/seo.ts (100%)
rename e2e/react-start/scroll-restoration/{app => src}/api.ts (100%)
rename e2e/react-start/scroll-restoration/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename e2e/react-start/scroll-restoration/{app => src}/components/NotFound.tsx (100%)
rename e2e/react-start/scroll-restoration/{app => src}/routeTree.gen.ts (100%)
rename e2e/react-start/scroll-restoration/{app => src}/router.tsx (100%)
rename e2e/react-start/scroll-restoration/{app => src}/routes/(tests)/normal-page.tsx (100%)
rename e2e/react-start/scroll-restoration/{app => src}/routes/(tests)/with-loader.tsx (91%)
rename e2e/react-start/scroll-restoration/{app => src}/routes/(tests)/with-search.tsx (100%)
rename e2e/react-start/scroll-restoration/{app => src}/routes/-components/scroll-block.tsx (100%)
rename e2e/react-start/scroll-restoration/{app => src}/routes/__root.tsx (90%)
rename e2e/react-start/scroll-restoration/{app => src}/routes/index.tsx (100%)
rename e2e/react-start/scroll-restoration/{app => src}/styles/app.css (100%)
rename e2e/react-start/scroll-restoration/{app => src}/utils/posts.tsx (100%)
rename e2e/react-start/scroll-restoration/{app => src}/utils/seo.ts (100%)
rename e2e/react-start/scroll-restoration/{app => src}/utils/users.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/components/NotFound.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routeTree.gen.ts (100%)
rename e2e/react-start/server-functions/{app => src}/router.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/__root.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/abort-signal.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/consistent.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/cookies/index.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/cookies/set.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/dead-code-preserve.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/env-only.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/headers.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/index.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/isomorphic-fns.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/multipart.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/raw-response.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/return-null.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/serialize-form-data.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/status.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/routes/submit-post-formdata.tsx (100%)
rename e2e/react-start/server-functions/{app => src}/styles/app.css (100%)
rename {examples/solid/start-bare/app => e2e/solid-start/basic-tsr-config/src}/client.tsx (83%)
rename e2e/solid-start/basic-tsr-config/src/{app => }/routeTree.gen.ts (96%)
rename e2e/solid-start/basic-tsr-config/src/{app => }/router.tsx (87%)
rename e2e/solid-start/basic-tsr-config/src/{app => }/routes/__root.tsx (100%)
rename e2e/solid-start/basic-tsr-config/src/{app => }/routes/index.tsx (100%)
rename e2e/solid-start/{website/app => basic-tsr-config/src}/ssr.tsx (87%)
rename e2e/solid-start/scroll-restoration/{app => src}/api.ts (100%)
rename e2e/solid-start/{basic-tsr-config/src/app => scroll-restoration/src}/client.tsx (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/components/NotFound.tsx (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/routeTree.gen.ts (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/router.tsx (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/routes/(tests)/normal-page.tsx (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/routes/(tests)/with-loader.tsx (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/routes/(tests)/with-search.tsx (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/routes/-components/scroll-block.tsx (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/routes/__root.tsx (93%)
rename e2e/solid-start/scroll-restoration/{app => src}/routes/index.tsx (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/ssr.tsx (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/styles/app.css (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/utils/posts.tsx (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/utils/seo.ts (100%)
rename e2e/solid-start/scroll-restoration/{app => src}/utils/users.tsx (100%)
rename e2e/solid-start/{scroll-restoration/app => server-functions/src}/client.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/components/NotFound.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routeTree.gen.ts (100%)
rename e2e/solid-start/server-functions/{app => src}/router.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/__root.tsx (85%)
rename e2e/solid-start/server-functions/{app => src}/routes/abort-signal.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/consistent.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/cookies/index.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/cookies/set.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/dead-code-preserve.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/env-only.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/headers.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/index.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/isomorphic-fns.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/multipart.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/raw-response.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/return-null.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/serialize-form-data.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/status.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/routes/submit-post-formdata.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/ssr.tsx (100%)
rename e2e/solid-start/server-functions/{app => src}/styles/app.css (100%)
rename e2e/solid-start/{server-functions/app => website/src}/client.tsx (100%)
rename e2e/solid-start/website/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename e2e/solid-start/website/{app => src}/components/NotFound.tsx (100%)
rename e2e/solid-start/website/{app => src}/routeTree.gen.ts (100%)
rename e2e/solid-start/website/{app => src}/router.tsx (100%)
rename e2e/solid-start/website/{app => src}/routes/$project.$version.docs.framework.$framework.$.tsx (100%)
rename e2e/solid-start/website/{app => src}/routes/$project.$version.docs.framework.$framework.examples.$.tsx (100%)
rename e2e/solid-start/website/{app => src}/routes/$project.$version.docs.framework.$framework.index.tsx (100%)
rename e2e/solid-start/website/{app => src}/routes/$project.$version.docs.framework.$framework.tsx (100%)
rename e2e/solid-start/website/{app => src}/routes/$project.$version.docs.index.tsx (100%)
rename e2e/solid-start/website/{app => src}/routes/$project.index.tsx (100%)
rename e2e/solid-start/website/{app => src}/routes/__root.tsx (93%)
rename e2e/solid-start/website/{app => src}/routes/_library.$project.$version.index.tsx (100%)
rename e2e/solid-start/website/{app => src}/routes/_library.$project.tsx (81%)
rename e2e/solid-start/website/{app => src}/routes/_library.index.tsx (100%)
rename e2e/solid-start/website/{app => src}/routes/_library.tsx (96%)
rename e2e/solid-start/website/{app => src}/server/document.tsx (100%)
rename e2e/solid-start/website/{app => src}/server/projects.tsx (100%)
rename e2e/solid-start/{basic-tsr-config/src/app => website/src}/ssr.tsx (100%)
rename e2e/solid-start/website/{app => src}/styles/app.css (100%)
rename e2e/solid-start/website/{app => src}/utils/seo.ts (100%)
rename examples/react/start-bare/{app => src}/api.ts (100%)
rename examples/react/start-bare/{app => src}/components/Counter.css (100%)
rename examples/react/start-bare/{app => src}/components/Counter.tsx (100%)
rename examples/react/start-bare/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-bare/{app => src}/router.tsx (100%)
rename examples/react/start-bare/{app => src}/routes/__root.tsx (100%)
rename examples/react/start-bare/{app => src}/routes/about.tsx (100%)
rename examples/react/start-bare/{app => src}/routes/index.tsx (86%)
rename examples/react/start-bare/{app => src}/styles/app.css (100%)
rename examples/react/start-basic-auth/{app => src}/components/Auth.tsx (100%)
rename examples/react/start-basic-auth/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename examples/react/start-basic-auth/{app => src}/components/Login.tsx (97%)
rename examples/react/start-basic-auth/{app => src}/components/NotFound.tsx (100%)
rename examples/react/start-basic-auth/{app => src}/hooks/useMutation.ts (100%)
rename examples/react/start-basic-auth/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-basic-auth/{app => src}/router.tsx (100%)
rename examples/react/start-basic-auth/{app => src}/routes/__root.tsx (93%)
rename examples/react/start-basic-auth/{app => src}/routes/_authed.tsx (88%)
rename examples/react/{start-clerk-basic/app => start-basic-auth/src}/routes/_authed/posts.$postId.tsx (88%)
rename examples/react/start-basic-auth/{app => src}/routes/_authed/posts.index.tsx (100%)
rename examples/react/start-basic-auth/{app => src}/routes/_authed/posts.route.tsx (95%)
rename examples/react/start-basic-auth/{app => src}/routes/index.tsx (100%)
rename examples/react/start-basic-auth/{app => src}/routes/login.tsx (79%)
rename examples/react/start-basic-auth/{app => src}/routes/logout.tsx (88%)
rename examples/react/start-basic-auth/{app => src}/routes/signup.tsx (91%)
rename examples/react/{start-bare/app => start-basic-auth/src}/server.ts (100%)
rename examples/react/start-basic-auth/{app => src}/styles/app.css (100%)
rename examples/react/start-basic-auth/{app => src}/utils/posts.ts (100%)
rename examples/react/start-basic-auth/{app => src}/utils/prisma.ts (100%)
rename examples/react/start-basic-auth/{app => src}/utils/seo.ts (100%)
rename examples/react/start-basic-auth/{app => src}/utils/session.ts (100%)
rename examples/react/start-basic-react-query/{app => src}/api.ts (100%)
rename examples/react/start-basic-react-query/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/components/NotFound.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-basic-react-query/{app => src}/router.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/__root.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/_pathlessLayout.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/_pathlessLayout/_nested-layout.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/_pathlessLayout/_nested-layout/route-a.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/_pathlessLayout/_nested-layout/route-b.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/api.users.ts (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/api/users.$id.ts (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/deferred.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/index.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/posts.$postId.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/posts.index.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/posts.route.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/posts_.$postId.deep.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/redirect.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/users.$userId.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/users.index.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/routes/users.route.tsx (100%)
rename examples/react/{start-basic-auth/app => start-basic-react-query/src}/server.ts (100%)
rename examples/react/start-basic-react-query/{app => src}/styles/app.css (100%)
rename examples/react/start-basic-react-query/{app => src}/utils/posts.tsx (100%)
rename examples/react/start-basic-react-query/{app => src}/utils/seo.ts (100%)
rename examples/react/start-basic-react-query/{app => src}/utils/users.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/components/NotFound.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-basic-rsc/{app => src}/router.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/routes/__root.tsx (94%)
rename examples/react/start-basic-rsc/{app => src}/routes/_pathlessLayout.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/routes/_pathlessLayout/_nested-layout.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/routes/_pathlessLayout/_nested-layout/route-a.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/routes/_pathlessLayout/_nested-layout/route-b.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/routes/index.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/routes/posts.$postId.tsx (96%)
rename examples/react/start-basic-rsc/{app => src}/routes/posts.index.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/routes/posts.tsx (88%)
rename examples/react/start-basic-rsc/{app => src}/routes/posts_.$postId.deep.tsx (100%)
rename examples/react/{start-basic-react-query/app => start-basic-rsc/src}/server.ts (100%)
rename examples/react/start-basic-rsc/{app => src}/styles/app.css (100%)
rename examples/react/start-basic-rsc/{app => src}/utils/posts.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/utils/renderPosts.tsx (100%)
rename examples/react/start-basic-rsc/{app => src}/utils/seo.ts (100%)
delete mode 100644 examples/react/start-basic-static/app/routes/__root.tsx
rename examples/react/start-basic-static/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename examples/react/start-basic-static/{app => src}/components/NotFound.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-basic-static/{app => src}/router.tsx (100%)
rename examples/react/{start-basic/app => start-basic-static/src}/routes/__root.tsx (95%)
rename examples/react/start-basic-static/{app => src}/routes/_pathlessLayout.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routes/_pathlessLayout/_nested-layout.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routes/_pathlessLayout/_nested-layout/route-a.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routes/_pathlessLayout/_nested-layout/route-b.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routes/deferred.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routes/index.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routes/posts.$postId.tsx (95%)
rename examples/react/start-basic-static/{app => src}/routes/posts.index.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routes/posts.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routes/posts_.$postId.deep.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routes/redirect.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routes/users.$userId.tsx (93%)
rename examples/react/start-basic-static/{app => src}/routes/users.index.tsx (100%)
rename examples/react/start-basic-static/{app => src}/routes/users.tsx (100%)
rename examples/react/{start-basic-rsc/app => start-basic-static/src}/server.ts (100%)
rename examples/react/start-basic-static/{app => src}/styles/app.css (100%)
rename examples/react/start-basic-static/{app => src}/utils/loggingMiddleware.tsx (100%)
rename examples/react/start-basic-static/{app => src}/utils/posts.tsx (100%)
rename examples/react/start-basic-static/{app => src}/utils/seo.ts (100%)
rename examples/react/start-basic-static/{app => src}/utils/users.tsx (100%)
delete mode 100644 examples/react/start-basic/app/routeTree.gen.ts
delete mode 100644 examples/react/start-basic/src/routes/_layout/_layout-2.tsx
delete mode 100644 examples/react/start-basic/src/routes/_layout/_layout-2/layout-a.tsx
delete mode 100644 examples/react/start-basic/src/routes/_layout/_layout-2/layout-b.tsx
rename examples/react/start-basic/{app => src}/routes/_pathlessLayout.tsx (100%)
rename examples/react/start-basic/{app => src}/routes/_pathlessLayout/_nested-layout.tsx (100%)
rename examples/react/start-basic/{app => src}/routes/_pathlessLayout/_nested-layout/route-a.tsx (100%)
rename examples/react/start-basic/{app => src}/routes/_pathlessLayout/_nested-layout/route-b.tsx (100%)
rename examples/react/start-basic/{app => src}/routes/posts.route.tsx (100%)
rename examples/react/start-basic/{app => src}/routes/users.route.tsx (100%)
rename examples/react/start-clerk-basic/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename examples/react/start-clerk-basic/{app => src}/components/NotFound.tsx (100%)
rename examples/react/start-clerk-basic/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-clerk-basic/{app => src}/router.tsx (100%)
rename examples/react/start-clerk-basic/{app => src}/routes/__root.tsx (95%)
rename examples/react/start-clerk-basic/{app => src}/routes/_authed.tsx (100%)
rename examples/react/{start-basic-auth/app => start-clerk-basic/src}/routes/_authed/posts.$postId.tsx (88%)
rename examples/react/start-clerk-basic/{app => src}/routes/_authed/posts.index.tsx (100%)
rename examples/react/start-clerk-basic/{app => src}/routes/_authed/posts.tsx (95%)
rename examples/react/start-clerk-basic/{app => src}/routes/_authed/profile.$.tsx (95%)
rename examples/react/start-clerk-basic/{app => src}/routes/index.tsx (100%)
rename examples/react/start-clerk-basic/{app => src}/server.ts (100%)
rename examples/react/start-clerk-basic/{app => src}/styles/app.css (100%)
rename examples/react/start-clerk-basic/{app => src}/utils/posts.ts (100%)
rename examples/react/start-clerk-basic/{app => src}/utils/seo.ts (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/Board.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/CancelButton.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/Card.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/Column.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/EditableText.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/IconLink.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/Loader.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/NewCard.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/NewColumn.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/NotFound.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/components/SaveButton.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/db/schema.ts (100%)
rename examples/react/start-convex-trellaux/{app => src}/hooks/useOfflineIndicator.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/icons/icons.svg (100%)
rename examples/react/start-convex-trellaux/{app => src}/icons/icons.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/queries.ts (100%)
rename examples/react/start-convex-trellaux/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-convex-trellaux/{app => src}/router.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/routes/__root.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/routes/boards.$boardId.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/routes/index.tsx (100%)
rename examples/react/{start-basic-static/app => start-convex-trellaux/src}/server.ts (100%)
rename examples/react/start-convex-trellaux/{app => src}/styles/app.css (100%)
rename examples/react/start-convex-trellaux/{app => src}/types.ts (100%)
rename examples/react/start-convex-trellaux/{app => src}/utils/posts.tsx (100%)
rename examples/react/start-convex-trellaux/{app => src}/utils/seo.ts (100%)
rename examples/react/start-counter/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-counter/{app => src}/router.tsx (100%)
rename examples/react/start-counter/{app => src}/routes/__root.tsx (100%)
rename examples/react/start-counter/{app => src}/routes/index.tsx (100%)
rename examples/react/{start-convex-trellaux/app => start-counter/src}/server.ts (100%)
rename examples/react/start-large/{app => src}/createRoutes.mjs (100%)
rename examples/react/start-large/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-large/{app => src}/router.tsx (100%)
rename examples/react/start-large/{app => src}/routes/__root.tsx (100%)
rename examples/react/start-large/{app => src}/routes/absolute.tsx (100%)
rename examples/react/start-large/{app => src}/routes/index.tsx (100%)
rename examples/react/start-large/{app => src}/routes/linkProps.tsx (98%)
rename examples/react/start-large/{app => src}/routes/params/$paramsPlaceholder.tsx (100%)
rename examples/react/start-large/{app => src}/routes/params/route.tsx (100%)
rename examples/react/start-large/{app => src}/routes/relative.tsx (100%)
rename examples/react/start-large/{app => src}/routes/search/route.tsx (100%)
rename examples/react/start-large/{app => src}/routes/search/searchPlaceholder.tsx (100%)
rename examples/react/start-large/{app => src}/server.ts (100%)
rename examples/react/start-large/{app => src}/styles.css (100%)
rename examples/react/start-large/{app => src}/typePrimitives.tsx (100%)
rename examples/react/start-material-ui/{app => src}/client.tsx (100%)
rename examples/react/start-material-ui/{app => src}/components/Counter.tsx (85%)
rename examples/react/start-material-ui/{app => src}/components/CustomButtonLink.tsx (100%)
rename examples/react/start-material-ui/{app => src}/components/CustomLink.tsx (100%)
rename examples/react/start-material-ui/{app => src}/components/Header.tsx (100%)
rename examples/react/start-material-ui/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-material-ui/{app => src}/router.tsx (100%)
rename examples/react/start-material-ui/{app => src}/routes/__root.tsx (94%)
rename examples/react/start-material-ui/{app => src}/routes/about.tsx (100%)
rename examples/react/start-material-ui/{app => src}/routes/index.tsx (90%)
rename examples/react/start-material-ui/{app => src}/setup/theme.ts (100%)
rename examples/react/start-material-ui/{app => src}/ssr.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/components/Auth.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/components/Login.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/components/NotFound.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/hooks/useMutation.ts (100%)
rename examples/react/start-supabase-basic/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-supabase-basic/{app => src}/router.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/routes/__root.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/routes/_authed.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/routes/_authed/posts.$postId.tsx (89%)
rename examples/react/start-supabase-basic/{app => src}/routes/_authed/posts.index.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/routes/_authed/posts.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/routes/index.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/routes/login.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/routes/logout.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/routes/signup.tsx (100%)
rename examples/react/start-supabase-basic/{app => src}/server.ts (100%)
rename examples/react/start-supabase-basic/{app => src}/styles/app.css (100%)
rename examples/react/start-supabase-basic/{app => src}/utils/posts.ts (100%)
rename examples/react/start-supabase-basic/{app => src}/utils/seo.ts (100%)
rename examples/react/start-supabase-basic/{app => src}/utils/supabase.ts (100%)
delete mode 100644 examples/react/start-trellaux/app/server.ts
rename examples/react/start-trellaux/{app => src}/assets/react.svg (100%)
rename examples/react/start-trellaux/{app => src}/components/Board.tsx (100%)
rename examples/react/start-trellaux/{app => src}/components/CancelButton.tsx (100%)
rename examples/react/start-trellaux/{app => src}/components/Card.tsx (100%)
rename examples/react/start-trellaux/{app => src}/components/Column.tsx (100%)
rename examples/react/start-trellaux/{app => src}/components/DefaultCatchBoundary.tsx (100%)
rename examples/react/start-trellaux/{app => src}/components/EditableText.tsx (100%)
rename examples/react/start-trellaux/{app => src}/components/IconLink.tsx (100%)
rename examples/react/start-trellaux/{app => src}/components/Loader.tsx (100%)
rename examples/react/start-trellaux/{app => src}/components/NewCard.tsx (100%)
rename examples/react/start-trellaux/{app => src}/components/NewColumn.tsx (100%)
rename examples/react/start-trellaux/{app => src}/components/NotFound.tsx (100%)
rename examples/react/start-trellaux/{app => src}/components/SaveButton.tsx (100%)
rename examples/react/start-trellaux/{app => src}/db/board.ts (100%)
rename examples/react/start-trellaux/{app => src}/db/schema.ts (100%)
rename examples/react/start-trellaux/{app => src}/hooks/useOfflineIndicator.tsx (100%)
rename examples/react/start-trellaux/{app => src}/icons/icons.svg (100%)
rename examples/react/start-trellaux/{app => src}/icons/icons.tsx (100%)
rename examples/react/start-trellaux/{app => src}/queries.ts (100%)
rename examples/react/start-trellaux/{app => src}/routeTree.gen.ts (100%)
rename examples/react/start-trellaux/{app => src}/router.tsx (100%)
rename examples/react/start-trellaux/{app => src}/routes/__root.tsx (100%)
rename examples/react/start-trellaux/{app => src}/routes/boards.$boardId.tsx (100%)
rename examples/react/start-trellaux/{app => src}/routes/index.tsx (100%)
rename examples/react/{start-counter/app => start-trellaux/src}/server.ts (100%)
rename examples/react/start-trellaux/{app => src}/styles/app.css (100%)
rename examples/react/start-trellaux/{app => src}/types.ts (100%)
rename examples/react/start-trellaux/{app => src}/utils/posts.tsx (100%)
rename examples/react/start-trellaux/{app => src}/utils/seo.ts (100%)
rename examples/react/with-trpc-react-query/{app => src}/main.tsx (100%)
rename examples/react/with-trpc-react-query/{app => src}/routeTree.gen.ts (100%)
rename examples/react/with-trpc-react-query/{app => src}/router.tsx (100%)
rename examples/react/with-trpc-react-query/{app => src}/routes/-components/spinner.tsx (100%)
rename examples/react/with-trpc-react-query/{app => src}/routes/__root.tsx (100%)
rename examples/react/with-trpc-react-query/{app => src}/routes/dashboard.index.tsx (100%)
rename examples/react/with-trpc-react-query/{app => src}/routes/dashboard.posts.$postId.tsx (100%)
rename examples/react/with-trpc-react-query/{app => src}/routes/dashboard.posts.index.tsx (100%)
rename examples/react/with-trpc-react-query/{app => src}/routes/dashboard.posts.tsx (100%)
rename examples/react/with-trpc-react-query/{app => src}/routes/dashboard.tsx (100%)
rename examples/react/with-trpc-react-query/{app => src}/routes/index.tsx (100%)
rename examples/react/with-trpc-react-query/{app => src}/styles.css (100%)
rename examples/react/with-trpc/{app => src}/main.tsx (100%)
rename examples/react/with-trpc/{app => src}/routeTree.gen.ts (100%)
rename examples/react/with-trpc/{app => src}/routes/-components/spinner.tsx (100%)
rename examples/react/with-trpc/{app => src}/routes/__root.tsx (100%)
rename examples/react/with-trpc/{app => src}/routes/dashboard.index.tsx (100%)
rename examples/react/with-trpc/{app => src}/routes/dashboard.posts.$postId.tsx (100%)
rename examples/react/with-trpc/{app => src}/routes/dashboard.posts.index.tsx (100%)
rename examples/react/with-trpc/{app => src}/routes/dashboard.posts.tsx (100%)
rename examples/react/with-trpc/{app => src}/routes/dashboard.tsx (100%)
rename examples/react/with-trpc/{app => src}/routes/index.tsx (100%)
rename examples/react/with-trpc/{app => src}/styles.css (100%)
rename examples/react/with-trpc/{app => src}/trpc.ts (100%)
rename {e2e/solid-start/website/app => examples/solid/start-bare/src}/client.tsx (100%)
rename examples/solid/start-bare/{app => src}/components/Counter.css (100%)
rename examples/solid/start-bare/{app => src}/components/Counter.tsx (100%)
rename examples/solid/start-bare/{app => src}/routeTree.gen.ts (100%)
rename examples/solid/start-bare/{app => src}/router.tsx (100%)
rename examples/solid/start-bare/{app => src}/routes/__root.tsx (100%)
rename examples/solid/start-bare/{app => src}/routes/about.tsx (100%)
rename examples/solid/start-bare/{app => src}/routes/index.tsx (86%)
rename examples/solid/start-bare/{app => src}/ssr.tsx (100%)
rename examples/solid/start-bare/{app => src}/styles/app.css (100%)
rename packages/create-start/src/modules/core/template/{app => src}/client.tsx (100%)
rename packages/create-start/src/modules/core/template/{app => src}/router.tsx (100%)
rename packages/create-start/src/modules/core/template/{app => src}/routes/__root.tsx (100%)
diff --git a/e2e/react-start/basic-auth/app/components/Auth.tsx b/e2e/react-start/basic-auth/src/components/Auth.tsx
similarity index 100%
rename from e2e/react-start/basic-auth/app/components/Auth.tsx
rename to e2e/react-start/basic-auth/src/components/Auth.tsx
diff --git a/e2e/react-start/basic-auth/app/components/DefaultCatchBoundary.tsx b/e2e/react-start/basic-auth/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from e2e/react-start/basic-auth/app/components/DefaultCatchBoundary.tsx
rename to e2e/react-start/basic-auth/src/components/DefaultCatchBoundary.tsx
diff --git a/e2e/react-start/basic-auth/app/components/Login.tsx b/e2e/react-start/basic-auth/src/components/Login.tsx
similarity index 97%
rename from e2e/react-start/basic-auth/app/components/Login.tsx
rename to e2e/react-start/basic-auth/src/components/Login.tsx
index b6b6da0c37..9ba6b8f019 100644
--- a/e2e/react-start/basic-auth/app/components/Login.tsx
+++ b/e2e/react-start/basic-auth/src/components/Login.tsx
@@ -3,7 +3,7 @@ import { useServerFn } from '@tanstack/react-start'
import { useMutation } from '../hooks/useMutation'
import { loginFn } from '../routes/_authed'
import { Auth } from './Auth'
-import { signupFn } from '~/routes/signup'
+import { signupFn } from 'src/routes/signup'
export function Login() {
const router = useRouter()
diff --git a/e2e/react-start/basic-auth/app/components/NotFound.tsx b/e2e/react-start/basic-auth/src/components/NotFound.tsx
similarity index 100%
rename from e2e/react-start/basic-auth/app/components/NotFound.tsx
rename to e2e/react-start/basic-auth/src/components/NotFound.tsx
diff --git a/e2e/react-start/basic-auth/app/hooks/useMutation.ts b/e2e/react-start/basic-auth/src/hooks/useMutation.ts
similarity index 100%
rename from e2e/react-start/basic-auth/app/hooks/useMutation.ts
rename to e2e/react-start/basic-auth/src/hooks/useMutation.ts
diff --git a/e2e/react-start/basic-auth/app/routeTree.gen.ts b/e2e/react-start/basic-auth/src/routeTree.gen.ts
similarity index 100%
rename from e2e/react-start/basic-auth/app/routeTree.gen.ts
rename to e2e/react-start/basic-auth/src/routeTree.gen.ts
diff --git a/e2e/react-start/basic-auth/app/router.tsx b/e2e/react-start/basic-auth/src/router.tsx
similarity index 100%
rename from e2e/react-start/basic-auth/app/router.tsx
rename to e2e/react-start/basic-auth/src/router.tsx
diff --git a/e2e/react-start/basic-auth/app/routes/__root.tsx b/e2e/react-start/basic-auth/src/routes/__root.tsx
similarity index 93%
rename from e2e/react-start/basic-auth/app/routes/__root.tsx
rename to e2e/react-start/basic-auth/src/routes/__root.tsx
index a3c8d1e872..3eeb03a93d 100644
--- a/e2e/react-start/basic-auth/app/routes/__root.tsx
+++ b/e2e/react-start/basic-auth/src/routes/__root.tsx
@@ -9,11 +9,11 @@ import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import { createServerFn } from '@tanstack/react-start'
import * as React from 'react'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js'
-import { NotFound } from '~/components/NotFound.js'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary.js'
+import { NotFound } from 'src/components/NotFound.js'
import appCss from '~/styles/app.css?url'
-import { seo } from '~/utils/seo.js'
-import { useAppSession } from '~/utils/session.js'
+import { seo } from 'src/utils/seo.js'
+import { useAppSession } from 'src/utils/session.js'
const fetchUser = createServerFn({ method: 'GET' }).handler(async () => {
// We need to auth on the server so we have access to secure cookies
diff --git a/e2e/react-start/basic-auth/app/routes/_authed.tsx b/e2e/react-start/basic-auth/src/routes/_authed.tsx
similarity index 89%
rename from e2e/react-start/basic-auth/app/routes/_authed.tsx
rename to e2e/react-start/basic-auth/src/routes/_authed.tsx
index c457cf5e57..b238afe63f 100644
--- a/e2e/react-start/basic-auth/app/routes/_authed.tsx
+++ b/e2e/react-start/basic-auth/src/routes/_authed.tsx
@@ -1,9 +1,9 @@
import { createFileRoute } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
-import { hashPassword, prismaClient } from '~/utils/prisma'
-import { Login } from '~/components/Login'
-import { useAppSession } from '~/utils/session'
+import { hashPassword, prismaClient } from 'src/utils/prisma'
+import { Login } from 'src/components/Login'
+import { useAppSession } from 'src/utils/session'
export const loginFn = createServerFn({
method: 'POST',
diff --git a/e2e/react-start/clerk-basic/app/routes/_authed/posts.$postId.tsx b/e2e/react-start/basic-auth/src/routes/_authed/posts.$postId.tsx
similarity index 88%
rename from e2e/react-start/clerk-basic/app/routes/_authed/posts.$postId.tsx
rename to e2e/react-start/basic-auth/src/routes/_authed/posts.$postId.tsx
index 27296b9658..612394673b 100644
--- a/e2e/react-start/clerk-basic/app/routes/_authed/posts.$postId.tsx
+++ b/e2e/react-start/basic-auth/src/routes/_authed/posts.$postId.tsx
@@ -1,8 +1,8 @@
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from '~/components/NotFound.js'
-import { fetchPost } from '~/utils/posts.js'
+import { NotFound } from 'src/components/NotFound.js'
+import { fetchPost } from 'src/utils/posts.js'
export const Route = createFileRoute('/_authed/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/e2e/react-start/basic-auth/app/routes/_authed/posts.index.tsx b/e2e/react-start/basic-auth/src/routes/_authed/posts.index.tsx
similarity index 100%
rename from e2e/react-start/basic-auth/app/routes/_authed/posts.index.tsx
rename to e2e/react-start/basic-auth/src/routes/_authed/posts.index.tsx
diff --git a/e2e/react-start/basic-auth/app/routes/_authed/posts.tsx b/e2e/react-start/basic-auth/src/routes/_authed/posts.tsx
similarity index 95%
rename from e2e/react-start/basic-auth/app/routes/_authed/posts.tsx
rename to e2e/react-start/basic-auth/src/routes/_authed/posts.tsx
index c01f12c49a..d769f02b68 100644
--- a/e2e/react-start/basic-auth/app/routes/_authed/posts.tsx
+++ b/e2e/react-start/basic-auth/src/routes/_authed/posts.tsx
@@ -1,6 +1,6 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from '~/utils/posts.js'
+import { fetchPosts } from 'src/utils/posts.js'
export const Route = createFileRoute('/_authed/posts')({
loader: () => fetchPosts(),
diff --git a/e2e/react-start/basic-auth/app/routes/index.tsx b/e2e/react-start/basic-auth/src/routes/index.tsx
similarity index 100%
rename from e2e/react-start/basic-auth/app/routes/index.tsx
rename to e2e/react-start/basic-auth/src/routes/index.tsx
diff --git a/e2e/react-start/basic-auth/app/routes/login.tsx b/e2e/react-start/basic-auth/src/routes/login.tsx
similarity index 80%
rename from e2e/react-start/basic-auth/app/routes/login.tsx
rename to e2e/react-start/basic-auth/src/routes/login.tsx
index 19dc34a439..ef419a72f7 100644
--- a/e2e/react-start/basic-auth/app/routes/login.tsx
+++ b/e2e/react-start/basic-auth/src/routes/login.tsx
@@ -1,6 +1,6 @@
import { createFileRoute } from '@tanstack/react-router'
-import { Login } from '~/components/Login'
+import { Login } from 'src/components/Login'
export const Route = createFileRoute('/login')({
component: LoginComp,
diff --git a/e2e/react-start/basic-auth/app/routes/logout.tsx b/e2e/react-start/basic-auth/src/routes/logout.tsx
similarity index 88%
rename from e2e/react-start/basic-auth/app/routes/logout.tsx
rename to e2e/react-start/basic-auth/src/routes/logout.tsx
index 43a14fa39a..0060780d11 100644
--- a/e2e/react-start/basic-auth/app/routes/logout.tsx
+++ b/e2e/react-start/basic-auth/src/routes/logout.tsx
@@ -1,7 +1,7 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
-import { useAppSession } from '~/utils/session'
+import { useAppSession } from 'src/utils/session'
const logoutFn = createServerFn({ method: 'POST' }).handler(async () => {
const session = await useAppSession()
diff --git a/e2e/react-start/basic-auth/app/routes/signup.tsx b/e2e/react-start/basic-auth/src/routes/signup.tsx
similarity index 91%
rename from e2e/react-start/basic-auth/app/routes/signup.tsx
rename to e2e/react-start/basic-auth/src/routes/signup.tsx
index 5edbb4993f..864ab0ab38 100644
--- a/e2e/react-start/basic-auth/app/routes/signup.tsx
+++ b/e2e/react-start/basic-auth/src/routes/signup.tsx
@@ -1,10 +1,10 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { createServerFn, useServerFn } from '@tanstack/react-start'
-import { hashPassword, prismaClient } from '~/utils/prisma'
-import { useMutation } from '~/hooks/useMutation'
-import { Auth } from '~/components/Auth'
-import { useAppSession } from '~/utils/session'
+import { hashPassword, prismaClient } from 'src/utils/prisma'
+import { useMutation } from 'src/hooks/useMutation'
+import { Auth } from 'src/components/Auth'
+import { useAppSession } from 'src/utils/session'
export const signupFn = createServerFn({
method: 'POST',
diff --git a/e2e/react-start/basic-auth/app/styles/app.css b/e2e/react-start/basic-auth/src/styles/app.css
similarity index 100%
rename from e2e/react-start/basic-auth/app/styles/app.css
rename to e2e/react-start/basic-auth/src/styles/app.css
diff --git a/e2e/react-start/basic-auth/app/utils/posts.ts b/e2e/react-start/basic-auth/src/utils/posts.ts
similarity index 100%
rename from e2e/react-start/basic-auth/app/utils/posts.ts
rename to e2e/react-start/basic-auth/src/utils/posts.ts
diff --git a/e2e/react-start/basic-auth/app/utils/prisma.ts b/e2e/react-start/basic-auth/src/utils/prisma.ts
similarity index 100%
rename from e2e/react-start/basic-auth/app/utils/prisma.ts
rename to e2e/react-start/basic-auth/src/utils/prisma.ts
diff --git a/e2e/react-start/basic-auth/app/utils/seo.ts b/e2e/react-start/basic-auth/src/utils/seo.ts
similarity index 100%
rename from e2e/react-start/basic-auth/app/utils/seo.ts
rename to e2e/react-start/basic-auth/src/utils/seo.ts
diff --git a/e2e/react-start/basic-auth/app/utils/session.ts b/e2e/react-start/basic-auth/src/utils/session.ts
similarity index 100%
rename from e2e/react-start/basic-auth/app/utils/session.ts
rename to e2e/react-start/basic-auth/src/utils/session.ts
diff --git a/e2e/react-start/basic-auth/tsconfig.json b/e2e/react-start/basic-auth/tsconfig.json
index d1b5b77660..9a7cf62c30 100644
--- a/e2e/react-start/basic-auth/tsconfig.json
+++ b/e2e/react-start/basic-auth/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/e2e/react-start/basic-react-query/app/api.ts b/e2e/react-start/basic-react-query/src/api.ts
similarity index 100%
rename from e2e/react-start/basic-react-query/app/api.ts
rename to e2e/react-start/basic-react-query/src/api.ts
diff --git a/e2e/react-start/basic-react-query/app/components/DefaultCatchBoundary.tsx b/e2e/react-start/basic-react-query/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/components/DefaultCatchBoundary.tsx
rename to e2e/react-start/basic-react-query/src/components/DefaultCatchBoundary.tsx
diff --git a/e2e/react-start/basic-react-query/app/components/NotFound.tsx b/e2e/react-start/basic-react-query/src/components/NotFound.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/components/NotFound.tsx
rename to e2e/react-start/basic-react-query/src/components/NotFound.tsx
diff --git a/e2e/react-start/basic-react-query/app/routeTree.gen.ts b/e2e/react-start/basic-react-query/src/routeTree.gen.ts
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routeTree.gen.ts
rename to e2e/react-start/basic-react-query/src/routeTree.gen.ts
diff --git a/e2e/react-start/basic-react-query/app/router.tsx b/e2e/react-start/basic-react-query/src/router.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/router.tsx
rename to e2e/react-start/basic-react-query/src/router.tsx
diff --git a/e2e/react-start/basic-react-query/app/routes/__root.tsx b/e2e/react-start/basic-react-query/src/routes/__root.tsx
similarity index 95%
rename from e2e/react-start/basic-react-query/app/routes/__root.tsx
rename to e2e/react-start/basic-react-query/src/routes/__root.tsx
index 6bd9e76801..ff8b829c6a 100644
--- a/e2e/react-start/basic-react-query/app/routes/__root.tsx
+++ b/e2e/react-start/basic-react-query/src/routes/__root.tsx
@@ -9,10 +9,10 @@ import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import { TanStackRouterDevtoolsInProd } from '@tanstack/react-router-devtools'
import * as React from 'react'
import type { QueryClient } from '@tanstack/react-query'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
-import { NotFound } from '~/components/NotFound'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
+import { NotFound } from 'src/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from '~/utils/seo'
+import { seo } from 'src/utils/seo'
export const Route = createRootRouteWithContext<{
queryClient: QueryClient
diff --git a/e2e/react-start/basic-react-query/app/routes/_layout.tsx b/e2e/react-start/basic-react-query/src/routes/_layout.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/_layout.tsx
rename to e2e/react-start/basic-react-query/src/routes/_layout.tsx
diff --git a/e2e/react-start/basic-react-query/app/routes/_layout/_layout-2.tsx b/e2e/react-start/basic-react-query/src/routes/_layout/_layout-2.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/_layout/_layout-2.tsx
rename to e2e/react-start/basic-react-query/src/routes/_layout/_layout-2.tsx
diff --git a/e2e/react-start/basic-react-query/app/routes/_layout/_layout-2/layout-a.tsx b/e2e/react-start/basic-react-query/src/routes/_layout/_layout-2/layout-a.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/_layout/_layout-2/layout-a.tsx
rename to e2e/react-start/basic-react-query/src/routes/_layout/_layout-2/layout-a.tsx
diff --git a/e2e/react-start/basic-react-query/app/routes/_layout/_layout-2/layout-b.tsx b/e2e/react-start/basic-react-query/src/routes/_layout/_layout-2/layout-b.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/_layout/_layout-2/layout-b.tsx
rename to e2e/react-start/basic-react-query/src/routes/_layout/_layout-2/layout-b.tsx
diff --git a/e2e/react-start/basic-react-query/app/routes/api.users.ts b/e2e/react-start/basic-react-query/src/routes/api.users.ts
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/api.users.ts
rename to e2e/react-start/basic-react-query/src/routes/api.users.ts
diff --git a/e2e/react-start/basic-react-query/app/routes/api/users.$id.ts b/e2e/react-start/basic-react-query/src/routes/api/users.$id.ts
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/api/users.$id.ts
rename to e2e/react-start/basic-react-query/src/routes/api/users.$id.ts
diff --git a/e2e/react-start/basic-react-query/app/routes/deferred.tsx b/e2e/react-start/basic-react-query/src/routes/deferred.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/deferred.tsx
rename to e2e/react-start/basic-react-query/src/routes/deferred.tsx
diff --git a/e2e/react-start/basic-react-query/app/routes/index.tsx b/e2e/react-start/basic-react-query/src/routes/index.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/index.tsx
rename to e2e/react-start/basic-react-query/src/routes/index.tsx
diff --git a/e2e/react-start/basic-react-query/app/routes/posts.$postId.tsx b/e2e/react-start/basic-react-query/src/routes/posts.$postId.tsx
similarity index 93%
rename from e2e/react-start/basic-react-query/app/routes/posts.$postId.tsx
rename to e2e/react-start/basic-react-query/src/routes/posts.$postId.tsx
index 16a6bf29aa..688e23a674 100644
--- a/e2e/react-start/basic-react-query/app/routes/posts.$postId.tsx
+++ b/e2e/react-start/basic-react-query/src/routes/posts.$postId.tsx
@@ -2,8 +2,8 @@ import { ErrorComponent, Link, createFileRoute } from '@tanstack/react-router'
import { useSuspenseQuery } from '@tanstack/react-query'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { postQueryOptions } from '~/utils/posts'
-import { NotFound } from '~/components/NotFound'
+import { postQueryOptions } from 'src/utils/posts'
+import { NotFound } from 'src/components/NotFound'
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params: { postId }, context }) => {
diff --git a/e2e/react-start/basic-react-query/app/routes/posts.index.tsx b/e2e/react-start/basic-react-query/src/routes/posts.index.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/posts.index.tsx
rename to e2e/react-start/basic-react-query/src/routes/posts.index.tsx
diff --git a/e2e/react-start/basic-react-query/app/routes/posts.tsx b/e2e/react-start/basic-react-query/src/routes/posts.tsx
similarity index 95%
rename from e2e/react-start/basic-react-query/app/routes/posts.tsx
rename to e2e/react-start/basic-react-query/src/routes/posts.tsx
index 3f678ed1f1..83919aafc9 100644
--- a/e2e/react-start/basic-react-query/app/routes/posts.tsx
+++ b/e2e/react-start/basic-react-query/src/routes/posts.tsx
@@ -1,7 +1,7 @@
import { useSuspenseQuery } from '@tanstack/react-query'
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { postsQueryOptions } from '~/utils/posts'
+import { postsQueryOptions } from 'src/utils/posts'
export const Route = createFileRoute('/posts')({
loader: async ({ context }) => {
diff --git a/e2e/react-start/basic-react-query/app/routes/posts_.$postId.deep.tsx b/e2e/react-start/basic-react-query/src/routes/posts_.$postId.deep.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/posts_.$postId.deep.tsx
rename to e2e/react-start/basic-react-query/src/routes/posts_.$postId.deep.tsx
diff --git a/e2e/react-start/basic-react-query/app/routes/redirect.tsx b/e2e/react-start/basic-react-query/src/routes/redirect.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/redirect.tsx
rename to e2e/react-start/basic-react-query/src/routes/redirect.tsx
diff --git a/e2e/react-start/basic-react-query/app/routes/users.$userId.tsx b/e2e/react-start/basic-react-query/src/routes/users.$userId.tsx
similarity index 90%
rename from e2e/react-start/basic-react-query/app/routes/users.$userId.tsx
rename to e2e/react-start/basic-react-query/src/routes/users.$userId.tsx
index 656fb6dbb8..8db366a551 100644
--- a/e2e/react-start/basic-react-query/app/routes/users.$userId.tsx
+++ b/e2e/react-start/basic-react-query/src/routes/users.$userId.tsx
@@ -2,8 +2,8 @@ import { useSuspenseQuery } from '@tanstack/react-query'
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from '~/components/NotFound'
-import { userQueryOptions } from '~/utils/users'
+import { NotFound } from 'src/components/NotFound'
+import { userQueryOptions } from 'src/utils/users'
export const Route = createFileRoute('/users/$userId')({
loader: async ({ context, params: { userId } }) => {
diff --git a/e2e/react-start/basic-react-query/app/routes/users.index.tsx b/e2e/react-start/basic-react-query/src/routes/users.index.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/routes/users.index.tsx
rename to e2e/react-start/basic-react-query/src/routes/users.index.tsx
diff --git a/e2e/react-start/basic-react-query/app/routes/users.tsx b/e2e/react-start/basic-react-query/src/routes/users.tsx
similarity index 95%
rename from e2e/react-start/basic-react-query/app/routes/users.tsx
rename to e2e/react-start/basic-react-query/src/routes/users.tsx
index 1b56bb9890..c0ad4349aa 100644
--- a/e2e/react-start/basic-react-query/app/routes/users.tsx
+++ b/e2e/react-start/basic-react-query/src/routes/users.tsx
@@ -1,7 +1,7 @@
import { useSuspenseQuery } from '@tanstack/react-query'
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { usersQueryOptions } from '~/utils/users'
+import { usersQueryOptions } from 'src/utils/users'
export const Route = createFileRoute('/users')({
loader: async ({ context }) => {
diff --git a/e2e/react-start/basic-react-query/app/styles/app.css b/e2e/react-start/basic-react-query/src/styles/app.css
similarity index 100%
rename from e2e/react-start/basic-react-query/app/styles/app.css
rename to e2e/react-start/basic-react-query/src/styles/app.css
diff --git a/e2e/react-start/basic-react-query/app/utils/posts.tsx b/e2e/react-start/basic-react-query/src/utils/posts.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/utils/posts.tsx
rename to e2e/react-start/basic-react-query/src/utils/posts.tsx
diff --git a/e2e/react-start/basic-react-query/app/utils/seo.ts b/e2e/react-start/basic-react-query/src/utils/seo.ts
similarity index 100%
rename from e2e/react-start/basic-react-query/app/utils/seo.ts
rename to e2e/react-start/basic-react-query/src/utils/seo.ts
diff --git a/e2e/react-start/basic-react-query/app/utils/users.tsx b/e2e/react-start/basic-react-query/src/utils/users.tsx
similarity index 100%
rename from e2e/react-start/basic-react-query/app/utils/users.tsx
rename to e2e/react-start/basic-react-query/src/utils/users.tsx
diff --git a/e2e/react-start/basic-react-query/tsconfig.json b/e2e/react-start/basic-react-query/tsconfig.json
index d1b5b77660..9a7cf62c30 100644
--- a/e2e/react-start/basic-react-query/tsconfig.json
+++ b/e2e/react-start/basic-react-query/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/e2e/react-start/basic-tsr-config/src/app/routeTree.gen.ts b/e2e/react-start/basic-tsr-config/src/routeTree.gen.ts
similarity index 100%
rename from e2e/react-start/basic-tsr-config/src/app/routeTree.gen.ts
rename to e2e/react-start/basic-tsr-config/src/routeTree.gen.ts
diff --git a/e2e/react-start/basic-tsr-config/src/app/router.tsx b/e2e/react-start/basic-tsr-config/src/router.tsx
similarity index 100%
rename from e2e/react-start/basic-tsr-config/src/app/router.tsx
rename to e2e/react-start/basic-tsr-config/src/router.tsx
diff --git a/e2e/react-start/basic-tsr-config/src/app/routes/__root.tsx b/e2e/react-start/basic-tsr-config/src/routes/__root.tsx
similarity index 100%
rename from e2e/react-start/basic-tsr-config/src/app/routes/__root.tsx
rename to e2e/react-start/basic-tsr-config/src/routes/__root.tsx
diff --git a/e2e/react-start/basic-tsr-config/src/app/routes/index.tsx b/e2e/react-start/basic-tsr-config/src/routes/index.tsx
similarity index 100%
rename from e2e/react-start/basic-tsr-config/src/app/routes/index.tsx
rename to e2e/react-start/basic-tsr-config/src/routes/index.tsx
diff --git a/e2e/react-start/basic/app/api.ts b/e2e/react-start/basic/src/api.ts
similarity index 100%
rename from e2e/react-start/basic/app/api.ts
rename to e2e/react-start/basic/src/api.ts
diff --git a/e2e/react-start/basic/app/components/CustomMessage.tsx b/e2e/react-start/basic/src/components/CustomMessage.tsx
similarity index 100%
rename from e2e/react-start/basic/app/components/CustomMessage.tsx
rename to e2e/react-start/basic/src/components/CustomMessage.tsx
diff --git a/e2e/react-start/basic/app/components/DefaultCatchBoundary.tsx b/e2e/react-start/basic/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from e2e/react-start/basic/app/components/DefaultCatchBoundary.tsx
rename to e2e/react-start/basic/src/components/DefaultCatchBoundary.tsx
diff --git a/e2e/react-start/basic/app/components/NotFound.tsx b/e2e/react-start/basic/src/components/NotFound.tsx
similarity index 100%
rename from e2e/react-start/basic/app/components/NotFound.tsx
rename to e2e/react-start/basic/src/components/NotFound.tsx
diff --git a/e2e/react-start/basic/app/components/RedirectOnClick.tsx b/e2e/react-start/basic/src/components/RedirectOnClick.tsx
similarity index 100%
rename from e2e/react-start/basic/app/components/RedirectOnClick.tsx
rename to e2e/react-start/basic/src/components/RedirectOnClick.tsx
diff --git a/e2e/react-start/basic/app/components/throwRedirect.ts b/e2e/react-start/basic/src/components/throwRedirect.ts
similarity index 100%
rename from e2e/react-start/basic/app/components/throwRedirect.ts
rename to e2e/react-start/basic/src/components/throwRedirect.ts
diff --git a/e2e/react-start/basic/app/routeTree.gen.ts b/e2e/react-start/basic/src/routeTree.gen.ts
similarity index 100%
rename from e2e/react-start/basic/app/routeTree.gen.ts
rename to e2e/react-start/basic/src/routeTree.gen.ts
diff --git a/e2e/react-start/basic/app/router.tsx b/e2e/react-start/basic/src/router.tsx
similarity index 100%
rename from e2e/react-start/basic/app/router.tsx
rename to e2e/react-start/basic/src/router.tsx
diff --git a/e2e/react-start/basic/app/routes/__root.tsx b/e2e/react-start/basic/src/routes/__root.tsx
similarity index 95%
rename from e2e/react-start/basic/app/routes/__root.tsx
rename to e2e/react-start/basic/src/routes/__root.tsx
index 1b64b1c468..9c62771a63 100644
--- a/e2e/react-start/basic/app/routes/__root.tsx
+++ b/e2e/react-start/basic/src/routes/__root.tsx
@@ -7,10 +7,10 @@ import {
createRootRoute,
} from '@tanstack/react-router'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
-import { NotFound } from '~/components/NotFound'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
+import { NotFound } from 'src/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from '~/utils/seo'
+import { seo } from 'src/utils/seo'
export const Route = createRootRoute({
head: () => ({
diff --git a/e2e/react-start/basic/app/routes/_layout.tsx b/e2e/react-start/basic/src/routes/_layout.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/_layout.tsx
rename to e2e/react-start/basic/src/routes/_layout.tsx
diff --git a/e2e/react-start/basic/app/routes/_layout/_layout-2.tsx b/e2e/react-start/basic/src/routes/_layout/_layout-2.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/_layout/_layout-2.tsx
rename to e2e/react-start/basic/src/routes/_layout/_layout-2.tsx
diff --git a/e2e/react-start/basic/app/routes/_layout/_layout-2/layout-a.tsx b/e2e/react-start/basic/src/routes/_layout/_layout-2/layout-a.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/_layout/_layout-2/layout-a.tsx
rename to e2e/react-start/basic/src/routes/_layout/_layout-2/layout-a.tsx
diff --git a/e2e/react-start/basic/app/routes/_layout/_layout-2/layout-b.tsx b/e2e/react-start/basic/src/routes/_layout/_layout-2/layout-b.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/_layout/_layout-2/layout-b.tsx
rename to e2e/react-start/basic/src/routes/_layout/_layout-2/layout-b.tsx
diff --git a/e2e/react-start/basic/app/routes/api.users.ts b/e2e/react-start/basic/src/routes/api.users.ts
similarity index 100%
rename from e2e/react-start/basic/app/routes/api.users.ts
rename to e2e/react-start/basic/src/routes/api.users.ts
diff --git a/e2e/react-start/basic/app/routes/api/users.$id.ts b/e2e/react-start/basic/src/routes/api/users.$id.ts
similarity index 100%
rename from e2e/react-start/basic/app/routes/api/users.$id.ts
rename to e2e/react-start/basic/src/routes/api/users.$id.ts
diff --git a/e2e/react-start/basic/app/routes/deferred.tsx b/e2e/react-start/basic/src/routes/deferred.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/deferred.tsx
rename to e2e/react-start/basic/src/routes/deferred.tsx
diff --git a/e2e/react-start/basic/app/routes/index.tsx b/e2e/react-start/basic/src/routes/index.tsx
similarity index 82%
rename from e2e/react-start/basic/app/routes/index.tsx
rename to e2e/react-start/basic/src/routes/index.tsx
index 37169a78b4..55e4693651 100644
--- a/e2e/react-start/basic/app/routes/index.tsx
+++ b/e2e/react-start/basic/src/routes/index.tsx
@@ -1,5 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'
-import { CustomMessage } from '~/components/CustomMessage'
+import { CustomMessage } from 'src/components/CustomMessage'
export const Route = createFileRoute('/')({
component: Home,
diff --git a/e2e/react-start/basic/app/routes/links.tsx b/e2e/react-start/basic/src/routes/links.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/links.tsx
rename to e2e/react-start/basic/src/routes/links.tsx
diff --git a/e2e/react-start/basic/app/routes/not-found/index.tsx b/e2e/react-start/basic/src/routes/not-found/index.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/not-found/index.tsx
rename to e2e/react-start/basic/src/routes/not-found/index.tsx
diff --git a/e2e/react-start/basic/app/routes/not-found/route.tsx b/e2e/react-start/basic/src/routes/not-found/route.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/not-found/route.tsx
rename to e2e/react-start/basic/src/routes/not-found/route.tsx
diff --git a/e2e/react-start/basic/app/routes/not-found/via-beforeLoad.tsx b/e2e/react-start/basic/src/routes/not-found/via-beforeLoad.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/not-found/via-beforeLoad.tsx
rename to e2e/react-start/basic/src/routes/not-found/via-beforeLoad.tsx
diff --git a/e2e/react-start/basic/app/routes/not-found/via-loader.tsx b/e2e/react-start/basic/src/routes/not-found/via-loader.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/not-found/via-loader.tsx
rename to e2e/react-start/basic/src/routes/not-found/via-loader.tsx
diff --git a/e2e/react-start/basic/app/routes/posts.$postId.tsx b/e2e/react-start/basic/src/routes/posts.$postId.tsx
similarity index 91%
rename from e2e/react-start/basic/app/routes/posts.$postId.tsx
rename to e2e/react-start/basic/src/routes/posts.$postId.tsx
index 005228a0fe..368c1d3c1f 100644
--- a/e2e/react-start/basic/app/routes/posts.$postId.tsx
+++ b/e2e/react-start/basic/src/routes/posts.$postId.tsx
@@ -1,8 +1,8 @@
import { ErrorComponent, Link, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { fetchPost } from '~/utils/posts'
-import { NotFound } from '~/components/NotFound'
+import { fetchPost } from 'src/utils/posts'
+import { NotFound } from 'src/components/NotFound'
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/e2e/react-start/basic/app/routes/posts.index.tsx b/e2e/react-start/basic/src/routes/posts.index.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/posts.index.tsx
rename to e2e/react-start/basic/src/routes/posts.index.tsx
diff --git a/e2e/react-start/basic/app/routes/posts.tsx b/e2e/react-start/basic/src/routes/posts.tsx
similarity index 96%
rename from e2e/react-start/basic/app/routes/posts.tsx
rename to e2e/react-start/basic/src/routes/posts.tsx
index 0f69c18341..60e9aa37c3 100644
--- a/e2e/react-start/basic/app/routes/posts.tsx
+++ b/e2e/react-start/basic/src/routes/posts.tsx
@@ -1,6 +1,6 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from '~/utils/posts'
+import { fetchPosts } from 'src/utils/posts'
export const Route = createFileRoute('/posts')({
head: () => ({
diff --git a/e2e/react-start/basic/app/routes/posts_.$postId.deep.tsx b/e2e/react-start/basic/src/routes/posts_.$postId.deep.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/posts_.$postId.deep.tsx
rename to e2e/react-start/basic/src/routes/posts_.$postId.deep.tsx
diff --git a/e2e/react-start/basic/app/routes/redirect/$target.tsx b/e2e/react-start/basic/src/routes/redirect/$target.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/redirect/$target.tsx
rename to e2e/react-start/basic/src/routes/redirect/$target.tsx
diff --git a/e2e/react-start/basic/app/routes/redirect/$target/index.tsx b/e2e/react-start/basic/src/routes/redirect/$target/index.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/redirect/$target/index.tsx
rename to e2e/react-start/basic/src/routes/redirect/$target/index.tsx
diff --git a/e2e/react-start/basic/app/routes/redirect/$target/serverFn/index.tsx b/e2e/react-start/basic/src/routes/redirect/$target/serverFn/index.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/redirect/$target/serverFn/index.tsx
rename to e2e/react-start/basic/src/routes/redirect/$target/serverFn/index.tsx
diff --git a/e2e/react-start/basic/app/routes/redirect/$target/serverFn/via-beforeLoad.tsx b/e2e/react-start/basic/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/redirect/$target/serverFn/via-beforeLoad.tsx
rename to e2e/react-start/basic/src/routes/redirect/$target/serverFn/via-beforeLoad.tsx
diff --git a/e2e/react-start/basic/app/routes/redirect/$target/serverFn/via-loader.tsx b/e2e/react-start/basic/src/routes/redirect/$target/serverFn/via-loader.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/redirect/$target/serverFn/via-loader.tsx
rename to e2e/react-start/basic/src/routes/redirect/$target/serverFn/via-loader.tsx
diff --git a/e2e/react-start/basic/app/routes/redirect/$target/serverFn/via-useServerFn.tsx b/e2e/react-start/basic/src/routes/redirect/$target/serverFn/via-useServerFn.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/redirect/$target/serverFn/via-useServerFn.tsx
rename to e2e/react-start/basic/src/routes/redirect/$target/serverFn/via-useServerFn.tsx
diff --git a/e2e/react-start/basic/app/routes/redirect/$target/via-beforeLoad.tsx b/e2e/react-start/basic/src/routes/redirect/$target/via-beforeLoad.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/redirect/$target/via-beforeLoad.tsx
rename to e2e/react-start/basic/src/routes/redirect/$target/via-beforeLoad.tsx
diff --git a/e2e/react-start/basic/app/routes/redirect/$target/via-loader.tsx b/e2e/react-start/basic/src/routes/redirect/$target/via-loader.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/redirect/$target/via-loader.tsx
rename to e2e/react-start/basic/src/routes/redirect/$target/via-loader.tsx
diff --git a/e2e/react-start/basic/app/routes/redirect/index.tsx b/e2e/react-start/basic/src/routes/redirect/index.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/redirect/index.tsx
rename to e2e/react-start/basic/src/routes/redirect/index.tsx
diff --git a/e2e/react-start/basic/app/routes/scripts.tsx b/e2e/react-start/basic/src/routes/scripts.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/scripts.tsx
rename to e2e/react-start/basic/src/routes/scripts.tsx
diff --git a/e2e/react-start/basic/app/routes/search-params.tsx b/e2e/react-start/basic/src/routes/search-params.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/search-params.tsx
rename to e2e/react-start/basic/src/routes/search-params.tsx
diff --git a/e2e/react-start/basic/app/routes/stream.tsx b/e2e/react-start/basic/src/routes/stream.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/stream.tsx
rename to e2e/react-start/basic/src/routes/stream.tsx
diff --git a/e2e/react-start/basic/app/routes/users.$userId.tsx b/e2e/react-start/basic/src/routes/users.$userId.tsx
similarity index 87%
rename from e2e/react-start/basic/app/routes/users.$userId.tsx
rename to e2e/react-start/basic/src/routes/users.$userId.tsx
index 1e2921411a..56f0a472da 100644
--- a/e2e/react-start/basic/app/routes/users.$userId.tsx
+++ b/e2e/react-start/basic/src/routes/users.$userId.tsx
@@ -2,9 +2,9 @@ import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import axios from 'redaxios'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import type { User } from '~/utils/users'
-import { DEPLOY_URL } from '~/utils/users'
-import { NotFound } from '~/components/NotFound'
+import type { User } from 'src/utils/users'
+import { DEPLOY_URL } from 'src/utils/users'
+import { NotFound } from 'src/components/NotFound'
export const Route = createFileRoute('/users/$userId')({
loader: async ({ params: { userId } }) => {
diff --git a/e2e/react-start/basic/app/routes/users.index.tsx b/e2e/react-start/basic/src/routes/users.index.tsx
similarity index 100%
rename from e2e/react-start/basic/app/routes/users.index.tsx
rename to e2e/react-start/basic/src/routes/users.index.tsx
diff --git a/e2e/react-start/basic/app/routes/users.tsx b/e2e/react-start/basic/src/routes/users.tsx
similarity index 93%
rename from e2e/react-start/basic/app/routes/users.tsx
rename to e2e/react-start/basic/src/routes/users.tsx
index 45e070657e..d4bdb8f53c 100644
--- a/e2e/react-start/basic/app/routes/users.tsx
+++ b/e2e/react-start/basic/src/routes/users.tsx
@@ -1,8 +1,8 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
import axios from 'redaxios'
-import type { User } from '~/utils/users'
-import { DEPLOY_URL } from '~/utils/users'
+import type { User } from 'src/utils/users'
+import { DEPLOY_URL } from 'src/utils/users'
export const Route = createFileRoute('/users')({
loader: async () => {
diff --git a/e2e/react-start/basic/app/styles/app.css b/e2e/react-start/basic/src/styles/app.css
similarity index 100%
rename from e2e/react-start/basic/app/styles/app.css
rename to e2e/react-start/basic/src/styles/app.css
diff --git a/e2e/react-start/basic/app/utils/posts.tsx b/e2e/react-start/basic/src/utils/posts.tsx
similarity index 100%
rename from e2e/react-start/basic/app/utils/posts.tsx
rename to e2e/react-start/basic/src/utils/posts.tsx
diff --git a/e2e/react-start/basic/app/utils/seo.ts b/e2e/react-start/basic/src/utils/seo.ts
similarity index 100%
rename from e2e/react-start/basic/app/utils/seo.ts
rename to e2e/react-start/basic/src/utils/seo.ts
diff --git a/e2e/react-start/basic/app/utils/users.tsx b/e2e/react-start/basic/src/utils/users.tsx
similarity index 100%
rename from e2e/react-start/basic/app/utils/users.tsx
rename to e2e/react-start/basic/src/utils/users.tsx
diff --git a/e2e/react-start/basic/tsconfig.json b/e2e/react-start/basic/tsconfig.json
index a6747faec5..23f12840c3 100644
--- a/e2e/react-start/basic/tsconfig.json
+++ b/e2e/react-start/basic/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/e2e/react-start/clerk-basic/app/components/DefaultCatchBoundary.tsx b/e2e/react-start/clerk-basic/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from e2e/react-start/clerk-basic/app/components/DefaultCatchBoundary.tsx
rename to e2e/react-start/clerk-basic/src/components/DefaultCatchBoundary.tsx
diff --git a/e2e/react-start/clerk-basic/app/components/NotFound.tsx b/e2e/react-start/clerk-basic/src/components/NotFound.tsx
similarity index 100%
rename from e2e/react-start/clerk-basic/app/components/NotFound.tsx
rename to e2e/react-start/clerk-basic/src/components/NotFound.tsx
diff --git a/e2e/react-start/clerk-basic/app/routeTree.gen.ts b/e2e/react-start/clerk-basic/src/routeTree.gen.ts
similarity index 100%
rename from e2e/react-start/clerk-basic/app/routeTree.gen.ts
rename to e2e/react-start/clerk-basic/src/routeTree.gen.ts
diff --git a/e2e/react-start/clerk-basic/app/router.tsx b/e2e/react-start/clerk-basic/src/router.tsx
similarity index 100%
rename from e2e/react-start/clerk-basic/app/router.tsx
rename to e2e/react-start/clerk-basic/src/router.tsx
diff --git a/e2e/react-start/clerk-basic/app/routes/__root.tsx b/e2e/react-start/clerk-basic/src/routes/__root.tsx
similarity index 95%
rename from e2e/react-start/clerk-basic/app/routes/__root.tsx
rename to e2e/react-start/clerk-basic/src/routes/__root.tsx
index 1773a381d0..0ad96f9375 100644
--- a/e2e/react-start/clerk-basic/app/routes/__root.tsx
+++ b/e2e/react-start/clerk-basic/src/routes/__root.tsx
@@ -18,8 +18,8 @@ import { createServerFn } from '@tanstack/react-start'
import * as React from 'react'
import { getAuth } from '@clerk/tanstack-start/server'
import { getWebRequest } from '@tanstack/react-start/server'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js'
-import { NotFound } from '~/components/NotFound.js'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary.js'
+import { NotFound } from 'src/components/NotFound.js'
import appCss from '~/styles/app.css?url'
const fetchClerkAuth = createServerFn({ method: 'GET' }).handler(async () => {
diff --git a/e2e/react-start/clerk-basic/app/routes/_authed.tsx b/e2e/react-start/clerk-basic/src/routes/_authed.tsx
similarity index 100%
rename from e2e/react-start/clerk-basic/app/routes/_authed.tsx
rename to e2e/react-start/clerk-basic/src/routes/_authed.tsx
diff --git a/e2e/react-start/basic-auth/app/routes/_authed/posts.$postId.tsx b/e2e/react-start/clerk-basic/src/routes/_authed/posts.$postId.tsx
similarity index 88%
rename from e2e/react-start/basic-auth/app/routes/_authed/posts.$postId.tsx
rename to e2e/react-start/clerk-basic/src/routes/_authed/posts.$postId.tsx
index 27296b9658..612394673b 100644
--- a/e2e/react-start/basic-auth/app/routes/_authed/posts.$postId.tsx
+++ b/e2e/react-start/clerk-basic/src/routes/_authed/posts.$postId.tsx
@@ -1,8 +1,8 @@
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from '~/components/NotFound.js'
-import { fetchPost } from '~/utils/posts.js'
+import { NotFound } from 'src/components/NotFound.js'
+import { fetchPost } from 'src/utils/posts.js'
export const Route = createFileRoute('/_authed/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/e2e/react-start/clerk-basic/app/routes/_authed/posts.index.tsx b/e2e/react-start/clerk-basic/src/routes/_authed/posts.index.tsx
similarity index 100%
rename from e2e/react-start/clerk-basic/app/routes/_authed/posts.index.tsx
rename to e2e/react-start/clerk-basic/src/routes/_authed/posts.index.tsx
diff --git a/e2e/react-start/clerk-basic/app/routes/_authed/posts.tsx b/e2e/react-start/clerk-basic/src/routes/_authed/posts.tsx
similarity index 95%
rename from e2e/react-start/clerk-basic/app/routes/_authed/posts.tsx
rename to e2e/react-start/clerk-basic/src/routes/_authed/posts.tsx
index c01f12c49a..d769f02b68 100644
--- a/e2e/react-start/clerk-basic/app/routes/_authed/posts.tsx
+++ b/e2e/react-start/clerk-basic/src/routes/_authed/posts.tsx
@@ -1,6 +1,6 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from '~/utils/posts.js'
+import { fetchPosts } from 'src/utils/posts.js'
export const Route = createFileRoute('/_authed/posts')({
loader: () => fetchPosts(),
diff --git a/e2e/react-start/clerk-basic/app/routes/_authed/profile.$.tsx b/e2e/react-start/clerk-basic/src/routes/_authed/profile.$.tsx
similarity index 95%
rename from e2e/react-start/clerk-basic/app/routes/_authed/profile.$.tsx
rename to e2e/react-start/clerk-basic/src/routes/_authed/profile.$.tsx
index 1e5a8b1429..892d3a7fd9 100644
--- a/e2e/react-start/clerk-basic/app/routes/_authed/profile.$.tsx
+++ b/e2e/react-start/clerk-basic/src/routes/_authed/profile.$.tsx
@@ -1,6 +1,6 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from '~/utils/posts.js'
+import { fetchPosts } from 'src/utils/posts.js'
export const Route = createFileRoute('/_authed/profile/$')({
loader: () => fetchPosts(),
diff --git a/e2e/react-start/clerk-basic/app/routes/index.tsx b/e2e/react-start/clerk-basic/src/routes/index.tsx
similarity index 100%
rename from e2e/react-start/clerk-basic/app/routes/index.tsx
rename to e2e/react-start/clerk-basic/src/routes/index.tsx
diff --git a/e2e/react-start/clerk-basic/app/server.tsx b/e2e/react-start/clerk-basic/src/server.tsx
similarity index 100%
rename from e2e/react-start/clerk-basic/app/server.tsx
rename to e2e/react-start/clerk-basic/src/server.tsx
diff --git a/e2e/react-start/clerk-basic/app/styles/app.css b/e2e/react-start/clerk-basic/src/styles/app.css
similarity index 100%
rename from e2e/react-start/clerk-basic/app/styles/app.css
rename to e2e/react-start/clerk-basic/src/styles/app.css
diff --git a/e2e/react-start/clerk-basic/app/utils/posts.ts b/e2e/react-start/clerk-basic/src/utils/posts.ts
similarity index 100%
rename from e2e/react-start/clerk-basic/app/utils/posts.ts
rename to e2e/react-start/clerk-basic/src/utils/posts.ts
diff --git a/e2e/react-start/clerk-basic/app/utils/seo.ts b/e2e/react-start/clerk-basic/src/utils/seo.ts
similarity index 100%
rename from e2e/react-start/clerk-basic/app/utils/seo.ts
rename to e2e/react-start/clerk-basic/src/utils/seo.ts
diff --git a/e2e/react-start/clerk-basic/tsconfig.json b/e2e/react-start/clerk-basic/tsconfig.json
index d1b5b77660..9a7cf62c30 100644
--- a/e2e/react-start/clerk-basic/tsconfig.json
+++ b/e2e/react-start/clerk-basic/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/e2e/react-start/scroll-restoration/app/api.ts b/e2e/react-start/scroll-restoration/src/api.ts
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/api.ts
rename to e2e/react-start/scroll-restoration/src/api.ts
diff --git a/e2e/react-start/scroll-restoration/app/components/DefaultCatchBoundary.tsx b/e2e/react-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/components/DefaultCatchBoundary.tsx
rename to e2e/react-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx
diff --git a/e2e/react-start/scroll-restoration/app/components/NotFound.tsx b/e2e/react-start/scroll-restoration/src/components/NotFound.tsx
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/components/NotFound.tsx
rename to e2e/react-start/scroll-restoration/src/components/NotFound.tsx
diff --git a/e2e/react-start/scroll-restoration/app/routeTree.gen.ts b/e2e/react-start/scroll-restoration/src/routeTree.gen.ts
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/routeTree.gen.ts
rename to e2e/react-start/scroll-restoration/src/routeTree.gen.ts
diff --git a/e2e/react-start/scroll-restoration/app/router.tsx b/e2e/react-start/scroll-restoration/src/router.tsx
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/router.tsx
rename to e2e/react-start/scroll-restoration/src/router.tsx
diff --git a/e2e/react-start/scroll-restoration/app/routes/(tests)/normal-page.tsx b/e2e/react-start/scroll-restoration/src/routes/(tests)/normal-page.tsx
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/routes/(tests)/normal-page.tsx
rename to e2e/react-start/scroll-restoration/src/routes/(tests)/normal-page.tsx
diff --git a/e2e/react-start/scroll-restoration/app/routes/(tests)/with-loader.tsx b/e2e/react-start/scroll-restoration/src/routes/(tests)/with-loader.tsx
similarity index 91%
rename from e2e/react-start/scroll-restoration/app/routes/(tests)/with-loader.tsx
rename to e2e/react-start/scroll-restoration/src/routes/(tests)/with-loader.tsx
index dfd4c7bf13..6a8a0bc545 100644
--- a/e2e/react-start/scroll-restoration/app/routes/(tests)/with-loader.tsx
+++ b/e2e/react-start/scroll-restoration/src/routes/(tests)/with-loader.tsx
@@ -1,6 +1,6 @@
import { createFileRoute } from '@tanstack/react-router'
import { ScrollBlock } from '../-components/scroll-block'
-import { sleep } from '~/utils/posts'
+import { sleep } from 'src/utils/posts'
export const Route = createFileRoute('/(tests)/with-loader')({
loader: async () => {
diff --git a/e2e/react-start/scroll-restoration/app/routes/(tests)/with-search.tsx b/e2e/react-start/scroll-restoration/src/routes/(tests)/with-search.tsx
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/routes/(tests)/with-search.tsx
rename to e2e/react-start/scroll-restoration/src/routes/(tests)/with-search.tsx
diff --git a/e2e/react-start/scroll-restoration/app/routes/-components/scroll-block.tsx b/e2e/react-start/scroll-restoration/src/routes/-components/scroll-block.tsx
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/routes/-components/scroll-block.tsx
rename to e2e/react-start/scroll-restoration/src/routes/-components/scroll-block.tsx
diff --git a/e2e/react-start/scroll-restoration/app/routes/__root.tsx b/e2e/react-start/scroll-restoration/src/routes/__root.tsx
similarity index 90%
rename from e2e/react-start/scroll-restoration/app/routes/__root.tsx
rename to e2e/react-start/scroll-restoration/src/routes/__root.tsx
index bf315e98ae..1628a4ab07 100644
--- a/e2e/react-start/scroll-restoration/app/routes/__root.tsx
+++ b/e2e/react-start/scroll-restoration/src/routes/__root.tsx
@@ -7,10 +7,11 @@ import {
HeadContent,
Scripts,
} from '@tanstack/react-router'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
-import { NotFound } from '~/components/NotFound'
+import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
+import { NotFound } from 'src/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from '~/utils/seo'
+import { seo } from 'src/utils/seo'
export const Route = createRootRoute({
head: () => ({
@@ -66,6 +67,7 @@ function RootComponent() {
return (
+
)
}
diff --git a/e2e/react-start/scroll-restoration/app/routes/index.tsx b/e2e/react-start/scroll-restoration/src/routes/index.tsx
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/routes/index.tsx
rename to e2e/react-start/scroll-restoration/src/routes/index.tsx
diff --git a/e2e/react-start/scroll-restoration/app/styles/app.css b/e2e/react-start/scroll-restoration/src/styles/app.css
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/styles/app.css
rename to e2e/react-start/scroll-restoration/src/styles/app.css
diff --git a/e2e/react-start/scroll-restoration/app/utils/posts.tsx b/e2e/react-start/scroll-restoration/src/utils/posts.tsx
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/utils/posts.tsx
rename to e2e/react-start/scroll-restoration/src/utils/posts.tsx
diff --git a/e2e/react-start/scroll-restoration/app/utils/seo.ts b/e2e/react-start/scroll-restoration/src/utils/seo.ts
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/utils/seo.ts
rename to e2e/react-start/scroll-restoration/src/utils/seo.ts
diff --git a/e2e/react-start/scroll-restoration/app/utils/users.tsx b/e2e/react-start/scroll-restoration/src/utils/users.tsx
similarity index 100%
rename from e2e/react-start/scroll-restoration/app/utils/users.tsx
rename to e2e/react-start/scroll-restoration/src/utils/users.tsx
diff --git a/e2e/react-start/scroll-restoration/tsconfig.json b/e2e/react-start/scroll-restoration/tsconfig.json
index a6747faec5..23f12840c3 100644
--- a/e2e/react-start/scroll-restoration/tsconfig.json
+++ b/e2e/react-start/scroll-restoration/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/e2e/react-start/server-functions/app/components/DefaultCatchBoundary.tsx b/e2e/react-start/server-functions/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/components/DefaultCatchBoundary.tsx
rename to e2e/react-start/server-functions/src/components/DefaultCatchBoundary.tsx
diff --git a/e2e/react-start/server-functions/app/components/NotFound.tsx b/e2e/react-start/server-functions/src/components/NotFound.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/components/NotFound.tsx
rename to e2e/react-start/server-functions/src/components/NotFound.tsx
diff --git a/e2e/react-start/server-functions/app/routeTree.gen.ts b/e2e/react-start/server-functions/src/routeTree.gen.ts
similarity index 100%
rename from e2e/react-start/server-functions/app/routeTree.gen.ts
rename to e2e/react-start/server-functions/src/routeTree.gen.ts
diff --git a/e2e/react-start/server-functions/app/router.tsx b/e2e/react-start/server-functions/src/router.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/router.tsx
rename to e2e/react-start/server-functions/src/router.tsx
diff --git a/e2e/react-start/server-functions/app/routes/__root.tsx b/e2e/react-start/server-functions/src/routes/__root.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/__root.tsx
rename to e2e/react-start/server-functions/src/routes/__root.tsx
diff --git a/e2e/react-start/server-functions/app/routes/abort-signal.tsx b/e2e/react-start/server-functions/src/routes/abort-signal.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/abort-signal.tsx
rename to e2e/react-start/server-functions/src/routes/abort-signal.tsx
diff --git a/e2e/react-start/server-functions/app/routes/consistent.tsx b/e2e/react-start/server-functions/src/routes/consistent.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/consistent.tsx
rename to e2e/react-start/server-functions/src/routes/consistent.tsx
diff --git a/e2e/react-start/server-functions/app/routes/cookies/index.tsx b/e2e/react-start/server-functions/src/routes/cookies/index.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/cookies/index.tsx
rename to e2e/react-start/server-functions/src/routes/cookies/index.tsx
diff --git a/e2e/react-start/server-functions/app/routes/cookies/set.tsx b/e2e/react-start/server-functions/src/routes/cookies/set.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/cookies/set.tsx
rename to e2e/react-start/server-functions/src/routes/cookies/set.tsx
diff --git a/e2e/react-start/server-functions/app/routes/dead-code-preserve.tsx b/e2e/react-start/server-functions/src/routes/dead-code-preserve.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/dead-code-preserve.tsx
rename to e2e/react-start/server-functions/src/routes/dead-code-preserve.tsx
diff --git a/e2e/react-start/server-functions/app/routes/env-only.tsx b/e2e/react-start/server-functions/src/routes/env-only.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/env-only.tsx
rename to e2e/react-start/server-functions/src/routes/env-only.tsx
diff --git a/e2e/react-start/server-functions/app/routes/headers.tsx b/e2e/react-start/server-functions/src/routes/headers.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/headers.tsx
rename to e2e/react-start/server-functions/src/routes/headers.tsx
diff --git a/e2e/react-start/server-functions/app/routes/index.tsx b/e2e/react-start/server-functions/src/routes/index.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/index.tsx
rename to e2e/react-start/server-functions/src/routes/index.tsx
diff --git a/e2e/react-start/server-functions/app/routes/isomorphic-fns.tsx b/e2e/react-start/server-functions/src/routes/isomorphic-fns.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/isomorphic-fns.tsx
rename to e2e/react-start/server-functions/src/routes/isomorphic-fns.tsx
diff --git a/e2e/react-start/server-functions/app/routes/multipart.tsx b/e2e/react-start/server-functions/src/routes/multipart.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/multipart.tsx
rename to e2e/react-start/server-functions/src/routes/multipart.tsx
diff --git a/e2e/react-start/server-functions/app/routes/raw-response.tsx b/e2e/react-start/server-functions/src/routes/raw-response.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/raw-response.tsx
rename to e2e/react-start/server-functions/src/routes/raw-response.tsx
diff --git a/e2e/react-start/server-functions/app/routes/return-null.tsx b/e2e/react-start/server-functions/src/routes/return-null.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/return-null.tsx
rename to e2e/react-start/server-functions/src/routes/return-null.tsx
diff --git a/e2e/react-start/server-functions/app/routes/serialize-form-data.tsx b/e2e/react-start/server-functions/src/routes/serialize-form-data.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/serialize-form-data.tsx
rename to e2e/react-start/server-functions/src/routes/serialize-form-data.tsx
diff --git a/e2e/react-start/server-functions/app/routes/status.tsx b/e2e/react-start/server-functions/src/routes/status.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/status.tsx
rename to e2e/react-start/server-functions/src/routes/status.tsx
diff --git a/e2e/react-start/server-functions/app/routes/submit-post-formdata.tsx b/e2e/react-start/server-functions/src/routes/submit-post-formdata.tsx
similarity index 100%
rename from e2e/react-start/server-functions/app/routes/submit-post-formdata.tsx
rename to e2e/react-start/server-functions/src/routes/submit-post-formdata.tsx
diff --git a/e2e/react-start/server-functions/app/styles/app.css b/e2e/react-start/server-functions/src/styles/app.css
similarity index 100%
rename from e2e/react-start/server-functions/app/styles/app.css
rename to e2e/react-start/server-functions/src/styles/app.css
diff --git a/examples/solid/start-bare/app/client.tsx b/e2e/solid-start/basic-tsr-config/src/client.tsx
similarity index 83%
rename from examples/solid/start-bare/app/client.tsx
rename to e2e/solid-start/basic-tsr-config/src/client.tsx
index ba0f02fac0..04f043feee 100644
--- a/examples/solid/start-bare/app/client.tsx
+++ b/e2e/solid-start/basic-tsr-config/src/client.tsx
@@ -1,7 +1,7 @@
///
import { hydrate } from 'solid-js/web'
import { StartClient } from '@tanstack/solid-start'
-import { createRouter } from './router'
+import { createRouter } from './app/router'
const router = createRouter()
diff --git a/e2e/solid-start/basic-tsr-config/src/app/routeTree.gen.ts b/e2e/solid-start/basic-tsr-config/src/routeTree.gen.ts
similarity index 96%
rename from e2e/solid-start/basic-tsr-config/src/app/routeTree.gen.ts
rename to e2e/solid-start/basic-tsr-config/src/routeTree.gen.ts
index c260510053..7214e0cd01 100644
--- a/e2e/solid-start/basic-tsr-config/src/app/routeTree.gen.ts
+++ b/e2e/solid-start/basic-tsr-config/src/routeTree.gen.ts
@@ -11,7 +11,7 @@
// Import Routes
import { Route as rootRoute } from './routes/__root'
-import { Route as IndexImport } from './routes/index'
+import { Route as IndexImport } from './app/routes/index'
// Create/Update Routes
diff --git a/e2e/solid-start/basic-tsr-config/src/app/router.tsx b/e2e/solid-start/basic-tsr-config/src/router.tsx
similarity index 87%
rename from e2e/solid-start/basic-tsr-config/src/app/router.tsx
rename to e2e/solid-start/basic-tsr-config/src/router.tsx
index e230377cb1..768813ab82 100644
--- a/e2e/solid-start/basic-tsr-config/src/app/router.tsx
+++ b/e2e/solid-start/basic-tsr-config/src/router.tsx
@@ -1,5 +1,5 @@
import { createRouter as createTanStackRouter } from '@tanstack/solid-router'
-import { routeTree } from './routeTree.gen'
+import { routeTree } from './app/routeTree.gen'
export function createRouter() {
const router = createTanStackRouter({
diff --git a/e2e/solid-start/basic-tsr-config/src/app/routes/__root.tsx b/e2e/solid-start/basic-tsr-config/src/routes/__root.tsx
similarity index 100%
rename from e2e/solid-start/basic-tsr-config/src/app/routes/__root.tsx
rename to e2e/solid-start/basic-tsr-config/src/routes/__root.tsx
diff --git a/e2e/solid-start/basic-tsr-config/src/app/routes/index.tsx b/e2e/solid-start/basic-tsr-config/src/routes/index.tsx
similarity index 100%
rename from e2e/solid-start/basic-tsr-config/src/app/routes/index.tsx
rename to e2e/solid-start/basic-tsr-config/src/routes/index.tsx
diff --git a/e2e/solid-start/website/app/ssr.tsx b/e2e/solid-start/basic-tsr-config/src/ssr.tsx
similarity index 87%
rename from e2e/solid-start/website/app/ssr.tsx
rename to e2e/solid-start/basic-tsr-config/src/ssr.tsx
index ebd14c8120..db95139de1 100644
--- a/e2e/solid-start/website/app/ssr.tsx
+++ b/e2e/solid-start/basic-tsr-config/src/ssr.tsx
@@ -5,7 +5,7 @@ import {
} from '@tanstack/solid-start/server'
import { getRouterManifest } from '@tanstack/solid-start/router-manifest'
-import { createRouter } from './router'
+import { createRouter } from './app/router'
export default createStartHandler({
createRouter,
diff --git a/e2e/solid-start/scroll-restoration/app/api.ts b/e2e/solid-start/scroll-restoration/src/api.ts
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/api.ts
rename to e2e/solid-start/scroll-restoration/src/api.ts
diff --git a/e2e/solid-start/basic-tsr-config/src/app/client.tsx b/e2e/solid-start/scroll-restoration/src/client.tsx
similarity index 100%
rename from e2e/solid-start/basic-tsr-config/src/app/client.tsx
rename to e2e/solid-start/scroll-restoration/src/client.tsx
diff --git a/e2e/solid-start/scroll-restoration/app/components/DefaultCatchBoundary.tsx b/e2e/solid-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/components/DefaultCatchBoundary.tsx
rename to e2e/solid-start/scroll-restoration/src/components/DefaultCatchBoundary.tsx
diff --git a/e2e/solid-start/scroll-restoration/app/components/NotFound.tsx b/e2e/solid-start/scroll-restoration/src/components/NotFound.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/components/NotFound.tsx
rename to e2e/solid-start/scroll-restoration/src/components/NotFound.tsx
diff --git a/e2e/solid-start/scroll-restoration/app/routeTree.gen.ts b/e2e/solid-start/scroll-restoration/src/routeTree.gen.ts
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/routeTree.gen.ts
rename to e2e/solid-start/scroll-restoration/src/routeTree.gen.ts
diff --git a/e2e/solid-start/scroll-restoration/app/router.tsx b/e2e/solid-start/scroll-restoration/src/router.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/router.tsx
rename to e2e/solid-start/scroll-restoration/src/router.tsx
diff --git a/e2e/solid-start/scroll-restoration/app/routes/(tests)/normal-page.tsx b/e2e/solid-start/scroll-restoration/src/routes/(tests)/normal-page.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/routes/(tests)/normal-page.tsx
rename to e2e/solid-start/scroll-restoration/src/routes/(tests)/normal-page.tsx
diff --git a/e2e/solid-start/scroll-restoration/app/routes/(tests)/with-loader.tsx b/e2e/solid-start/scroll-restoration/src/routes/(tests)/with-loader.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/routes/(tests)/with-loader.tsx
rename to e2e/solid-start/scroll-restoration/src/routes/(tests)/with-loader.tsx
diff --git a/e2e/solid-start/scroll-restoration/app/routes/(tests)/with-search.tsx b/e2e/solid-start/scroll-restoration/src/routes/(tests)/with-search.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/routes/(tests)/with-search.tsx
rename to e2e/solid-start/scroll-restoration/src/routes/(tests)/with-search.tsx
diff --git a/e2e/solid-start/scroll-restoration/app/routes/-components/scroll-block.tsx b/e2e/solid-start/scroll-restoration/src/routes/-components/scroll-block.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/routes/-components/scroll-block.tsx
rename to e2e/solid-start/scroll-restoration/src/routes/-components/scroll-block.tsx
diff --git a/e2e/solid-start/scroll-restoration/app/routes/__root.tsx b/e2e/solid-start/scroll-restoration/src/routes/__root.tsx
similarity index 93%
rename from e2e/solid-start/scroll-restoration/app/routes/__root.tsx
rename to e2e/solid-start/scroll-restoration/src/routes/__root.tsx
index 5907fa6ecd..72e2c59c9e 100644
--- a/e2e/solid-start/scroll-restoration/app/routes/__root.tsx
+++ b/e2e/solid-start/scroll-restoration/src/routes/__root.tsx
@@ -7,10 +7,10 @@ import {
HeadContent,
Scripts,
} from '@tanstack/solid-router'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
-import { NotFound } from '~/components/NotFound'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
+import { NotFound } from 'src/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from '~/utils/seo'
+import { seo } from 'src/utils/seo'
import { Dynamic } from 'solid-js/web'
import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
diff --git a/e2e/solid-start/scroll-restoration/app/routes/index.tsx b/e2e/solid-start/scroll-restoration/src/routes/index.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/routes/index.tsx
rename to e2e/solid-start/scroll-restoration/src/routes/index.tsx
diff --git a/e2e/solid-start/scroll-restoration/app/ssr.tsx b/e2e/solid-start/scroll-restoration/src/ssr.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/ssr.tsx
rename to e2e/solid-start/scroll-restoration/src/ssr.tsx
diff --git a/e2e/solid-start/scroll-restoration/app/styles/app.css b/e2e/solid-start/scroll-restoration/src/styles/app.css
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/styles/app.css
rename to e2e/solid-start/scroll-restoration/src/styles/app.css
diff --git a/e2e/solid-start/scroll-restoration/app/utils/posts.tsx b/e2e/solid-start/scroll-restoration/src/utils/posts.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/utils/posts.tsx
rename to e2e/solid-start/scroll-restoration/src/utils/posts.tsx
diff --git a/e2e/solid-start/scroll-restoration/app/utils/seo.ts b/e2e/solid-start/scroll-restoration/src/utils/seo.ts
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/utils/seo.ts
rename to e2e/solid-start/scroll-restoration/src/utils/seo.ts
diff --git a/e2e/solid-start/scroll-restoration/app/utils/users.tsx b/e2e/solid-start/scroll-restoration/src/utils/users.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/utils/users.tsx
rename to e2e/solid-start/scroll-restoration/src/utils/users.tsx
diff --git a/e2e/solid-start/scroll-restoration/tsconfig.json b/e2e/solid-start/scroll-restoration/tsconfig.json
index 73e4856648..3f2c37eff4 100644
--- a/e2e/solid-start/scroll-restoration/tsconfig.json
+++ b/e2e/solid-start/scroll-restoration/tsconfig.json
@@ -16,7 +16,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/e2e/solid-start/scroll-restoration/app/client.tsx b/e2e/solid-start/server-functions/src/client.tsx
similarity index 100%
rename from e2e/solid-start/scroll-restoration/app/client.tsx
rename to e2e/solid-start/server-functions/src/client.tsx
diff --git a/e2e/solid-start/server-functions/app/components/DefaultCatchBoundary.tsx b/e2e/solid-start/server-functions/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/components/DefaultCatchBoundary.tsx
rename to e2e/solid-start/server-functions/src/components/DefaultCatchBoundary.tsx
diff --git a/e2e/solid-start/server-functions/app/components/NotFound.tsx b/e2e/solid-start/server-functions/src/components/NotFound.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/components/NotFound.tsx
rename to e2e/solid-start/server-functions/src/components/NotFound.tsx
diff --git a/e2e/solid-start/server-functions/app/routeTree.gen.ts b/e2e/solid-start/server-functions/src/routeTree.gen.ts
similarity index 100%
rename from e2e/solid-start/server-functions/app/routeTree.gen.ts
rename to e2e/solid-start/server-functions/src/routeTree.gen.ts
diff --git a/e2e/solid-start/server-functions/app/router.tsx b/e2e/solid-start/server-functions/src/router.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/router.tsx
rename to e2e/solid-start/server-functions/src/router.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/__root.tsx b/e2e/solid-start/server-functions/src/routes/__root.tsx
similarity index 85%
rename from e2e/solid-start/server-functions/app/routes/__root.tsx
rename to e2e/solid-start/server-functions/src/routes/__root.tsx
index 52d64bf7a7..6c801f97ad 100644
--- a/e2e/solid-start/server-functions/app/routes/__root.tsx
+++ b/e2e/solid-start/server-functions/src/routes/__root.tsx
@@ -1,7 +1,7 @@
import { Outlet, createRootRoute } from '@tanstack/solid-router'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
-import { NotFound } from '~/components/NotFound'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
+import { NotFound } from 'src/components/NotFound'
import appCss from '~/styles/app.css?url'
import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
diff --git a/e2e/solid-start/server-functions/app/routes/abort-signal.tsx b/e2e/solid-start/server-functions/src/routes/abort-signal.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/abort-signal.tsx
rename to e2e/solid-start/server-functions/src/routes/abort-signal.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/consistent.tsx b/e2e/solid-start/server-functions/src/routes/consistent.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/consistent.tsx
rename to e2e/solid-start/server-functions/src/routes/consistent.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/cookies/index.tsx b/e2e/solid-start/server-functions/src/routes/cookies/index.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/cookies/index.tsx
rename to e2e/solid-start/server-functions/src/routes/cookies/index.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/cookies/set.tsx b/e2e/solid-start/server-functions/src/routes/cookies/set.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/cookies/set.tsx
rename to e2e/solid-start/server-functions/src/routes/cookies/set.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/dead-code-preserve.tsx b/e2e/solid-start/server-functions/src/routes/dead-code-preserve.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/dead-code-preserve.tsx
rename to e2e/solid-start/server-functions/src/routes/dead-code-preserve.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/env-only.tsx b/e2e/solid-start/server-functions/src/routes/env-only.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/env-only.tsx
rename to e2e/solid-start/server-functions/src/routes/env-only.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/headers.tsx b/e2e/solid-start/server-functions/src/routes/headers.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/headers.tsx
rename to e2e/solid-start/server-functions/src/routes/headers.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/index.tsx b/e2e/solid-start/server-functions/src/routes/index.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/index.tsx
rename to e2e/solid-start/server-functions/src/routes/index.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/isomorphic-fns.tsx b/e2e/solid-start/server-functions/src/routes/isomorphic-fns.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/isomorphic-fns.tsx
rename to e2e/solid-start/server-functions/src/routes/isomorphic-fns.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/multipart.tsx b/e2e/solid-start/server-functions/src/routes/multipart.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/multipart.tsx
rename to e2e/solid-start/server-functions/src/routes/multipart.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/raw-response.tsx b/e2e/solid-start/server-functions/src/routes/raw-response.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/raw-response.tsx
rename to e2e/solid-start/server-functions/src/routes/raw-response.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/return-null.tsx b/e2e/solid-start/server-functions/src/routes/return-null.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/return-null.tsx
rename to e2e/solid-start/server-functions/src/routes/return-null.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/serialize-form-data.tsx b/e2e/solid-start/server-functions/src/routes/serialize-form-data.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/serialize-form-data.tsx
rename to e2e/solid-start/server-functions/src/routes/serialize-form-data.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/status.tsx b/e2e/solid-start/server-functions/src/routes/status.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/status.tsx
rename to e2e/solid-start/server-functions/src/routes/status.tsx
diff --git a/e2e/solid-start/server-functions/app/routes/submit-post-formdata.tsx b/e2e/solid-start/server-functions/src/routes/submit-post-formdata.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/routes/submit-post-formdata.tsx
rename to e2e/solid-start/server-functions/src/routes/submit-post-formdata.tsx
diff --git a/e2e/solid-start/server-functions/app/ssr.tsx b/e2e/solid-start/server-functions/src/ssr.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/ssr.tsx
rename to e2e/solid-start/server-functions/src/ssr.tsx
diff --git a/e2e/solid-start/server-functions/app/styles/app.css b/e2e/solid-start/server-functions/src/styles/app.css
similarity index 100%
rename from e2e/solid-start/server-functions/app/styles/app.css
rename to e2e/solid-start/server-functions/src/styles/app.css
diff --git a/e2e/solid-start/server-functions/tsconfig.json b/e2e/solid-start/server-functions/tsconfig.json
index 7340ddd786..0dec3591e0 100644
--- a/e2e/solid-start/server-functions/tsconfig.json
+++ b/e2e/solid-start/server-functions/tsconfig.json
@@ -16,7 +16,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": "",
"paths": {
- "~/*": ["app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/e2e/solid-start/server-functions/app/client.tsx b/e2e/solid-start/website/src/client.tsx
similarity index 100%
rename from e2e/solid-start/server-functions/app/client.tsx
rename to e2e/solid-start/website/src/client.tsx
diff --git a/e2e/solid-start/website/app/components/DefaultCatchBoundary.tsx b/e2e/solid-start/website/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from e2e/solid-start/website/app/components/DefaultCatchBoundary.tsx
rename to e2e/solid-start/website/src/components/DefaultCatchBoundary.tsx
diff --git a/e2e/solid-start/website/app/components/NotFound.tsx b/e2e/solid-start/website/src/components/NotFound.tsx
similarity index 100%
rename from e2e/solid-start/website/app/components/NotFound.tsx
rename to e2e/solid-start/website/src/components/NotFound.tsx
diff --git a/e2e/solid-start/website/app/routeTree.gen.ts b/e2e/solid-start/website/src/routeTree.gen.ts
similarity index 100%
rename from e2e/solid-start/website/app/routeTree.gen.ts
rename to e2e/solid-start/website/src/routeTree.gen.ts
diff --git a/e2e/solid-start/website/app/router.tsx b/e2e/solid-start/website/src/router.tsx
similarity index 100%
rename from e2e/solid-start/website/app/router.tsx
rename to e2e/solid-start/website/src/router.tsx
diff --git a/e2e/solid-start/website/app/routes/$project.$version.docs.framework.$framework.$.tsx b/e2e/solid-start/website/src/routes/$project.$version.docs.framework.$framework.$.tsx
similarity index 100%
rename from e2e/solid-start/website/app/routes/$project.$version.docs.framework.$framework.$.tsx
rename to e2e/solid-start/website/src/routes/$project.$version.docs.framework.$framework.$.tsx
diff --git a/e2e/solid-start/website/app/routes/$project.$version.docs.framework.$framework.examples.$.tsx b/e2e/solid-start/website/src/routes/$project.$version.docs.framework.$framework.examples.$.tsx
similarity index 100%
rename from e2e/solid-start/website/app/routes/$project.$version.docs.framework.$framework.examples.$.tsx
rename to e2e/solid-start/website/src/routes/$project.$version.docs.framework.$framework.examples.$.tsx
diff --git a/e2e/solid-start/website/app/routes/$project.$version.docs.framework.$framework.index.tsx b/e2e/solid-start/website/src/routes/$project.$version.docs.framework.$framework.index.tsx
similarity index 100%
rename from e2e/solid-start/website/app/routes/$project.$version.docs.framework.$framework.index.tsx
rename to e2e/solid-start/website/src/routes/$project.$version.docs.framework.$framework.index.tsx
diff --git a/e2e/solid-start/website/app/routes/$project.$version.docs.framework.$framework.tsx b/e2e/solid-start/website/src/routes/$project.$version.docs.framework.$framework.tsx
similarity index 100%
rename from e2e/solid-start/website/app/routes/$project.$version.docs.framework.$framework.tsx
rename to e2e/solid-start/website/src/routes/$project.$version.docs.framework.$framework.tsx
diff --git a/e2e/solid-start/website/app/routes/$project.$version.docs.index.tsx b/e2e/solid-start/website/src/routes/$project.$version.docs.index.tsx
similarity index 100%
rename from e2e/solid-start/website/app/routes/$project.$version.docs.index.tsx
rename to e2e/solid-start/website/src/routes/$project.$version.docs.index.tsx
diff --git a/e2e/solid-start/website/app/routes/$project.index.tsx b/e2e/solid-start/website/src/routes/$project.index.tsx
similarity index 100%
rename from e2e/solid-start/website/app/routes/$project.index.tsx
rename to e2e/solid-start/website/src/routes/$project.index.tsx
diff --git a/e2e/solid-start/website/app/routes/__root.tsx b/e2e/solid-start/website/src/routes/__root.tsx
similarity index 93%
rename from e2e/solid-start/website/app/routes/__root.tsx
rename to e2e/solid-start/website/src/routes/__root.tsx
index d33148818f..b232d1f84a 100644
--- a/e2e/solid-start/website/app/routes/__root.tsx
+++ b/e2e/solid-start/website/src/routes/__root.tsx
@@ -1,8 +1,8 @@
import { Outlet, createRootRoute } from '@tanstack/solid-router'
-import { NotFound } from '~/components/NotFound'
+import { NotFound } from 'src/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from '~/utils/seo'
import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
+import { seo } from 'src/utils/seo'
export const Route = createRootRoute({
head: () => ({
diff --git a/e2e/solid-start/website/app/routes/_library.$project.$version.index.tsx b/e2e/solid-start/website/src/routes/_library.$project.$version.index.tsx
similarity index 100%
rename from e2e/solid-start/website/app/routes/_library.$project.$version.index.tsx
rename to e2e/solid-start/website/src/routes/_library.$project.$version.index.tsx
diff --git a/e2e/solid-start/website/app/routes/_library.$project.tsx b/e2e/solid-start/website/src/routes/_library.$project.tsx
similarity index 81%
rename from e2e/solid-start/website/app/routes/_library.$project.tsx
rename to e2e/solid-start/website/src/routes/_library.$project.tsx
index 6fdcb8e530..97e161065e 100644
--- a/e2e/solid-start/website/app/routes/_library.$project.tsx
+++ b/e2e/solid-start/website/src/routes/_library.$project.tsx
@@ -1,6 +1,6 @@
import { Outlet, createFileRoute } from '@tanstack/solid-router'
-import { getProject } from '~/server/projects'
-import { seo } from '~/utils/seo'
+import { getProject } from 'src/server/projects'
+import { seo } from 'src/utils/seo'
export const Route = createFileRoute('/_library/$project')({
loader: ({ params: { project } }) => getProject({ data: project }),
diff --git a/e2e/solid-start/website/app/routes/_library.index.tsx b/e2e/solid-start/website/src/routes/_library.index.tsx
similarity index 100%
rename from e2e/solid-start/website/app/routes/_library.index.tsx
rename to e2e/solid-start/website/src/routes/_library.index.tsx
diff --git a/e2e/solid-start/website/app/routes/_library.tsx b/e2e/solid-start/website/src/routes/_library.tsx
similarity index 96%
rename from e2e/solid-start/website/app/routes/_library.tsx
rename to e2e/solid-start/website/src/routes/_library.tsx
index c25ae5cfe1..3b1a7a406e 100644
--- a/e2e/solid-start/website/app/routes/_library.tsx
+++ b/e2e/solid-start/website/src/routes/_library.tsx
@@ -4,7 +4,7 @@ import {
createFileRoute,
useLocation,
} from '@tanstack/solid-router'
-import { getProjects } from '~/server/projects'
+import { getProjects } from 'src/server/projects'
export const Route = createFileRoute('/_library')({
loader: async () => {
diff --git a/e2e/solid-start/website/app/server/document.tsx b/e2e/solid-start/website/src/server/document.tsx
similarity index 100%
rename from e2e/solid-start/website/app/server/document.tsx
rename to e2e/solid-start/website/src/server/document.tsx
diff --git a/e2e/solid-start/website/app/server/projects.tsx b/e2e/solid-start/website/src/server/projects.tsx
similarity index 100%
rename from e2e/solid-start/website/app/server/projects.tsx
rename to e2e/solid-start/website/src/server/projects.tsx
diff --git a/e2e/solid-start/basic-tsr-config/src/app/ssr.tsx b/e2e/solid-start/website/src/ssr.tsx
similarity index 100%
rename from e2e/solid-start/basic-tsr-config/src/app/ssr.tsx
rename to e2e/solid-start/website/src/ssr.tsx
diff --git a/e2e/solid-start/website/app/styles/app.css b/e2e/solid-start/website/src/styles/app.css
similarity index 100%
rename from e2e/solid-start/website/app/styles/app.css
rename to e2e/solid-start/website/src/styles/app.css
diff --git a/e2e/solid-start/website/app/utils/seo.ts b/e2e/solid-start/website/src/utils/seo.ts
similarity index 100%
rename from e2e/solid-start/website/app/utils/seo.ts
rename to e2e/solid-start/website/src/utils/seo.ts
diff --git a/e2e/solid-start/website/tsconfig.json b/e2e/solid-start/website/tsconfig.json
index 86fe6d2cf5..8a61265d19 100644
--- a/e2e/solid-start/website/tsconfig.json
+++ b/e2e/solid-start/website/tsconfig.json
@@ -16,7 +16,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/examples/react/start-bare/app/api.ts b/examples/react/start-bare/src/api.ts
similarity index 100%
rename from examples/react/start-bare/app/api.ts
rename to examples/react/start-bare/src/api.ts
diff --git a/examples/react/start-bare/app/components/Counter.css b/examples/react/start-bare/src/components/Counter.css
similarity index 100%
rename from examples/react/start-bare/app/components/Counter.css
rename to examples/react/start-bare/src/components/Counter.css
diff --git a/examples/react/start-bare/app/components/Counter.tsx b/examples/react/start-bare/src/components/Counter.tsx
similarity index 100%
rename from examples/react/start-bare/app/components/Counter.tsx
rename to examples/react/start-bare/src/components/Counter.tsx
diff --git a/examples/react/start-bare/app/routeTree.gen.ts b/examples/react/start-bare/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-bare/app/routeTree.gen.ts
rename to examples/react/start-bare/src/routeTree.gen.ts
diff --git a/examples/react/start-bare/app/router.tsx b/examples/react/start-bare/src/router.tsx
similarity index 100%
rename from examples/react/start-bare/app/router.tsx
rename to examples/react/start-bare/src/router.tsx
diff --git a/examples/react/start-bare/app/routes/__root.tsx b/examples/react/start-bare/src/routes/__root.tsx
similarity index 100%
rename from examples/react/start-bare/app/routes/__root.tsx
rename to examples/react/start-bare/src/routes/__root.tsx
diff --git a/examples/react/start-bare/app/routes/about.tsx b/examples/react/start-bare/src/routes/about.tsx
similarity index 100%
rename from examples/react/start-bare/app/routes/about.tsx
rename to examples/react/start-bare/src/routes/about.tsx
diff --git a/examples/react/start-bare/app/routes/index.tsx b/examples/react/start-bare/src/routes/index.tsx
similarity index 86%
rename from examples/react/start-bare/app/routes/index.tsx
rename to examples/react/start-bare/src/routes/index.tsx
index e9de615dc9..934654e3b8 100644
--- a/examples/react/start-bare/app/routes/index.tsx
+++ b/examples/react/start-bare/src/routes/index.tsx
@@ -1,5 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'
-import Counter from '~/components/Counter'
+import Counter from 'src/components/Counter'
export const Route = createFileRoute('/')({
component: RouteComponent,
})
diff --git a/examples/react/start-bare/app/styles/app.css b/examples/react/start-bare/src/styles/app.css
similarity index 100%
rename from examples/react/start-bare/app/styles/app.css
rename to examples/react/start-bare/src/styles/app.css
diff --git a/examples/react/start-bare/tsconfig.json b/examples/react/start-bare/tsconfig.json
index a6747faec5..23f12840c3 100644
--- a/examples/react/start-bare/tsconfig.json
+++ b/examples/react/start-bare/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/examples/react/start-basic-auth/app/components/Auth.tsx b/examples/react/start-basic-auth/src/components/Auth.tsx
similarity index 100%
rename from examples/react/start-basic-auth/app/components/Auth.tsx
rename to examples/react/start-basic-auth/src/components/Auth.tsx
diff --git a/examples/react/start-basic-auth/app/components/DefaultCatchBoundary.tsx b/examples/react/start-basic-auth/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from examples/react/start-basic-auth/app/components/DefaultCatchBoundary.tsx
rename to examples/react/start-basic-auth/src/components/DefaultCatchBoundary.tsx
diff --git a/examples/react/start-basic-auth/app/components/Login.tsx b/examples/react/start-basic-auth/src/components/Login.tsx
similarity index 97%
rename from examples/react/start-basic-auth/app/components/Login.tsx
rename to examples/react/start-basic-auth/src/components/Login.tsx
index b6b6da0c37..9ba6b8f019 100644
--- a/examples/react/start-basic-auth/app/components/Login.tsx
+++ b/examples/react/start-basic-auth/src/components/Login.tsx
@@ -3,7 +3,7 @@ import { useServerFn } from '@tanstack/react-start'
import { useMutation } from '../hooks/useMutation'
import { loginFn } from '../routes/_authed'
import { Auth } from './Auth'
-import { signupFn } from '~/routes/signup'
+import { signupFn } from 'src/routes/signup'
export function Login() {
const router = useRouter()
diff --git a/examples/react/start-basic-auth/app/components/NotFound.tsx b/examples/react/start-basic-auth/src/components/NotFound.tsx
similarity index 100%
rename from examples/react/start-basic-auth/app/components/NotFound.tsx
rename to examples/react/start-basic-auth/src/components/NotFound.tsx
diff --git a/examples/react/start-basic-auth/app/hooks/useMutation.ts b/examples/react/start-basic-auth/src/hooks/useMutation.ts
similarity index 100%
rename from examples/react/start-basic-auth/app/hooks/useMutation.ts
rename to examples/react/start-basic-auth/src/hooks/useMutation.ts
diff --git a/examples/react/start-basic-auth/app/routeTree.gen.ts b/examples/react/start-basic-auth/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-basic-auth/app/routeTree.gen.ts
rename to examples/react/start-basic-auth/src/routeTree.gen.ts
diff --git a/examples/react/start-basic-auth/app/router.tsx b/examples/react/start-basic-auth/src/router.tsx
similarity index 100%
rename from examples/react/start-basic-auth/app/router.tsx
rename to examples/react/start-basic-auth/src/router.tsx
diff --git a/examples/react/start-basic-auth/app/routes/__root.tsx b/examples/react/start-basic-auth/src/routes/__root.tsx
similarity index 93%
rename from examples/react/start-basic-auth/app/routes/__root.tsx
rename to examples/react/start-basic-auth/src/routes/__root.tsx
index 187cb0dc24..e286ac3499 100644
--- a/examples/react/start-basic-auth/app/routes/__root.tsx
+++ b/examples/react/start-basic-auth/src/routes/__root.tsx
@@ -8,11 +8,11 @@ import {
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import { createServerFn } from '@tanstack/react-start'
import * as React from 'react'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js'
-import { NotFound } from '~/components/NotFound.js'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary.js'
+import { NotFound } from 'src/components/NotFound.js'
import appCss from '~/styles/app.css?url'
-import { seo } from '~/utils/seo.js'
-import { useAppSession } from '~/utils/session.js'
+import { seo } from 'src/utils/seo.js'
+import { useAppSession } from 'src/utils/session.js'
const fetchUser = createServerFn({ method: 'GET' }).handler(async () => {
// We need to auth on the server so we have access to secure cookies
diff --git a/examples/react/start-basic-auth/app/routes/_authed.tsx b/examples/react/start-basic-auth/src/routes/_authed.tsx
similarity index 88%
rename from examples/react/start-basic-auth/app/routes/_authed.tsx
rename to examples/react/start-basic-auth/src/routes/_authed.tsx
index 0b1ae37317..183520c267 100644
--- a/examples/react/start-basic-auth/app/routes/_authed.tsx
+++ b/examples/react/start-basic-auth/src/routes/_authed.tsx
@@ -1,8 +1,8 @@
import { createFileRoute } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
-import { hashPassword, prismaClient } from '~/utils/prisma'
-import { Login } from '~/components/Login'
-import { useAppSession } from '~/utils/session'
+import { hashPassword, prismaClient } from 'src/utils/prisma'
+import { Login } from 'src/components/Login'
+import { useAppSession } from 'src/utils/session'
export const loginFn = createServerFn()
.validator((d) => d as { email: string; password: string })
diff --git a/examples/react/start-clerk-basic/app/routes/_authed/posts.$postId.tsx b/examples/react/start-basic-auth/src/routes/_authed/posts.$postId.tsx
similarity index 88%
rename from examples/react/start-clerk-basic/app/routes/_authed/posts.$postId.tsx
rename to examples/react/start-basic-auth/src/routes/_authed/posts.$postId.tsx
index 039271bb89..763ac98f14 100644
--- a/examples/react/start-clerk-basic/app/routes/_authed/posts.$postId.tsx
+++ b/examples/react/start-basic-auth/src/routes/_authed/posts.$postId.tsx
@@ -1,7 +1,7 @@
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from '~/components/NotFound.js'
-import { fetchPost } from '~/utils/posts.js'
+import { NotFound } from 'src/components/NotFound.js'
+import { fetchPost } from 'src/utils/posts.js'
export const Route = createFileRoute('/_authed/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/examples/react/start-basic-auth/app/routes/_authed/posts.index.tsx b/examples/react/start-basic-auth/src/routes/_authed/posts.index.tsx
similarity index 100%
rename from examples/react/start-basic-auth/app/routes/_authed/posts.index.tsx
rename to examples/react/start-basic-auth/src/routes/_authed/posts.index.tsx
diff --git a/examples/react/start-basic-auth/app/routes/_authed/posts.route.tsx b/examples/react/start-basic-auth/src/routes/_authed/posts.route.tsx
similarity index 95%
rename from examples/react/start-basic-auth/app/routes/_authed/posts.route.tsx
rename to examples/react/start-basic-auth/src/routes/_authed/posts.route.tsx
index 86c8ef4138..a3144ce55a 100644
--- a/examples/react/start-basic-auth/app/routes/_authed/posts.route.tsx
+++ b/examples/react/start-basic-auth/src/routes/_authed/posts.route.tsx
@@ -1,5 +1,5 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from '~/utils/posts.js'
+import { fetchPosts } from 'src/utils/posts.js'
export const Route = createFileRoute('/_authed/posts')({
loader: () => fetchPosts(),
diff --git a/examples/react/start-basic-auth/app/routes/index.tsx b/examples/react/start-basic-auth/src/routes/index.tsx
similarity index 100%
rename from examples/react/start-basic-auth/app/routes/index.tsx
rename to examples/react/start-basic-auth/src/routes/index.tsx
diff --git a/examples/react/start-basic-auth/app/routes/login.tsx b/examples/react/start-basic-auth/src/routes/login.tsx
similarity index 79%
rename from examples/react/start-basic-auth/app/routes/login.tsx
rename to examples/react/start-basic-auth/src/routes/login.tsx
index 03ced20832..4d06eaf91a 100644
--- a/examples/react/start-basic-auth/app/routes/login.tsx
+++ b/examples/react/start-basic-auth/src/routes/login.tsx
@@ -1,5 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'
-import { Login } from '~/components/Login'
+import { Login } from 'src/components/Login'
export const Route = createFileRoute('/login')({
component: LoginComp,
diff --git a/examples/react/start-basic-auth/app/routes/logout.tsx b/examples/react/start-basic-auth/src/routes/logout.tsx
similarity index 88%
rename from examples/react/start-basic-auth/app/routes/logout.tsx
rename to examples/react/start-basic-auth/src/routes/logout.tsx
index d072c25008..5bed47b3ed 100644
--- a/examples/react/start-basic-auth/app/routes/logout.tsx
+++ b/examples/react/start-basic-auth/src/routes/logout.tsx
@@ -1,6 +1,6 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
-import { useAppSession } from '~/utils/session'
+import { useAppSession } from 'src/utils/session'
const logoutFn = createServerFn().handler(async () => {
const session = await useAppSession()
diff --git a/examples/react/start-basic-auth/app/routes/signup.tsx b/examples/react/start-basic-auth/src/routes/signup.tsx
similarity index 91%
rename from examples/react/start-basic-auth/app/routes/signup.tsx
rename to examples/react/start-basic-auth/src/routes/signup.tsx
index 8895af0579..d22930060b 100644
--- a/examples/react/start-basic-auth/app/routes/signup.tsx
+++ b/examples/react/start-basic-auth/src/routes/signup.tsx
@@ -1,9 +1,9 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { createServerFn, useServerFn } from '@tanstack/react-start'
-import { hashPassword, prismaClient } from '~/utils/prisma'
-import { useMutation } from '~/hooks/useMutation'
-import { Auth } from '~/components/Auth'
-import { useAppSession } from '~/utils/session'
+import { hashPassword, prismaClient } from 'src/utils/prisma'
+import { useMutation } from 'src/hooks/useMutation'
+import { Auth } from 'src/components/Auth'
+import { useAppSession } from 'src/utils/session'
export const signupFn = createServerFn()
.validator(
diff --git a/examples/react/start-bare/app/server.ts b/examples/react/start-basic-auth/src/server.ts
similarity index 100%
rename from examples/react/start-bare/app/server.ts
rename to examples/react/start-basic-auth/src/server.ts
diff --git a/examples/react/start-basic-auth/app/styles/app.css b/examples/react/start-basic-auth/src/styles/app.css
similarity index 100%
rename from examples/react/start-basic-auth/app/styles/app.css
rename to examples/react/start-basic-auth/src/styles/app.css
diff --git a/examples/react/start-basic-auth/app/utils/posts.ts b/examples/react/start-basic-auth/src/utils/posts.ts
similarity index 100%
rename from examples/react/start-basic-auth/app/utils/posts.ts
rename to examples/react/start-basic-auth/src/utils/posts.ts
diff --git a/examples/react/start-basic-auth/app/utils/prisma.ts b/examples/react/start-basic-auth/src/utils/prisma.ts
similarity index 100%
rename from examples/react/start-basic-auth/app/utils/prisma.ts
rename to examples/react/start-basic-auth/src/utils/prisma.ts
diff --git a/examples/react/start-basic-auth/app/utils/seo.ts b/examples/react/start-basic-auth/src/utils/seo.ts
similarity index 100%
rename from examples/react/start-basic-auth/app/utils/seo.ts
rename to examples/react/start-basic-auth/src/utils/seo.ts
diff --git a/examples/react/start-basic-auth/app/utils/session.ts b/examples/react/start-basic-auth/src/utils/session.ts
similarity index 100%
rename from examples/react/start-basic-auth/app/utils/session.ts
rename to examples/react/start-basic-auth/src/utils/session.ts
diff --git a/examples/react/start-basic-auth/tsconfig.json b/examples/react/start-basic-auth/tsconfig.json
index d1b5b77660..9a7cf62c30 100644
--- a/examples/react/start-basic-auth/tsconfig.json
+++ b/examples/react/start-basic-auth/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/examples/react/start-basic-react-query/app/api.ts b/examples/react/start-basic-react-query/src/api.ts
similarity index 100%
rename from examples/react/start-basic-react-query/app/api.ts
rename to examples/react/start-basic-react-query/src/api.ts
diff --git a/examples/react/start-basic-react-query/app/components/DefaultCatchBoundary.tsx b/examples/react/start-basic-react-query/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/components/DefaultCatchBoundary.tsx
rename to examples/react/start-basic-react-query/src/components/DefaultCatchBoundary.tsx
diff --git a/examples/react/start-basic-react-query/app/components/NotFound.tsx b/examples/react/start-basic-react-query/src/components/NotFound.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/components/NotFound.tsx
rename to examples/react/start-basic-react-query/src/components/NotFound.tsx
diff --git a/examples/react/start-basic-react-query/app/routeTree.gen.ts b/examples/react/start-basic-react-query/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-basic-react-query/app/routeTree.gen.ts
rename to examples/react/start-basic-react-query/src/routeTree.gen.ts
diff --git a/examples/react/start-basic-react-query/app/router.tsx b/examples/react/start-basic-react-query/src/router.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/router.tsx
rename to examples/react/start-basic-react-query/src/router.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/__root.tsx b/examples/react/start-basic-react-query/src/routes/__root.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/__root.tsx
rename to examples/react/start-basic-react-query/src/routes/__root.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/_pathlessLayout.tsx b/examples/react/start-basic-react-query/src/routes/_pathlessLayout.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/_pathlessLayout.tsx
rename to examples/react/start-basic-react-query/src/routes/_pathlessLayout.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/_pathlessLayout/_nested-layout.tsx b/examples/react/start-basic-react-query/src/routes/_pathlessLayout/_nested-layout.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/_pathlessLayout/_nested-layout.tsx
rename to examples/react/start-basic-react-query/src/routes/_pathlessLayout/_nested-layout.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/_pathlessLayout/_nested-layout/route-a.tsx b/examples/react/start-basic-react-query/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/_pathlessLayout/_nested-layout/route-a.tsx
rename to examples/react/start-basic-react-query/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/_pathlessLayout/_nested-layout/route-b.tsx b/examples/react/start-basic-react-query/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/_pathlessLayout/_nested-layout/route-b.tsx
rename to examples/react/start-basic-react-query/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/api.users.ts b/examples/react/start-basic-react-query/src/routes/api.users.ts
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/api.users.ts
rename to examples/react/start-basic-react-query/src/routes/api.users.ts
diff --git a/examples/react/start-basic-react-query/app/routes/api/users.$id.ts b/examples/react/start-basic-react-query/src/routes/api/users.$id.ts
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/api/users.$id.ts
rename to examples/react/start-basic-react-query/src/routes/api/users.$id.ts
diff --git a/examples/react/start-basic-react-query/app/routes/deferred.tsx b/examples/react/start-basic-react-query/src/routes/deferred.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/deferred.tsx
rename to examples/react/start-basic-react-query/src/routes/deferred.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/index.tsx b/examples/react/start-basic-react-query/src/routes/index.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/index.tsx
rename to examples/react/start-basic-react-query/src/routes/index.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/posts.$postId.tsx b/examples/react/start-basic-react-query/src/routes/posts.$postId.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/posts.$postId.tsx
rename to examples/react/start-basic-react-query/src/routes/posts.$postId.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/posts.index.tsx b/examples/react/start-basic-react-query/src/routes/posts.index.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/posts.index.tsx
rename to examples/react/start-basic-react-query/src/routes/posts.index.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/posts.route.tsx b/examples/react/start-basic-react-query/src/routes/posts.route.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/posts.route.tsx
rename to examples/react/start-basic-react-query/src/routes/posts.route.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/posts_.$postId.deep.tsx b/examples/react/start-basic-react-query/src/routes/posts_.$postId.deep.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/posts_.$postId.deep.tsx
rename to examples/react/start-basic-react-query/src/routes/posts_.$postId.deep.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/redirect.tsx b/examples/react/start-basic-react-query/src/routes/redirect.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/redirect.tsx
rename to examples/react/start-basic-react-query/src/routes/redirect.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/users.$userId.tsx b/examples/react/start-basic-react-query/src/routes/users.$userId.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/users.$userId.tsx
rename to examples/react/start-basic-react-query/src/routes/users.$userId.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/users.index.tsx b/examples/react/start-basic-react-query/src/routes/users.index.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/users.index.tsx
rename to examples/react/start-basic-react-query/src/routes/users.index.tsx
diff --git a/examples/react/start-basic-react-query/app/routes/users.route.tsx b/examples/react/start-basic-react-query/src/routes/users.route.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/routes/users.route.tsx
rename to examples/react/start-basic-react-query/src/routes/users.route.tsx
diff --git a/examples/react/start-basic-auth/app/server.ts b/examples/react/start-basic-react-query/src/server.ts
similarity index 100%
rename from examples/react/start-basic-auth/app/server.ts
rename to examples/react/start-basic-react-query/src/server.ts
diff --git a/examples/react/start-basic-react-query/app/styles/app.css b/examples/react/start-basic-react-query/src/styles/app.css
similarity index 100%
rename from examples/react/start-basic-react-query/app/styles/app.css
rename to examples/react/start-basic-react-query/src/styles/app.css
diff --git a/examples/react/start-basic-react-query/app/utils/posts.tsx b/examples/react/start-basic-react-query/src/utils/posts.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/utils/posts.tsx
rename to examples/react/start-basic-react-query/src/utils/posts.tsx
diff --git a/examples/react/start-basic-react-query/app/utils/seo.ts b/examples/react/start-basic-react-query/src/utils/seo.ts
similarity index 100%
rename from examples/react/start-basic-react-query/app/utils/seo.ts
rename to examples/react/start-basic-react-query/src/utils/seo.ts
diff --git a/examples/react/start-basic-react-query/app/utils/users.tsx b/examples/react/start-basic-react-query/src/utils/users.tsx
similarity index 100%
rename from examples/react/start-basic-react-query/app/utils/users.tsx
rename to examples/react/start-basic-react-query/src/utils/users.tsx
diff --git a/examples/react/start-basic-rsc/app/components/DefaultCatchBoundary.tsx b/examples/react/start-basic-rsc/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/components/DefaultCatchBoundary.tsx
rename to examples/react/start-basic-rsc/src/components/DefaultCatchBoundary.tsx
diff --git a/examples/react/start-basic-rsc/app/components/NotFound.tsx b/examples/react/start-basic-rsc/src/components/NotFound.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/components/NotFound.tsx
rename to examples/react/start-basic-rsc/src/components/NotFound.tsx
diff --git a/examples/react/start-basic-rsc/app/routeTree.gen.ts b/examples/react/start-basic-rsc/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-basic-rsc/app/routeTree.gen.ts
rename to examples/react/start-basic-rsc/src/routeTree.gen.ts
diff --git a/examples/react/start-basic-rsc/app/router.tsx b/examples/react/start-basic-rsc/src/router.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/router.tsx
rename to examples/react/start-basic-rsc/src/router.tsx
diff --git a/examples/react/start-basic-rsc/app/routes/__root.tsx b/examples/react/start-basic-rsc/src/routes/__root.tsx
similarity index 94%
rename from examples/react/start-basic-rsc/app/routes/__root.tsx
rename to examples/react/start-basic-rsc/src/routes/__root.tsx
index 9d96f79ab3..137dea301c 100644
--- a/examples/react/start-basic-rsc/app/routes/__root.tsx
+++ b/examples/react/start-basic-rsc/src/routes/__root.tsx
@@ -7,10 +7,10 @@ import {
} from '@tanstack/react-router'
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import * as React from 'react'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
-import { NotFound } from '~/components/NotFound'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
+import { NotFound } from 'src/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from '~/utils/seo'
+import { seo } from 'src/utils/seo'
export const Route = createRootRoute({
head: () => ({
diff --git a/examples/react/start-basic-rsc/app/routes/_pathlessLayout.tsx b/examples/react/start-basic-rsc/src/routes/_pathlessLayout.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/routes/_pathlessLayout.tsx
rename to examples/react/start-basic-rsc/src/routes/_pathlessLayout.tsx
diff --git a/examples/react/start-basic-rsc/app/routes/_pathlessLayout/_nested-layout.tsx b/examples/react/start-basic-rsc/src/routes/_pathlessLayout/_nested-layout.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/routes/_pathlessLayout/_nested-layout.tsx
rename to examples/react/start-basic-rsc/src/routes/_pathlessLayout/_nested-layout.tsx
diff --git a/examples/react/start-basic-rsc/app/routes/_pathlessLayout/_nested-layout/route-a.tsx b/examples/react/start-basic-rsc/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/routes/_pathlessLayout/_nested-layout/route-a.tsx
rename to examples/react/start-basic-rsc/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
diff --git a/examples/react/start-basic-rsc/app/routes/_pathlessLayout/_nested-layout/route-b.tsx b/examples/react/start-basic-rsc/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/routes/_pathlessLayout/_nested-layout/route-b.tsx
rename to examples/react/start-basic-rsc/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
diff --git a/examples/react/start-basic-rsc/app/routes/index.tsx b/examples/react/start-basic-rsc/src/routes/index.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/routes/index.tsx
rename to examples/react/start-basic-rsc/src/routes/index.tsx
diff --git a/examples/react/start-basic-rsc/app/routes/posts.$postId.tsx b/examples/react/start-basic-rsc/src/routes/posts.$postId.tsx
similarity index 96%
rename from examples/react/start-basic-rsc/app/routes/posts.$postId.tsx
rename to examples/react/start-basic-rsc/src/routes/posts.$postId.tsx
index 5404a690a0..63a622a8e2 100644
--- a/examples/react/start-basic-rsc/app/routes/posts.$postId.tsx
+++ b/examples/react/start-basic-rsc/src/routes/posts.$postId.tsx
@@ -2,7 +2,7 @@ import { ErrorComponent, Link, createFileRoute } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
import { fetchPost } from '../utils/posts'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from '~/components/NotFound'
+import { NotFound } from 'src/components/NotFound'
const renderPost = createServerFn({ method: 'GET' })
.validator((postId: string) => postId)
diff --git a/examples/react/start-basic-rsc/app/routes/posts.index.tsx b/examples/react/start-basic-rsc/src/routes/posts.index.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/routes/posts.index.tsx
rename to examples/react/start-basic-rsc/src/routes/posts.index.tsx
diff --git a/examples/react/start-basic-rsc/app/routes/posts.tsx b/examples/react/start-basic-rsc/src/routes/posts.tsx
similarity index 88%
rename from examples/react/start-basic-rsc/app/routes/posts.tsx
rename to examples/react/start-basic-rsc/src/routes/posts.tsx
index a3ef2a2e20..5f544c568d 100644
--- a/examples/react/start-basic-rsc/app/routes/posts.tsx
+++ b/examples/react/start-basic-rsc/src/routes/posts.tsx
@@ -1,6 +1,6 @@
import { createFileRoute } from '@tanstack/react-router'
import { createServerFn, renderRsc } from '@tanstack/react-start'
-import { renderPosts } from '~/utils/renderPosts'
+import { renderPosts } from 'src/utils/renderPosts'
export const serverRenderPosts = createServerFn({ method: 'GET' }).handler(
renderPosts,
diff --git a/examples/react/start-basic-rsc/app/routes/posts_.$postId.deep.tsx b/examples/react/start-basic-rsc/src/routes/posts_.$postId.deep.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/routes/posts_.$postId.deep.tsx
rename to examples/react/start-basic-rsc/src/routes/posts_.$postId.deep.tsx
diff --git a/examples/react/start-basic-react-query/app/server.ts b/examples/react/start-basic-rsc/src/server.ts
similarity index 100%
rename from examples/react/start-basic-react-query/app/server.ts
rename to examples/react/start-basic-rsc/src/server.ts
diff --git a/examples/react/start-basic-rsc/app/styles/app.css b/examples/react/start-basic-rsc/src/styles/app.css
similarity index 100%
rename from examples/react/start-basic-rsc/app/styles/app.css
rename to examples/react/start-basic-rsc/src/styles/app.css
diff --git a/examples/react/start-basic-rsc/app/utils/posts.tsx b/examples/react/start-basic-rsc/src/utils/posts.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/utils/posts.tsx
rename to examples/react/start-basic-rsc/src/utils/posts.tsx
diff --git a/examples/react/start-basic-rsc/app/utils/renderPosts.tsx b/examples/react/start-basic-rsc/src/utils/renderPosts.tsx
similarity index 100%
rename from examples/react/start-basic-rsc/app/utils/renderPosts.tsx
rename to examples/react/start-basic-rsc/src/utils/renderPosts.tsx
diff --git a/examples/react/start-basic-rsc/app/utils/seo.ts b/examples/react/start-basic-rsc/src/utils/seo.ts
similarity index 100%
rename from examples/react/start-basic-rsc/app/utils/seo.ts
rename to examples/react/start-basic-rsc/src/utils/seo.ts
diff --git a/examples/react/start-basic-rsc/tsconfig.json b/examples/react/start-basic-rsc/tsconfig.json
index d1b5b77660..9a7cf62c30 100644
--- a/examples/react/start-basic-rsc/tsconfig.json
+++ b/examples/react/start-basic-rsc/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/examples/react/start-basic-static/app/routes/__root.tsx b/examples/react/start-basic-static/app/routes/__root.tsx
deleted file mode 100644
index 70140f2306..0000000000
--- a/examples/react/start-basic-static/app/routes/__root.tsx
+++ /dev/null
@@ -1,139 +0,0 @@
-import {
- HeadContent,
- Link,
- Outlet,
- Scripts,
- createRootRoute,
-} from '@tanstack/react-router'
-import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
-import * as React from 'react'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
-import { NotFound } from '~/components/NotFound'
-import appCss from '~/styles/app.css?url'
-import { seo } from '~/utils/seo'
-
-export const Route = createRootRoute({
- head: () => ({
- meta: [
- {
- charSet: 'utf-8',
- },
- {
- name: 'viewport',
- content: 'width=device-width, initial-scale=1',
- },
- ...seo({
- title:
- 'TanStack Start | Type-Safe, Client-First, Full-Stack React Framework',
- description: `TanStack Start is a type-safe, client-first, full-stack React framework. `,
- }),
- ],
- links: [
- { rel: 'stylesheet', href: appCss },
- {
- rel: 'apple-touch-icon',
- sizes: '180x180',
- href: '/apple-touch-icon.png',
- },
- {
- rel: 'icon',
- type: 'image/png',
- sizes: '32x32',
- href: '/favicon-32x32.png',
- },
- {
- rel: 'icon',
- type: 'image/png',
- sizes: '16x16',
- href: '/favicon-16x16.png',
- },
- { rel: 'manifest', href: '/site.webmanifest', color: '#fffff' },
- { rel: 'icon', href: '/favicon.ico' },
- ],
- }),
- errorComponent: (props) => {
- return (
-
-
-
- )
- },
- notFoundComponent: () => ,
- component: RootComponent,
-})
-
-function RootComponent() {
- return (
-
-
-
- )
-}
-
-function RootDocument({ children }: { children: React.ReactNode }) {
- return (
-
-
-
-
-
-
-
- Home
- {' '}
-
- Posts
- {' '}
-
- Users
- {' '}
-
- Pathless Layout
- {' '}
-
- Deferred
- {' '}
-
- This Route Does Not Exist
-
-
-
- {children}
-
-
-
-
- )
-}
diff --git a/examples/react/start-basic-static/app/components/DefaultCatchBoundary.tsx b/examples/react/start-basic-static/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/components/DefaultCatchBoundary.tsx
rename to examples/react/start-basic-static/src/components/DefaultCatchBoundary.tsx
diff --git a/examples/react/start-basic-static/app/components/NotFound.tsx b/examples/react/start-basic-static/src/components/NotFound.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/components/NotFound.tsx
rename to examples/react/start-basic-static/src/components/NotFound.tsx
diff --git a/examples/react/start-basic-static/app/routeTree.gen.ts b/examples/react/start-basic-static/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-basic-static/app/routeTree.gen.ts
rename to examples/react/start-basic-static/src/routeTree.gen.ts
diff --git a/examples/react/start-basic-static/app/router.tsx b/examples/react/start-basic-static/src/router.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/router.tsx
rename to examples/react/start-basic-static/src/router.tsx
diff --git a/examples/react/start-basic/app/routes/__root.tsx b/examples/react/start-basic-static/src/routes/__root.tsx
similarity index 95%
rename from examples/react/start-basic/app/routes/__root.tsx
rename to examples/react/start-basic-static/src/routes/__root.tsx
index 70140f2306..170fcca832 100644
--- a/examples/react/start-basic/app/routes/__root.tsx
+++ b/examples/react/start-basic-static/src/routes/__root.tsx
@@ -7,10 +7,10 @@ import {
} from '@tanstack/react-router'
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import * as React from 'react'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
-import { NotFound } from '~/components/NotFound'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
+import { NotFound } from 'src/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from '~/utils/seo'
+import { seo } from 'src/utils/seo'
export const Route = createRootRoute({
head: () => ({
diff --git a/examples/react/start-basic-static/app/routes/_pathlessLayout.tsx b/examples/react/start-basic-static/src/routes/_pathlessLayout.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/_pathlessLayout.tsx
rename to examples/react/start-basic-static/src/routes/_pathlessLayout.tsx
diff --git a/examples/react/start-basic-static/app/routes/_pathlessLayout/_nested-layout.tsx b/examples/react/start-basic-static/src/routes/_pathlessLayout/_nested-layout.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/_pathlessLayout/_nested-layout.tsx
rename to examples/react/start-basic-static/src/routes/_pathlessLayout/_nested-layout.tsx
diff --git a/examples/react/start-basic-static/app/routes/_pathlessLayout/_nested-layout/route-a.tsx b/examples/react/start-basic-static/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/_pathlessLayout/_nested-layout/route-a.tsx
rename to examples/react/start-basic-static/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
diff --git a/examples/react/start-basic-static/app/routes/_pathlessLayout/_nested-layout/route-b.tsx b/examples/react/start-basic-static/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/_pathlessLayout/_nested-layout/route-b.tsx
rename to examples/react/start-basic-static/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
diff --git a/examples/react/start-basic-static/app/routes/deferred.tsx b/examples/react/start-basic-static/src/routes/deferred.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/deferred.tsx
rename to examples/react/start-basic-static/src/routes/deferred.tsx
diff --git a/examples/react/start-basic-static/app/routes/index.tsx b/examples/react/start-basic-static/src/routes/index.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/index.tsx
rename to examples/react/start-basic-static/src/routes/index.tsx
diff --git a/examples/react/start-basic-static/app/routes/posts.$postId.tsx b/examples/react/start-basic-static/src/routes/posts.$postId.tsx
similarity index 95%
rename from examples/react/start-basic-static/app/routes/posts.$postId.tsx
rename to examples/react/start-basic-static/src/routes/posts.$postId.tsx
index 0d4d2de8eb..6a1f72bb07 100644
--- a/examples/react/start-basic-static/app/routes/posts.$postId.tsx
+++ b/examples/react/start-basic-static/src/routes/posts.$postId.tsx
@@ -1,7 +1,7 @@
import { ErrorComponent, Link, createFileRoute } from '@tanstack/react-router'
import { fetchPost } from '../utils/posts'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from '~/components/NotFound'
+import { NotFound } from 'src/components/NotFound'
export const Route = createFileRoute('/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/examples/react/start-basic-static/app/routes/posts.index.tsx b/examples/react/start-basic-static/src/routes/posts.index.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/posts.index.tsx
rename to examples/react/start-basic-static/src/routes/posts.index.tsx
diff --git a/examples/react/start-basic-static/app/routes/posts.tsx b/examples/react/start-basic-static/src/routes/posts.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/posts.tsx
rename to examples/react/start-basic-static/src/routes/posts.tsx
diff --git a/examples/react/start-basic-static/app/routes/posts_.$postId.deep.tsx b/examples/react/start-basic-static/src/routes/posts_.$postId.deep.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/posts_.$postId.deep.tsx
rename to examples/react/start-basic-static/src/routes/posts_.$postId.deep.tsx
diff --git a/examples/react/start-basic-static/app/routes/redirect.tsx b/examples/react/start-basic-static/src/routes/redirect.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/redirect.tsx
rename to examples/react/start-basic-static/src/routes/redirect.tsx
diff --git a/examples/react/start-basic-static/app/routes/users.$userId.tsx b/examples/react/start-basic-static/src/routes/users.$userId.tsx
similarity index 93%
rename from examples/react/start-basic-static/app/routes/users.$userId.tsx
rename to examples/react/start-basic-static/src/routes/users.$userId.tsx
index d166885e29..bbc21f1274 100644
--- a/examples/react/start-basic-static/app/routes/users.$userId.tsx
+++ b/examples/react/start-basic-static/src/routes/users.$userId.tsx
@@ -2,8 +2,8 @@ import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import axios from 'redaxios'
import { createServerFn } from '@tanstack/react-start'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import type { User } from '~/utils/users'
-import { NotFound } from '~/components/NotFound'
+import type { User } from 'src/utils/users'
+import { NotFound } from 'src/components/NotFound'
const fetchUser = createServerFn({ method: 'GET', type: 'static' })
.validator((d: string) => d)
diff --git a/examples/react/start-basic-static/app/routes/users.index.tsx b/examples/react/start-basic-static/src/routes/users.index.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/users.index.tsx
rename to examples/react/start-basic-static/src/routes/users.index.tsx
diff --git a/examples/react/start-basic-static/app/routes/users.tsx b/examples/react/start-basic-static/src/routes/users.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/routes/users.tsx
rename to examples/react/start-basic-static/src/routes/users.tsx
diff --git a/examples/react/start-basic-rsc/app/server.ts b/examples/react/start-basic-static/src/server.ts
similarity index 100%
rename from examples/react/start-basic-rsc/app/server.ts
rename to examples/react/start-basic-static/src/server.ts
diff --git a/examples/react/start-basic-static/app/styles/app.css b/examples/react/start-basic-static/src/styles/app.css
similarity index 100%
rename from examples/react/start-basic-static/app/styles/app.css
rename to examples/react/start-basic-static/src/styles/app.css
diff --git a/examples/react/start-basic-static/app/utils/loggingMiddleware.tsx b/examples/react/start-basic-static/src/utils/loggingMiddleware.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/utils/loggingMiddleware.tsx
rename to examples/react/start-basic-static/src/utils/loggingMiddleware.tsx
diff --git a/examples/react/start-basic-static/app/utils/posts.tsx b/examples/react/start-basic-static/src/utils/posts.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/utils/posts.tsx
rename to examples/react/start-basic-static/src/utils/posts.tsx
diff --git a/examples/react/start-basic-static/app/utils/seo.ts b/examples/react/start-basic-static/src/utils/seo.ts
similarity index 100%
rename from examples/react/start-basic-static/app/utils/seo.ts
rename to examples/react/start-basic-static/src/utils/seo.ts
diff --git a/examples/react/start-basic-static/app/utils/users.tsx b/examples/react/start-basic-static/src/utils/users.tsx
similarity index 100%
rename from examples/react/start-basic-static/app/utils/users.tsx
rename to examples/react/start-basic-static/src/utils/users.tsx
diff --git a/examples/react/start-basic-static/tsconfig.json b/examples/react/start-basic-static/tsconfig.json
index d1b5b77660..9a7cf62c30 100644
--- a/examples/react/start-basic-static/tsconfig.json
+++ b/examples/react/start-basic-static/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/examples/react/start-basic/app/routeTree.gen.ts b/examples/react/start-basic/app/routeTree.gen.ts
deleted file mode 100644
index 762ce1516f..0000000000
--- a/examples/react/start-basic/app/routeTree.gen.ts
+++ /dev/null
@@ -1,479 +0,0 @@
-/* eslint-disable */
-
-// @ts-nocheck
-
-// noinspection JSUnusedGlobalSymbols
-
-// This file was automatically generated by TanStack Router.
-// You should NOT make any changes in this file as it will be overwritten.
-// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
-
-// Import Routes
-
-import { Route as rootRoute } from './routes/__root'
-import { Route as UsersImport } from './routes/users'
-import { Route as RedirectImport } from './routes/redirect'
-import { Route as PostsImport } from './routes/posts'
-import { Route as DeferredImport } from './routes/deferred'
-import { Route as PathlessLayoutImport } from './routes/_pathlessLayout'
-import { Route as IndexImport } from './routes/index'
-import { Route as UsersIndexImport } from './routes/users.index'
-import { Route as PostsIndexImport } from './routes/posts.index'
-import { Route as UsersUserIdImport } from './routes/users.$userId'
-import { Route as PostsPostIdImport } from './routes/posts.$postId'
-import { Route as PathlessLayoutNestedLayoutImport } from './routes/_pathlessLayout/_nested-layout'
-import { Route as PostsPostIdDeepImport } from './routes/posts_.$postId.deep'
-import { Route as PathlessLayoutNestedLayoutRouteBImport } from './routes/_pathlessLayout/_nested-layout/route-b'
-import { Route as PathlessLayoutNestedLayoutRouteAImport } from './routes/_pathlessLayout/_nested-layout/route-a'
-
-// Create/Update Routes
-
-const UsersRoute = UsersImport.update({
- id: '/users',
- path: '/users',
- getParentRoute: () => rootRoute,
-} as any)
-
-const RedirectRoute = RedirectImport.update({
- id: '/redirect',
- path: '/redirect',
- getParentRoute: () => rootRoute,
-} as any)
-
-const PostsRoute = PostsImport.update({
- id: '/posts',
- path: '/posts',
- getParentRoute: () => rootRoute,
-} as any)
-
-const DeferredRoute = DeferredImport.update({
- id: '/deferred',
- path: '/deferred',
- getParentRoute: () => rootRoute,
-} as any)
-
-const PathlessLayoutRoute = PathlessLayoutImport.update({
- id: '/_pathlessLayout',
- getParentRoute: () => rootRoute,
-} as any)
-
-const IndexRoute = IndexImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => rootRoute,
-} as any)
-
-const UsersIndexRoute = UsersIndexImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => UsersRoute,
-} as any)
-
-const PostsIndexRoute = PostsIndexImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => PostsRoute,
-} as any)
-
-const UsersUserIdRoute = UsersUserIdImport.update({
- id: '/$userId',
- path: '/$userId',
- getParentRoute: () => UsersRoute,
-} as any)
-
-const PostsPostIdRoute = PostsPostIdImport.update({
- id: '/$postId',
- path: '/$postId',
- getParentRoute: () => PostsRoute,
-} as any)
-
-const PathlessLayoutNestedLayoutRoute = PathlessLayoutNestedLayoutImport.update(
- {
- id: '/_nested-layout',
- getParentRoute: () => PathlessLayoutRoute,
- } as any,
-)
-
-const PostsPostIdDeepRoute = PostsPostIdDeepImport.update({
- id: '/posts_/$postId/deep',
- path: '/posts/$postId/deep',
- getParentRoute: () => rootRoute,
-} as any)
-
-const PathlessLayoutNestedLayoutRouteBRoute =
- PathlessLayoutNestedLayoutRouteBImport.update({
- id: '/route-b',
- path: '/route-b',
- getParentRoute: () => PathlessLayoutNestedLayoutRoute,
- } as any)
-
-const PathlessLayoutNestedLayoutRouteARoute =
- PathlessLayoutNestedLayoutRouteAImport.update({
- id: '/route-a',
- path: '/route-a',
- getParentRoute: () => PathlessLayoutNestedLayoutRoute,
- } as any)
-
-// Populate the FileRoutesByPath interface
-
-declare module '@tanstack/react-router' {
- interface FileRoutesByPath {
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexImport
- parentRoute: typeof rootRoute
- }
- '/_pathlessLayout': {
- id: '/_pathlessLayout'
- path: ''
- fullPath: ''
- preLoaderRoute: typeof PathlessLayoutImport
- parentRoute: typeof rootRoute
- }
- '/deferred': {
- id: '/deferred'
- path: '/deferred'
- fullPath: '/deferred'
- preLoaderRoute: typeof DeferredImport
- parentRoute: typeof rootRoute
- }
- '/posts': {
- id: '/posts'
- path: '/posts'
- fullPath: '/posts'
- preLoaderRoute: typeof PostsImport
- parentRoute: typeof rootRoute
- }
- '/redirect': {
- id: '/redirect'
- path: '/redirect'
- fullPath: '/redirect'
- preLoaderRoute: typeof RedirectImport
- parentRoute: typeof rootRoute
- }
- '/users': {
- id: '/users'
- path: '/users'
- fullPath: '/users'
- preLoaderRoute: typeof UsersImport
- parentRoute: typeof rootRoute
- }
- '/_pathlessLayout/_nested-layout': {
- id: '/_pathlessLayout/_nested-layout'
- path: ''
- fullPath: ''
- preLoaderRoute: typeof PathlessLayoutNestedLayoutImport
- parentRoute: typeof PathlessLayoutImport
- }
- '/posts/$postId': {
- id: '/posts/$postId'
- path: '/$postId'
- fullPath: '/posts/$postId'
- preLoaderRoute: typeof PostsPostIdImport
- parentRoute: typeof PostsImport
- }
- '/users/$userId': {
- id: '/users/$userId'
- path: '/$userId'
- fullPath: '/users/$userId'
- preLoaderRoute: typeof UsersUserIdImport
- parentRoute: typeof UsersImport
- }
- '/posts/': {
- id: '/posts/'
- path: '/'
- fullPath: '/posts/'
- preLoaderRoute: typeof PostsIndexImport
- parentRoute: typeof PostsImport
- }
- '/users/': {
- id: '/users/'
- path: '/'
- fullPath: '/users/'
- preLoaderRoute: typeof UsersIndexImport
- parentRoute: typeof UsersImport
- }
- '/_pathlessLayout/_nested-layout/route-a': {
- id: '/_pathlessLayout/_nested-layout/route-a'
- path: '/route-a'
- fullPath: '/route-a'
- preLoaderRoute: typeof PathlessLayoutNestedLayoutRouteAImport
- parentRoute: typeof PathlessLayoutNestedLayoutImport
- }
- '/_pathlessLayout/_nested-layout/route-b': {
- id: '/_pathlessLayout/_nested-layout/route-b'
- path: '/route-b'
- fullPath: '/route-b'
- preLoaderRoute: typeof PathlessLayoutNestedLayoutRouteBImport
- parentRoute: typeof PathlessLayoutNestedLayoutImport
- }
- '/posts_/$postId/deep': {
- id: '/posts_/$postId/deep'
- path: '/posts/$postId/deep'
- fullPath: '/posts/$postId/deep'
- preLoaderRoute: typeof PostsPostIdDeepImport
- parentRoute: typeof rootRoute
- }
- }
-}
-
-// Create and export the route tree
-
-interface PathlessLayoutNestedLayoutRouteChildren {
- PathlessLayoutNestedLayoutRouteARoute: typeof PathlessLayoutNestedLayoutRouteARoute
- PathlessLayoutNestedLayoutRouteBRoute: typeof PathlessLayoutNestedLayoutRouteBRoute
-}
-
-const PathlessLayoutNestedLayoutRouteChildren: PathlessLayoutNestedLayoutRouteChildren =
- {
- PathlessLayoutNestedLayoutRouteARoute:
- PathlessLayoutNestedLayoutRouteARoute,
- PathlessLayoutNestedLayoutRouteBRoute:
- PathlessLayoutNestedLayoutRouteBRoute,
- }
-
-const PathlessLayoutNestedLayoutRouteWithChildren =
- PathlessLayoutNestedLayoutRoute._addFileChildren(
- PathlessLayoutNestedLayoutRouteChildren,
- )
-
-interface PathlessLayoutRouteChildren {
- PathlessLayoutNestedLayoutRoute: typeof PathlessLayoutNestedLayoutRouteWithChildren
-}
-
-const PathlessLayoutRouteChildren: PathlessLayoutRouteChildren = {
- PathlessLayoutNestedLayoutRoute: PathlessLayoutNestedLayoutRouteWithChildren,
-}
-
-const PathlessLayoutRouteWithChildren = PathlessLayoutRoute._addFileChildren(
- PathlessLayoutRouteChildren,
-)
-
-interface PostsRouteChildren {
- PostsPostIdRoute: typeof PostsPostIdRoute
- PostsIndexRoute: typeof PostsIndexRoute
-}
-
-const PostsRouteChildren: PostsRouteChildren = {
- PostsPostIdRoute: PostsPostIdRoute,
- PostsIndexRoute: PostsIndexRoute,
-}
-
-const PostsRouteWithChildren = PostsRoute._addFileChildren(PostsRouteChildren)
-
-interface UsersRouteChildren {
- UsersUserIdRoute: typeof UsersUserIdRoute
- UsersIndexRoute: typeof UsersIndexRoute
-}
-
-const UsersRouteChildren: UsersRouteChildren = {
- UsersUserIdRoute: UsersUserIdRoute,
- UsersIndexRoute: UsersIndexRoute,
-}
-
-const UsersRouteWithChildren = UsersRoute._addFileChildren(UsersRouteChildren)
-
-export interface FileRoutesByFullPath {
- '/': typeof IndexRoute
- '': typeof PathlessLayoutNestedLayoutRouteWithChildren
- '/deferred': typeof DeferredRoute
- '/posts': typeof PostsRouteWithChildren
- '/redirect': typeof RedirectRoute
- '/users': typeof UsersRouteWithChildren
- '/posts/$postId': typeof PostsPostIdRoute
- '/users/$userId': typeof UsersUserIdRoute
- '/posts/': typeof PostsIndexRoute
- '/users/': typeof UsersIndexRoute
- '/route-a': typeof PathlessLayoutNestedLayoutRouteARoute
- '/route-b': typeof PathlessLayoutNestedLayoutRouteBRoute
- '/posts/$postId/deep': typeof PostsPostIdDeepRoute
-}
-
-export interface FileRoutesByTo {
- '/': typeof IndexRoute
- '': typeof PathlessLayoutNestedLayoutRouteWithChildren
- '/deferred': typeof DeferredRoute
- '/redirect': typeof RedirectRoute
- '/posts/$postId': typeof PostsPostIdRoute
- '/users/$userId': typeof UsersUserIdRoute
- '/posts': typeof PostsIndexRoute
- '/users': typeof UsersIndexRoute
- '/route-a': typeof PathlessLayoutNestedLayoutRouteARoute
- '/route-b': typeof PathlessLayoutNestedLayoutRouteBRoute
- '/posts/$postId/deep': typeof PostsPostIdDeepRoute
-}
-
-export interface FileRoutesById {
- __root__: typeof rootRoute
- '/': typeof IndexRoute
- '/_pathlessLayout': typeof PathlessLayoutRouteWithChildren
- '/deferred': typeof DeferredRoute
- '/posts': typeof PostsRouteWithChildren
- '/redirect': typeof RedirectRoute
- '/users': typeof UsersRouteWithChildren
- '/_pathlessLayout/_nested-layout': typeof PathlessLayoutNestedLayoutRouteWithChildren
- '/posts/$postId': typeof PostsPostIdRoute
- '/users/$userId': typeof UsersUserIdRoute
- '/posts/': typeof PostsIndexRoute
- '/users/': typeof UsersIndexRoute
- '/_pathlessLayout/_nested-layout/route-a': typeof PathlessLayoutNestedLayoutRouteARoute
- '/_pathlessLayout/_nested-layout/route-b': typeof PathlessLayoutNestedLayoutRouteBRoute
- '/posts_/$postId/deep': typeof PostsPostIdDeepRoute
-}
-
-export interface FileRouteTypes {
- fileRoutesByFullPath: FileRoutesByFullPath
- fullPaths:
- | '/'
- | ''
- | '/deferred'
- | '/posts'
- | '/redirect'
- | '/users'
- | '/posts/$postId'
- | '/users/$userId'
- | '/posts/'
- | '/users/'
- | '/route-a'
- | '/route-b'
- | '/posts/$postId/deep'
- fileRoutesByTo: FileRoutesByTo
- to:
- | '/'
- | ''
- | '/deferred'
- | '/redirect'
- | '/posts/$postId'
- | '/users/$userId'
- | '/posts'
- | '/users'
- | '/route-a'
- | '/route-b'
- | '/posts/$postId/deep'
- id:
- | '__root__'
- | '/'
- | '/_pathlessLayout'
- | '/deferred'
- | '/posts'
- | '/redirect'
- | '/users'
- | '/_pathlessLayout/_nested-layout'
- | '/posts/$postId'
- | '/users/$userId'
- | '/posts/'
- | '/users/'
- | '/_pathlessLayout/_nested-layout/route-a'
- | '/_pathlessLayout/_nested-layout/route-b'
- | '/posts_/$postId/deep'
- fileRoutesById: FileRoutesById
-}
-
-export interface RootRouteChildren {
- IndexRoute: typeof IndexRoute
- PathlessLayoutRoute: typeof PathlessLayoutRouteWithChildren
- DeferredRoute: typeof DeferredRoute
- PostsRoute: typeof PostsRouteWithChildren
- RedirectRoute: typeof RedirectRoute
- UsersRoute: typeof UsersRouteWithChildren
- PostsPostIdDeepRoute: typeof PostsPostIdDeepRoute
-}
-
-const rootRouteChildren: RootRouteChildren = {
- IndexRoute: IndexRoute,
- PathlessLayoutRoute: PathlessLayoutRouteWithChildren,
- DeferredRoute: DeferredRoute,
- PostsRoute: PostsRouteWithChildren,
- RedirectRoute: RedirectRoute,
- UsersRoute: UsersRouteWithChildren,
- PostsPostIdDeepRoute: PostsPostIdDeepRoute,
-}
-
-export const routeTree = rootRoute
- ._addFileChildren(rootRouteChildren)
- ._addFileTypes()
-
-/* ROUTE_MANIFEST_START
-{
- "routes": {
- "__root__": {
- "filePath": "__root.tsx",
- "children": [
- "/",
- "/_pathlessLayout",
- "/deferred",
- "/posts",
- "/redirect",
- "/users",
- "/posts_/$postId/deep"
- ]
- },
- "/": {
- "filePath": "index.tsx"
- },
- "/_pathlessLayout": {
- "filePath": "_pathlessLayout.tsx",
- "children": [
- "/_pathlessLayout/_nested-layout"
- ]
- },
- "/deferred": {
- "filePath": "deferred.tsx"
- },
- "/posts": {
- "filePath": "posts.tsx",
- "children": [
- "/posts/$postId",
- "/posts/"
- ]
- },
- "/redirect": {
- "filePath": "redirect.tsx"
- },
- "/users": {
- "filePath": "users.tsx",
- "children": [
- "/users/$userId",
- "/users/"
- ]
- },
- "/_pathlessLayout/_nested-layout": {
- "filePath": "_pathlessLayout/_nested-layout.tsx",
- "parent": "/_pathlessLayout",
- "children": [
- "/_pathlessLayout/_nested-layout/route-a",
- "/_pathlessLayout/_nested-layout/route-b"
- ]
- },
- "/posts/$postId": {
- "filePath": "posts.$postId.tsx",
- "parent": "/posts"
- },
- "/users/$userId": {
- "filePath": "users.$userId.tsx",
- "parent": "/users"
- },
- "/posts/": {
- "filePath": "posts.index.tsx",
- "parent": "/posts"
- },
- "/users/": {
- "filePath": "users.index.tsx",
- "parent": "/users"
- },
- "/_pathlessLayout/_nested-layout/route-a": {
- "filePath": "_pathlessLayout/_nested-layout/route-a.tsx",
- "parent": "/_pathlessLayout/_nested-layout"
- },
- "/_pathlessLayout/_nested-layout/route-b": {
- "filePath": "_pathlessLayout/_nested-layout/route-b.tsx",
- "parent": "/_pathlessLayout/_nested-layout"
- },
- "/posts_/$postId/deep": {
- "filePath": "posts_.$postId.deep.tsx"
- }
- }
-}
-ROUTE_MANIFEST_END */
diff --git a/examples/react/start-basic/src/routeTree.gen.ts b/examples/react/start-basic/src/routeTree.gen.ts
index 9f7ab8107b..c7786de3e4 100644
--- a/examples/react/start-basic/src/routeTree.gen.ts
+++ b/examples/react/start-basic/src/routeTree.gen.ts
@@ -15,16 +15,19 @@ import { Route as UsersImport } from './routes/users'
import { Route as RedirectImport } from './routes/redirect'
import { Route as PostsImport } from './routes/posts'
import { Route as DeferredImport } from './routes/deferred'
+import { Route as PathlessLayoutImport } from './routes/_pathlessLayout'
import { Route as LayoutImport } from './routes/_layout'
+import { Route as UsersRouteImport } from './routes/users.route'
+import { Route as PostsRouteImport } from './routes/posts.route'
import { Route as IndexImport } from './routes/index'
import { Route as UsersIndexImport } from './routes/users.index'
import { Route as PostsIndexImport } from './routes/posts.index'
import { Route as UsersUserIdImport } from './routes/users.$userId'
import { Route as PostsPostIdImport } from './routes/posts.$postId'
-import { Route as LayoutLayout2Import } from './routes/_layout/_layout-2'
+import { Route as PathlessLayoutNestedLayoutImport } from './routes/_pathlessLayout/_nested-layout'
import { Route as PostsPostIdDeepImport } from './routes/posts_.$postId.deep'
-import { Route as LayoutLayout2LayoutBImport } from './routes/_layout/_layout-2/layout-b'
-import { Route as LayoutLayout2LayoutAImport } from './routes/_layout/_layout-2/layout-a'
+import { Route as PathlessLayoutNestedLayoutRouteBImport } from './routes/_pathlessLayout/_nested-layout/route-b'
+import { Route as PathlessLayoutNestedLayoutRouteAImport } from './routes/_pathlessLayout/_nested-layout/route-a'
// Create/Update Routes
@@ -52,11 +55,28 @@ const DeferredRoute = DeferredImport.update({
getParentRoute: () => rootRoute,
} as any)
+const PathlessLayoutRoute = PathlessLayoutImport.update({
+ id: '/_pathlessLayout',
+ getParentRoute: () => rootRoute,
+} as any)
+
const LayoutRoute = LayoutImport.update({
id: '/_layout',
getParentRoute: () => rootRoute,
} as any)
+const UsersRouteRoute = UsersRouteImport.update({
+ id: '/users',
+ path: '/users',
+ getParentRoute: () => rootRoute,
+} as any)
+
+const PostsRouteRoute = PostsRouteImport.update({
+ id: '/posts',
+ path: '/posts',
+ getParentRoute: () => rootRoute,
+} as any)
+
const IndexRoute = IndexImport.update({
id: '/',
path: '/',
@@ -87,10 +107,12 @@ const PostsPostIdRoute = PostsPostIdImport.update({
getParentRoute: () => PostsRoute,
} as any)
-const LayoutLayout2Route = LayoutLayout2Import.update({
- id: '/_layout-2',
- getParentRoute: () => LayoutRoute,
-} as any)
+const PathlessLayoutNestedLayoutRoute = PathlessLayoutNestedLayoutImport.update(
+ {
+ id: '/_nested-layout',
+ getParentRoute: () => PathlessLayoutRoute,
+ } as any,
+)
const PostsPostIdDeepRoute = PostsPostIdDeepImport.update({
id: '/posts_/$postId/deep',
@@ -98,17 +120,19 @@ const PostsPostIdDeepRoute = PostsPostIdDeepImport.update({
getParentRoute: () => rootRoute,
} as any)
-const LayoutLayout2LayoutBRoute = LayoutLayout2LayoutBImport.update({
- id: '/layout-b',
- path: '/layout-b',
- getParentRoute: () => LayoutLayout2Route,
-} as any)
+const PathlessLayoutNestedLayoutRouteBRoute =
+ PathlessLayoutNestedLayoutRouteBImport.update({
+ id: '/route-b',
+ path: '/route-b',
+ getParentRoute: () => PathlessLayoutNestedLayoutRoute,
+ } as any)
-const LayoutLayout2LayoutARoute = LayoutLayout2LayoutAImport.update({
- id: '/layout-a',
- path: '/layout-a',
- getParentRoute: () => LayoutLayout2Route,
-} as any)
+const PathlessLayoutNestedLayoutRouteARoute =
+ PathlessLayoutNestedLayoutRouteAImport.update({
+ id: '/route-a',
+ path: '/route-a',
+ getParentRoute: () => PathlessLayoutNestedLayoutRoute,
+ } as any)
// Populate the FileRoutesByPath interface
@@ -121,6 +145,20 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof IndexImport
parentRoute: typeof rootRoute
}
+ '/posts': {
+ id: '/posts'
+ path: '/posts'
+ fullPath: '/posts'
+ preLoaderRoute: typeof PostsRouteImport
+ parentRoute: typeof rootRoute
+ }
+ '/users': {
+ id: '/users'
+ path: '/users'
+ fullPath: '/users'
+ preLoaderRoute: typeof UsersRouteImport
+ parentRoute: typeof rootRoute
+ }
'/_layout': {
id: '/_layout'
path: ''
@@ -128,6 +166,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LayoutImport
parentRoute: typeof rootRoute
}
+ '/_pathlessLayout': {
+ id: '/_pathlessLayout'
+ path: ''
+ fullPath: ''
+ preLoaderRoute: typeof PathlessLayoutImport
+ parentRoute: typeof rootRoute
+ }
'/deferred': {
id: '/deferred'
path: '/deferred'
@@ -156,12 +201,12 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof UsersImport
parentRoute: typeof rootRoute
}
- '/_layout/_layout-2': {
- id: '/_layout/_layout-2'
+ '/_pathlessLayout/_nested-layout': {
+ id: '/_pathlessLayout/_nested-layout'
path: ''
fullPath: ''
- preLoaderRoute: typeof LayoutLayout2Import
- parentRoute: typeof LayoutImport
+ preLoaderRoute: typeof PathlessLayoutNestedLayoutImport
+ parentRoute: typeof PathlessLayoutImport
}
'/posts/$postId': {
id: '/posts/$postId'
@@ -191,19 +236,19 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof UsersIndexImport
parentRoute: typeof UsersImport
}
- '/_layout/_layout-2/layout-a': {
- id: '/_layout/_layout-2/layout-a'
- path: '/layout-a'
- fullPath: '/layout-a'
- preLoaderRoute: typeof LayoutLayout2LayoutAImport
- parentRoute: typeof LayoutLayout2Import
+ '/_pathlessLayout/_nested-layout/route-a': {
+ id: '/_pathlessLayout/_nested-layout/route-a'
+ path: '/route-a'
+ fullPath: '/route-a'
+ preLoaderRoute: typeof PathlessLayoutNestedLayoutRouteAImport
+ parentRoute: typeof PathlessLayoutNestedLayoutImport
}
- '/_layout/_layout-2/layout-b': {
- id: '/_layout/_layout-2/layout-b'
- path: '/layout-b'
- fullPath: '/layout-b'
- preLoaderRoute: typeof LayoutLayout2LayoutBImport
- parentRoute: typeof LayoutLayout2Import
+ '/_pathlessLayout/_nested-layout/route-b': {
+ id: '/_pathlessLayout/_nested-layout/route-b'
+ path: '/route-b'
+ fullPath: '/route-b'
+ preLoaderRoute: typeof PathlessLayoutNestedLayoutRouteBImport
+ parentRoute: typeof PathlessLayoutNestedLayoutImport
}
'/posts_/$postId/deep': {
id: '/posts_/$postId/deep'
@@ -217,30 +262,35 @@ declare module '@tanstack/react-router' {
// Create and export the route tree
-interface LayoutLayout2RouteChildren {
- LayoutLayout2LayoutARoute: typeof LayoutLayout2LayoutARoute
- LayoutLayout2LayoutBRoute: typeof LayoutLayout2LayoutBRoute
+interface PathlessLayoutNestedLayoutRouteChildren {
+ PathlessLayoutNestedLayoutRouteARoute: typeof PathlessLayoutNestedLayoutRouteARoute
+ PathlessLayoutNestedLayoutRouteBRoute: typeof PathlessLayoutNestedLayoutRouteBRoute
}
-const LayoutLayout2RouteChildren: LayoutLayout2RouteChildren = {
- LayoutLayout2LayoutARoute: LayoutLayout2LayoutARoute,
- LayoutLayout2LayoutBRoute: LayoutLayout2LayoutBRoute,
-}
+const PathlessLayoutNestedLayoutRouteChildren: PathlessLayoutNestedLayoutRouteChildren =
+ {
+ PathlessLayoutNestedLayoutRouteARoute:
+ PathlessLayoutNestedLayoutRouteARoute,
+ PathlessLayoutNestedLayoutRouteBRoute:
+ PathlessLayoutNestedLayoutRouteBRoute,
+ }
-const LayoutLayout2RouteWithChildren = LayoutLayout2Route._addFileChildren(
- LayoutLayout2RouteChildren,
-)
+const PathlessLayoutNestedLayoutRouteWithChildren =
+ PathlessLayoutNestedLayoutRoute._addFileChildren(
+ PathlessLayoutNestedLayoutRouteChildren,
+ )
-interface LayoutRouteChildren {
- LayoutLayout2Route: typeof LayoutLayout2RouteWithChildren
+interface PathlessLayoutRouteChildren {
+ PathlessLayoutNestedLayoutRoute: typeof PathlessLayoutNestedLayoutRouteWithChildren
}
-const LayoutRouteChildren: LayoutRouteChildren = {
- LayoutLayout2Route: LayoutLayout2RouteWithChildren,
+const PathlessLayoutRouteChildren: PathlessLayoutRouteChildren = {
+ PathlessLayoutNestedLayoutRoute: PathlessLayoutNestedLayoutRouteWithChildren,
}
-const LayoutRouteWithChildren =
- LayoutRoute._addFileChildren(LayoutRouteChildren)
+const PathlessLayoutRouteWithChildren = PathlessLayoutRoute._addFileChildren(
+ PathlessLayoutRouteChildren,
+)
interface PostsRouteChildren {
PostsPostIdRoute: typeof PostsPostIdRoute
@@ -268,49 +318,50 @@ const UsersRouteWithChildren = UsersRoute._addFileChildren(UsersRouteChildren)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
- '': typeof LayoutLayout2RouteWithChildren
- '/deferred': typeof DeferredRoute
'/posts': typeof PostsRouteWithChildren
- '/redirect': typeof RedirectRoute
'/users': typeof UsersRouteWithChildren
+ '': typeof PathlessLayoutNestedLayoutRouteWithChildren
+ '/deferred': typeof DeferredRoute
+ '/redirect': typeof RedirectRoute
'/posts/$postId': typeof PostsPostIdRoute
'/users/$userId': typeof UsersUserIdRoute
'/posts/': typeof PostsIndexRoute
'/users/': typeof UsersIndexRoute
- '/layout-a': typeof LayoutLayout2LayoutARoute
- '/layout-b': typeof LayoutLayout2LayoutBRoute
+ '/route-a': typeof PathlessLayoutNestedLayoutRouteARoute
+ '/route-b': typeof PathlessLayoutNestedLayoutRouteBRoute
'/posts/$postId/deep': typeof PostsPostIdDeepRoute
}
export interface FileRoutesByTo {
'/': typeof IndexRoute
- '': typeof LayoutLayout2RouteWithChildren
+ '/posts': typeof PostsIndexRoute
+ '/users': typeof UsersIndexRoute
+ '': typeof PathlessLayoutNestedLayoutRouteWithChildren
'/deferred': typeof DeferredRoute
'/redirect': typeof RedirectRoute
'/posts/$postId': typeof PostsPostIdRoute
'/users/$userId': typeof UsersUserIdRoute
- '/posts': typeof PostsIndexRoute
- '/users': typeof UsersIndexRoute
- '/layout-a': typeof LayoutLayout2LayoutARoute
- '/layout-b': typeof LayoutLayout2LayoutBRoute
+ '/route-a': typeof PathlessLayoutNestedLayoutRouteARoute
+ '/route-b': typeof PathlessLayoutNestedLayoutRouteBRoute
'/posts/$postId/deep': typeof PostsPostIdDeepRoute
}
export interface FileRoutesById {
__root__: typeof rootRoute
'/': typeof IndexRoute
- '/_layout': typeof LayoutRouteWithChildren
- '/deferred': typeof DeferredRoute
'/posts': typeof PostsRouteWithChildren
- '/redirect': typeof RedirectRoute
'/users': typeof UsersRouteWithChildren
- '/_layout/_layout-2': typeof LayoutLayout2RouteWithChildren
+ '/_layout': typeof LayoutRoute
+ '/_pathlessLayout': typeof PathlessLayoutRouteWithChildren
+ '/deferred': typeof DeferredRoute
+ '/redirect': typeof RedirectRoute
+ '/_pathlessLayout/_nested-layout': typeof PathlessLayoutNestedLayoutRouteWithChildren
'/posts/$postId': typeof PostsPostIdRoute
'/users/$userId': typeof UsersUserIdRoute
'/posts/': typeof PostsIndexRoute
'/users/': typeof UsersIndexRoute
- '/_layout/_layout-2/layout-a': typeof LayoutLayout2LayoutARoute
- '/_layout/_layout-2/layout-b': typeof LayoutLayout2LayoutBRoute
+ '/_pathlessLayout/_nested-layout/route-a': typeof PathlessLayoutNestedLayoutRouteARoute
+ '/_pathlessLayout/_nested-layout/route-b': typeof PathlessLayoutNestedLayoutRouteBRoute
'/posts_/$postId/deep': typeof PostsPostIdDeepRoute
}
@@ -318,53 +369,57 @@ export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths:
| '/'
+ | '/posts'
+ | '/users'
| ''
| '/deferred'
- | '/posts'
| '/redirect'
- | '/users'
| '/posts/$postId'
| '/users/$userId'
| '/posts/'
| '/users/'
- | '/layout-a'
- | '/layout-b'
+ | '/route-a'
+ | '/route-b'
| '/posts/$postId/deep'
fileRoutesByTo: FileRoutesByTo
to:
| '/'
+ | '/posts'
+ | '/users'
| ''
| '/deferred'
| '/redirect'
| '/posts/$postId'
| '/users/$userId'
- | '/posts'
- | '/users'
- | '/layout-a'
- | '/layout-b'
+ | '/route-a'
+ | '/route-b'
| '/posts/$postId/deep'
id:
| '__root__'
| '/'
+ | '/posts'
+ | '/users'
| '/_layout'
+ | '/_pathlessLayout'
| '/deferred'
- | '/posts'
| '/redirect'
- | '/users'
- | '/_layout/_layout-2'
+ | '/_pathlessLayout/_nested-layout'
| '/posts/$postId'
| '/users/$userId'
| '/posts/'
| '/users/'
- | '/_layout/_layout-2/layout-a'
- | '/_layout/_layout-2/layout-b'
+ | '/_pathlessLayout/_nested-layout/route-a'
+ | '/_pathlessLayout/_nested-layout/route-b'
| '/posts_/$postId/deep'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
- LayoutRoute: typeof LayoutRouteWithChildren
+ PostsRouteRoute: typeof PostsRouteRoute
+ UsersRouteRoute: typeof UsersRouteRoute
+ LayoutRoute: typeof LayoutRoute
+ PathlessLayoutRoute: typeof PathlessLayoutRouteWithChildren
DeferredRoute: typeof DeferredRoute
PostsRoute: typeof PostsRouteWithChildren
RedirectRoute: typeof RedirectRoute
@@ -374,7 +429,10 @@ export interface RootRouteChildren {
const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
- LayoutRoute: LayoutRouteWithChildren,
+ PostsRouteRoute: PostsRouteRoute,
+ UsersRouteRoute: UsersRouteRoute,
+ LayoutRoute: LayoutRoute,
+ PathlessLayoutRoute: PathlessLayoutRouteWithChildren,
DeferredRoute: DeferredRoute,
PostsRoute: PostsRouteWithChildren,
RedirectRoute: RedirectRoute,
@@ -393,7 +451,10 @@ export const routeTree = rootRoute
"filePath": "__root.tsx",
"children": [
"/",
+ "/posts",
+ "/users",
"/_layout",
+ "/_pathlessLayout",
"/deferred",
"/posts",
"/redirect",
@@ -404,15 +465,6 @@ export const routeTree = rootRoute
"/": {
"filePath": "index.tsx"
},
- "/_layout": {
- "filePath": "_layout.tsx",
- "children": [
- "/_layout/_layout-2"
- ]
- },
- "/deferred": {
- "filePath": "deferred.tsx"
- },
"/posts": {
"filePath": "posts.tsx",
"children": [
@@ -420,9 +472,6 @@ export const routeTree = rootRoute
"/posts/"
]
},
- "/redirect": {
- "filePath": "redirect.tsx"
- },
"/users": {
"filePath": "users.tsx",
"children": [
@@ -430,12 +479,27 @@ export const routeTree = rootRoute
"/users/"
]
},
- "/_layout/_layout-2": {
- "filePath": "_layout/_layout-2.tsx",
- "parent": "/_layout",
+ "/_layout": {
+ "filePath": "_layout.tsx"
+ },
+ "/_pathlessLayout": {
+ "filePath": "_pathlessLayout.tsx",
+ "children": [
+ "/_pathlessLayout/_nested-layout"
+ ]
+ },
+ "/deferred": {
+ "filePath": "deferred.tsx"
+ },
+ "/redirect": {
+ "filePath": "redirect.tsx"
+ },
+ "/_pathlessLayout/_nested-layout": {
+ "filePath": "_pathlessLayout/_nested-layout.tsx",
+ "parent": "/_pathlessLayout",
"children": [
- "/_layout/_layout-2/layout-a",
- "/_layout/_layout-2/layout-b"
+ "/_pathlessLayout/_nested-layout/route-a",
+ "/_pathlessLayout/_nested-layout/route-b"
]
},
"/posts/$postId": {
@@ -454,13 +518,13 @@ export const routeTree = rootRoute
"filePath": "users.index.tsx",
"parent": "/users"
},
- "/_layout/_layout-2/layout-a": {
- "filePath": "_layout/_layout-2/layout-a.tsx",
- "parent": "/_layout/_layout-2"
+ "/_pathlessLayout/_nested-layout/route-a": {
+ "filePath": "_pathlessLayout/_nested-layout/route-a.tsx",
+ "parent": "/_pathlessLayout/_nested-layout"
},
- "/_layout/_layout-2/layout-b": {
- "filePath": "_layout/_layout-2/layout-b.tsx",
- "parent": "/_layout/_layout-2"
+ "/_pathlessLayout/_nested-layout/route-b": {
+ "filePath": "_pathlessLayout/_nested-layout/route-b.tsx",
+ "parent": "/_pathlessLayout/_nested-layout"
},
"/posts_/$postId/deep": {
"filePath": "posts_.$postId.deep.tsx"
diff --git a/examples/react/start-basic/src/routes/__root.tsx b/examples/react/start-basic/src/routes/__root.tsx
index f6d8d8cf97..30f0a42b4c 100644
--- a/examples/react/start-basic/src/routes/__root.tsx
+++ b/examples/react/start-basic/src/routes/__root.tsx
@@ -7,10 +7,10 @@ import {
} from '@tanstack/react-router'
import { TanStackRouterDevtools } from '@tanstack/router-devtools'
import * as React from 'react'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
-import { NotFound } from 'src/components/NotFound'
-import { seo } from 'src/utils/seo'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
+import { NotFound } from '~/components/NotFound'
import appCss from '~/styles/app.css?url'
+import { seo } from '~/utils/seo'
export const Route = createRootRoute({
head: () => ({
@@ -104,12 +104,12 @@ function RootDocument({ children }: { children: React.ReactNode }) {
Users
{' '}
- Layout
+ Pathless Layout
{' '}
- I'm a nested layout
-
-
- Layout A
-
-
- Layout B
-
-
-
-
-
-
- )
-}
diff --git a/examples/react/start-basic/src/routes/_layout/_layout-2/layout-a.tsx b/examples/react/start-basic/src/routes/_layout/_layout-2/layout-a.tsx
deleted file mode 100644
index 61e19b4d9f..0000000000
--- a/examples/react/start-basic/src/routes/_layout/_layout-2/layout-a.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { createFileRoute } from '@tanstack/react-router'
-
-export const Route = createFileRoute('/_layout/_layout-2/layout-a')({
- component: LayoutAComponent,
-})
-
-function LayoutAComponent() {
- return I'm layout A!
-}
diff --git a/examples/react/start-basic/src/routes/_layout/_layout-2/layout-b.tsx b/examples/react/start-basic/src/routes/_layout/_layout-2/layout-b.tsx
deleted file mode 100644
index cceed1fb9a..0000000000
--- a/examples/react/start-basic/src/routes/_layout/_layout-2/layout-b.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { createFileRoute } from '@tanstack/react-router'
-
-export const Route = createFileRoute('/_layout/_layout-2/layout-b')({
- component: LayoutBComponent,
-})
-
-function LayoutBComponent() {
- return I'm layout B!
-}
diff --git a/examples/react/start-basic/app/routes/_pathlessLayout.tsx b/examples/react/start-basic/src/routes/_pathlessLayout.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/_pathlessLayout.tsx
rename to examples/react/start-basic/src/routes/_pathlessLayout.tsx
diff --git a/examples/react/start-basic/app/routes/_pathlessLayout/_nested-layout.tsx b/examples/react/start-basic/src/routes/_pathlessLayout/_nested-layout.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/_pathlessLayout/_nested-layout.tsx
rename to examples/react/start-basic/src/routes/_pathlessLayout/_nested-layout.tsx
diff --git a/examples/react/start-basic/app/routes/_pathlessLayout/_nested-layout/route-a.tsx b/examples/react/start-basic/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/_pathlessLayout/_nested-layout/route-a.tsx
rename to examples/react/start-basic/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
diff --git a/examples/react/start-basic/app/routes/_pathlessLayout/_nested-layout/route-b.tsx b/examples/react/start-basic/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/_pathlessLayout/_nested-layout/route-b.tsx
rename to examples/react/start-basic/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
diff --git a/examples/react/start-basic/app/routes/posts.route.tsx b/examples/react/start-basic/src/routes/posts.route.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/posts.route.tsx
rename to examples/react/start-basic/src/routes/posts.route.tsx
diff --git a/examples/react/start-basic/app/routes/users.route.tsx b/examples/react/start-basic/src/routes/users.route.tsx
similarity index 100%
rename from examples/react/start-basic/app/routes/users.route.tsx
rename to examples/react/start-basic/src/routes/users.route.tsx
diff --git a/examples/react/start-clerk-basic/app/components/DefaultCatchBoundary.tsx b/examples/react/start-clerk-basic/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from examples/react/start-clerk-basic/app/components/DefaultCatchBoundary.tsx
rename to examples/react/start-clerk-basic/src/components/DefaultCatchBoundary.tsx
diff --git a/examples/react/start-clerk-basic/app/components/NotFound.tsx b/examples/react/start-clerk-basic/src/components/NotFound.tsx
similarity index 100%
rename from examples/react/start-clerk-basic/app/components/NotFound.tsx
rename to examples/react/start-clerk-basic/src/components/NotFound.tsx
diff --git a/examples/react/start-clerk-basic/app/routeTree.gen.ts b/examples/react/start-clerk-basic/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-clerk-basic/app/routeTree.gen.ts
rename to examples/react/start-clerk-basic/src/routeTree.gen.ts
diff --git a/examples/react/start-clerk-basic/app/router.tsx b/examples/react/start-clerk-basic/src/router.tsx
similarity index 100%
rename from examples/react/start-clerk-basic/app/router.tsx
rename to examples/react/start-clerk-basic/src/router.tsx
diff --git a/examples/react/start-clerk-basic/app/routes/__root.tsx b/examples/react/start-clerk-basic/src/routes/__root.tsx
similarity index 95%
rename from examples/react/start-clerk-basic/app/routes/__root.tsx
rename to examples/react/start-clerk-basic/src/routes/__root.tsx
index 489e80715f..358f9d8be3 100644
--- a/examples/react/start-clerk-basic/app/routes/__root.tsx
+++ b/examples/react/start-clerk-basic/src/routes/__root.tsx
@@ -18,8 +18,8 @@ import { createServerFn } from '@tanstack/react-start'
import * as React from 'react'
import { getAuth } from '@clerk/tanstack-start/server'
import { getWebRequest } from '@tanstack/react-start/server'
-import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js'
-import { NotFound } from '~/components/NotFound.js'
+import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary.js'
+import { NotFound } from 'src/components/NotFound.js'
import appCss from '~/styles/app.css?url'
const fetchClerkAuth = createServerFn({ method: 'GET' }).handler(async () => {
diff --git a/examples/react/start-clerk-basic/app/routes/_authed.tsx b/examples/react/start-clerk-basic/src/routes/_authed.tsx
similarity index 100%
rename from examples/react/start-clerk-basic/app/routes/_authed.tsx
rename to examples/react/start-clerk-basic/src/routes/_authed.tsx
diff --git a/examples/react/start-basic-auth/app/routes/_authed/posts.$postId.tsx b/examples/react/start-clerk-basic/src/routes/_authed/posts.$postId.tsx
similarity index 88%
rename from examples/react/start-basic-auth/app/routes/_authed/posts.$postId.tsx
rename to examples/react/start-clerk-basic/src/routes/_authed/posts.$postId.tsx
index 039271bb89..763ac98f14 100644
--- a/examples/react/start-basic-auth/app/routes/_authed/posts.$postId.tsx
+++ b/examples/react/start-clerk-basic/src/routes/_authed/posts.$postId.tsx
@@ -1,7 +1,7 @@
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from '~/components/NotFound.js'
-import { fetchPost } from '~/utils/posts.js'
+import { NotFound } from 'src/components/NotFound.js'
+import { fetchPost } from 'src/utils/posts.js'
export const Route = createFileRoute('/_authed/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/examples/react/start-clerk-basic/app/routes/_authed/posts.index.tsx b/examples/react/start-clerk-basic/src/routes/_authed/posts.index.tsx
similarity index 100%
rename from examples/react/start-clerk-basic/app/routes/_authed/posts.index.tsx
rename to examples/react/start-clerk-basic/src/routes/_authed/posts.index.tsx
diff --git a/examples/react/start-clerk-basic/app/routes/_authed/posts.tsx b/examples/react/start-clerk-basic/src/routes/_authed/posts.tsx
similarity index 95%
rename from examples/react/start-clerk-basic/app/routes/_authed/posts.tsx
rename to examples/react/start-clerk-basic/src/routes/_authed/posts.tsx
index 86c8ef4138..a3144ce55a 100644
--- a/examples/react/start-clerk-basic/app/routes/_authed/posts.tsx
+++ b/examples/react/start-clerk-basic/src/routes/_authed/posts.tsx
@@ -1,5 +1,5 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from '~/utils/posts.js'
+import { fetchPosts } from 'src/utils/posts.js'
export const Route = createFileRoute('/_authed/posts')({
loader: () => fetchPosts(),
diff --git a/examples/react/start-clerk-basic/app/routes/_authed/profile.$.tsx b/examples/react/start-clerk-basic/src/routes/_authed/profile.$.tsx
similarity index 95%
rename from examples/react/start-clerk-basic/app/routes/_authed/profile.$.tsx
rename to examples/react/start-clerk-basic/src/routes/_authed/profile.$.tsx
index 208a38e230..4e0b434c2b 100644
--- a/examples/react/start-clerk-basic/app/routes/_authed/profile.$.tsx
+++ b/examples/react/start-clerk-basic/src/routes/_authed/profile.$.tsx
@@ -1,5 +1,5 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from '~/utils/posts.js'
+import { fetchPosts } from 'src/utils/posts.js'
export const Route = createFileRoute('/_authed/profile/$')({
loader: () => fetchPosts(),
diff --git a/examples/react/start-clerk-basic/app/routes/index.tsx b/examples/react/start-clerk-basic/src/routes/index.tsx
similarity index 100%
rename from examples/react/start-clerk-basic/app/routes/index.tsx
rename to examples/react/start-clerk-basic/src/routes/index.tsx
diff --git a/examples/react/start-clerk-basic/app/server.ts b/examples/react/start-clerk-basic/src/server.ts
similarity index 100%
rename from examples/react/start-clerk-basic/app/server.ts
rename to examples/react/start-clerk-basic/src/server.ts
diff --git a/examples/react/start-clerk-basic/app/styles/app.css b/examples/react/start-clerk-basic/src/styles/app.css
similarity index 100%
rename from examples/react/start-clerk-basic/app/styles/app.css
rename to examples/react/start-clerk-basic/src/styles/app.css
diff --git a/examples/react/start-clerk-basic/app/utils/posts.ts b/examples/react/start-clerk-basic/src/utils/posts.ts
similarity index 100%
rename from examples/react/start-clerk-basic/app/utils/posts.ts
rename to examples/react/start-clerk-basic/src/utils/posts.ts
diff --git a/examples/react/start-clerk-basic/app/utils/seo.ts b/examples/react/start-clerk-basic/src/utils/seo.ts
similarity index 100%
rename from examples/react/start-clerk-basic/app/utils/seo.ts
rename to examples/react/start-clerk-basic/src/utils/seo.ts
diff --git a/examples/react/start-clerk-basic/tsconfig.json b/examples/react/start-clerk-basic/tsconfig.json
index d1b5b77660..9a7cf62c30 100644
--- a/examples/react/start-clerk-basic/tsconfig.json
+++ b/examples/react/start-clerk-basic/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/examples/react/start-convex-trellaux/app/components/Board.tsx b/examples/react/start-convex-trellaux/src/components/Board.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/Board.tsx
rename to examples/react/start-convex-trellaux/src/components/Board.tsx
diff --git a/examples/react/start-convex-trellaux/app/components/CancelButton.tsx b/examples/react/start-convex-trellaux/src/components/CancelButton.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/CancelButton.tsx
rename to examples/react/start-convex-trellaux/src/components/CancelButton.tsx
diff --git a/examples/react/start-convex-trellaux/app/components/Card.tsx b/examples/react/start-convex-trellaux/src/components/Card.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/Card.tsx
rename to examples/react/start-convex-trellaux/src/components/Card.tsx
diff --git a/examples/react/start-convex-trellaux/app/components/Column.tsx b/examples/react/start-convex-trellaux/src/components/Column.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/Column.tsx
rename to examples/react/start-convex-trellaux/src/components/Column.tsx
diff --git a/examples/react/start-convex-trellaux/app/components/DefaultCatchBoundary.tsx b/examples/react/start-convex-trellaux/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/DefaultCatchBoundary.tsx
rename to examples/react/start-convex-trellaux/src/components/DefaultCatchBoundary.tsx
diff --git a/examples/react/start-convex-trellaux/app/components/EditableText.tsx b/examples/react/start-convex-trellaux/src/components/EditableText.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/EditableText.tsx
rename to examples/react/start-convex-trellaux/src/components/EditableText.tsx
diff --git a/examples/react/start-convex-trellaux/app/components/IconLink.tsx b/examples/react/start-convex-trellaux/src/components/IconLink.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/IconLink.tsx
rename to examples/react/start-convex-trellaux/src/components/IconLink.tsx
diff --git a/examples/react/start-convex-trellaux/app/components/Loader.tsx b/examples/react/start-convex-trellaux/src/components/Loader.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/Loader.tsx
rename to examples/react/start-convex-trellaux/src/components/Loader.tsx
diff --git a/examples/react/start-convex-trellaux/app/components/NewCard.tsx b/examples/react/start-convex-trellaux/src/components/NewCard.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/NewCard.tsx
rename to examples/react/start-convex-trellaux/src/components/NewCard.tsx
diff --git a/examples/react/start-convex-trellaux/app/components/NewColumn.tsx b/examples/react/start-convex-trellaux/src/components/NewColumn.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/NewColumn.tsx
rename to examples/react/start-convex-trellaux/src/components/NewColumn.tsx
diff --git a/examples/react/start-convex-trellaux/app/components/NotFound.tsx b/examples/react/start-convex-trellaux/src/components/NotFound.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/NotFound.tsx
rename to examples/react/start-convex-trellaux/src/components/NotFound.tsx
diff --git a/examples/react/start-convex-trellaux/app/components/SaveButton.tsx b/examples/react/start-convex-trellaux/src/components/SaveButton.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/components/SaveButton.tsx
rename to examples/react/start-convex-trellaux/src/components/SaveButton.tsx
diff --git a/examples/react/start-convex-trellaux/app/db/schema.ts b/examples/react/start-convex-trellaux/src/db/schema.ts
similarity index 100%
rename from examples/react/start-convex-trellaux/app/db/schema.ts
rename to examples/react/start-convex-trellaux/src/db/schema.ts
diff --git a/examples/react/start-convex-trellaux/app/hooks/useOfflineIndicator.tsx b/examples/react/start-convex-trellaux/src/hooks/useOfflineIndicator.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/hooks/useOfflineIndicator.tsx
rename to examples/react/start-convex-trellaux/src/hooks/useOfflineIndicator.tsx
diff --git a/examples/react/start-convex-trellaux/app/icons/icons.svg b/examples/react/start-convex-trellaux/src/icons/icons.svg
similarity index 100%
rename from examples/react/start-convex-trellaux/app/icons/icons.svg
rename to examples/react/start-convex-trellaux/src/icons/icons.svg
diff --git a/examples/react/start-convex-trellaux/app/icons/icons.tsx b/examples/react/start-convex-trellaux/src/icons/icons.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/icons/icons.tsx
rename to examples/react/start-convex-trellaux/src/icons/icons.tsx
diff --git a/examples/react/start-convex-trellaux/app/queries.ts b/examples/react/start-convex-trellaux/src/queries.ts
similarity index 100%
rename from examples/react/start-convex-trellaux/app/queries.ts
rename to examples/react/start-convex-trellaux/src/queries.ts
diff --git a/examples/react/start-convex-trellaux/app/routeTree.gen.ts b/examples/react/start-convex-trellaux/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-convex-trellaux/app/routeTree.gen.ts
rename to examples/react/start-convex-trellaux/src/routeTree.gen.ts
diff --git a/examples/react/start-convex-trellaux/app/router.tsx b/examples/react/start-convex-trellaux/src/router.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/router.tsx
rename to examples/react/start-convex-trellaux/src/router.tsx
diff --git a/examples/react/start-convex-trellaux/app/routes/__root.tsx b/examples/react/start-convex-trellaux/src/routes/__root.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/routes/__root.tsx
rename to examples/react/start-convex-trellaux/src/routes/__root.tsx
diff --git a/examples/react/start-convex-trellaux/app/routes/boards.$boardId.tsx b/examples/react/start-convex-trellaux/src/routes/boards.$boardId.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/routes/boards.$boardId.tsx
rename to examples/react/start-convex-trellaux/src/routes/boards.$boardId.tsx
diff --git a/examples/react/start-convex-trellaux/app/routes/index.tsx b/examples/react/start-convex-trellaux/src/routes/index.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/routes/index.tsx
rename to examples/react/start-convex-trellaux/src/routes/index.tsx
diff --git a/examples/react/start-basic-static/app/server.ts b/examples/react/start-convex-trellaux/src/server.ts
similarity index 100%
rename from examples/react/start-basic-static/app/server.ts
rename to examples/react/start-convex-trellaux/src/server.ts
diff --git a/examples/react/start-convex-trellaux/app/styles/app.css b/examples/react/start-convex-trellaux/src/styles/app.css
similarity index 100%
rename from examples/react/start-convex-trellaux/app/styles/app.css
rename to examples/react/start-convex-trellaux/src/styles/app.css
diff --git a/examples/react/start-convex-trellaux/app/types.ts b/examples/react/start-convex-trellaux/src/types.ts
similarity index 100%
rename from examples/react/start-convex-trellaux/app/types.ts
rename to examples/react/start-convex-trellaux/src/types.ts
diff --git a/examples/react/start-convex-trellaux/app/utils/posts.tsx b/examples/react/start-convex-trellaux/src/utils/posts.tsx
similarity index 100%
rename from examples/react/start-convex-trellaux/app/utils/posts.tsx
rename to examples/react/start-convex-trellaux/src/utils/posts.tsx
diff --git a/examples/react/start-convex-trellaux/app/utils/seo.ts b/examples/react/start-convex-trellaux/src/utils/seo.ts
similarity index 100%
rename from examples/react/start-convex-trellaux/app/utils/seo.ts
rename to examples/react/start-convex-trellaux/src/utils/seo.ts
diff --git a/examples/react/start-counter/app/routeTree.gen.ts b/examples/react/start-counter/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-counter/app/routeTree.gen.ts
rename to examples/react/start-counter/src/routeTree.gen.ts
diff --git a/examples/react/start-counter/app/router.tsx b/examples/react/start-counter/src/router.tsx
similarity index 100%
rename from examples/react/start-counter/app/router.tsx
rename to examples/react/start-counter/src/router.tsx
diff --git a/examples/react/start-counter/app/routes/__root.tsx b/examples/react/start-counter/src/routes/__root.tsx
similarity index 100%
rename from examples/react/start-counter/app/routes/__root.tsx
rename to examples/react/start-counter/src/routes/__root.tsx
diff --git a/examples/react/start-counter/app/routes/index.tsx b/examples/react/start-counter/src/routes/index.tsx
similarity index 100%
rename from examples/react/start-counter/app/routes/index.tsx
rename to examples/react/start-counter/src/routes/index.tsx
diff --git a/examples/react/start-convex-trellaux/app/server.ts b/examples/react/start-counter/src/server.ts
similarity index 100%
rename from examples/react/start-convex-trellaux/app/server.ts
rename to examples/react/start-counter/src/server.ts
diff --git a/examples/react/start-large/app/createRoutes.mjs b/examples/react/start-large/src/createRoutes.mjs
similarity index 100%
rename from examples/react/start-large/app/createRoutes.mjs
rename to examples/react/start-large/src/createRoutes.mjs
diff --git a/examples/react/start-large/app/routeTree.gen.ts b/examples/react/start-large/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-large/app/routeTree.gen.ts
rename to examples/react/start-large/src/routeTree.gen.ts
diff --git a/examples/react/start-large/app/router.tsx b/examples/react/start-large/src/router.tsx
similarity index 100%
rename from examples/react/start-large/app/router.tsx
rename to examples/react/start-large/src/router.tsx
diff --git a/examples/react/start-large/app/routes/__root.tsx b/examples/react/start-large/src/routes/__root.tsx
similarity index 100%
rename from examples/react/start-large/app/routes/__root.tsx
rename to examples/react/start-large/src/routes/__root.tsx
diff --git a/examples/react/start-large/app/routes/absolute.tsx b/examples/react/start-large/src/routes/absolute.tsx
similarity index 100%
rename from examples/react/start-large/app/routes/absolute.tsx
rename to examples/react/start-large/src/routes/absolute.tsx
diff --git a/examples/react/start-large/app/routes/index.tsx b/examples/react/start-large/src/routes/index.tsx
similarity index 100%
rename from examples/react/start-large/app/routes/index.tsx
rename to examples/react/start-large/src/routes/index.tsx
diff --git a/examples/react/start-large/app/routes/linkProps.tsx b/examples/react/start-large/src/routes/linkProps.tsx
similarity index 98%
rename from examples/react/start-large/app/routes/linkProps.tsx
rename to examples/react/start-large/src/routes/linkProps.tsx
index 4804161ccf..cb81ec1ac7 100644
--- a/examples/react/start-large/app/routes/linkProps.tsx
+++ b/examples/react/start-large/src/routes/linkProps.tsx
@@ -5,7 +5,7 @@ import {
ListItems,
MyLink,
useCustomNavigate,
-} from '~/typePrimitives'
+} from 'src/typePrimitives'
export const Route = createFileRoute('/linkProps')({
component: LinkPropsPage,
diff --git a/examples/react/start-large/app/routes/params/$paramsPlaceholder.tsx b/examples/react/start-large/src/routes/params/$paramsPlaceholder.tsx
similarity index 100%
rename from examples/react/start-large/app/routes/params/$paramsPlaceholder.tsx
rename to examples/react/start-large/src/routes/params/$paramsPlaceholder.tsx
diff --git a/examples/react/start-large/app/routes/params/route.tsx b/examples/react/start-large/src/routes/params/route.tsx
similarity index 100%
rename from examples/react/start-large/app/routes/params/route.tsx
rename to examples/react/start-large/src/routes/params/route.tsx
diff --git a/examples/react/start-large/app/routes/relative.tsx b/examples/react/start-large/src/routes/relative.tsx
similarity index 100%
rename from examples/react/start-large/app/routes/relative.tsx
rename to examples/react/start-large/src/routes/relative.tsx
diff --git a/examples/react/start-large/app/routes/search/route.tsx b/examples/react/start-large/src/routes/search/route.tsx
similarity index 100%
rename from examples/react/start-large/app/routes/search/route.tsx
rename to examples/react/start-large/src/routes/search/route.tsx
diff --git a/examples/react/start-large/app/routes/search/searchPlaceholder.tsx b/examples/react/start-large/src/routes/search/searchPlaceholder.tsx
similarity index 100%
rename from examples/react/start-large/app/routes/search/searchPlaceholder.tsx
rename to examples/react/start-large/src/routes/search/searchPlaceholder.tsx
diff --git a/examples/react/start-large/app/server.ts b/examples/react/start-large/src/server.ts
similarity index 100%
rename from examples/react/start-large/app/server.ts
rename to examples/react/start-large/src/server.ts
diff --git a/examples/react/start-large/app/styles.css b/examples/react/start-large/src/styles.css
similarity index 100%
rename from examples/react/start-large/app/styles.css
rename to examples/react/start-large/src/styles.css
diff --git a/examples/react/start-large/app/typePrimitives.tsx b/examples/react/start-large/src/typePrimitives.tsx
similarity index 100%
rename from examples/react/start-large/app/typePrimitives.tsx
rename to examples/react/start-large/src/typePrimitives.tsx
diff --git a/examples/react/start-large/tsconfig.json b/examples/react/start-large/tsconfig.json
index d1b5b77660..9a7cf62c30 100644
--- a/examples/react/start-large/tsconfig.json
+++ b/examples/react/start-large/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/examples/react/start-material-ui/app/client.tsx b/examples/react/start-material-ui/src/client.tsx
similarity index 100%
rename from examples/react/start-material-ui/app/client.tsx
rename to examples/react/start-material-ui/src/client.tsx
diff --git a/examples/react/start-material-ui/app/components/Counter.tsx b/examples/react/start-material-ui/src/components/Counter.tsx
similarity index 85%
rename from examples/react/start-material-ui/app/components/Counter.tsx
rename to examples/react/start-material-ui/src/components/Counter.tsx
index 205bbea855..363c5f11c4 100644
--- a/examples/react/start-material-ui/app/components/Counter.tsx
+++ b/examples/react/start-material-ui/src/components/Counter.tsx
@@ -1,6 +1,6 @@
import { Stack } from '@mui/material'
import { useSearch } from '@tanstack/react-router'
-import { CustomButtonLink } from '~/components/CustomButtonLink'
+import { CustomButtonLink } from 'src/components/CustomButtonLink'
export function Counter() {
const { count = 0 } = useSearch({ from: '/' })
diff --git a/examples/react/start-material-ui/app/components/CustomButtonLink.tsx b/examples/react/start-material-ui/src/components/CustomButtonLink.tsx
similarity index 100%
rename from examples/react/start-material-ui/app/components/CustomButtonLink.tsx
rename to examples/react/start-material-ui/src/components/CustomButtonLink.tsx
diff --git a/examples/react/start-material-ui/app/components/CustomLink.tsx b/examples/react/start-material-ui/src/components/CustomLink.tsx
similarity index 100%
rename from examples/react/start-material-ui/app/components/CustomLink.tsx
rename to examples/react/start-material-ui/src/components/CustomLink.tsx
diff --git a/examples/react/start-material-ui/app/components/Header.tsx b/examples/react/start-material-ui/src/components/Header.tsx
similarity index 100%
rename from examples/react/start-material-ui/app/components/Header.tsx
rename to examples/react/start-material-ui/src/components/Header.tsx
diff --git a/examples/react/start-material-ui/app/routeTree.gen.ts b/examples/react/start-material-ui/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-material-ui/app/routeTree.gen.ts
rename to examples/react/start-material-ui/src/routeTree.gen.ts
diff --git a/examples/react/start-material-ui/app/router.tsx b/examples/react/start-material-ui/src/router.tsx
similarity index 100%
rename from examples/react/start-material-ui/app/router.tsx
rename to examples/react/start-material-ui/src/router.tsx
diff --git a/examples/react/start-material-ui/app/routes/__root.tsx b/examples/react/start-material-ui/src/routes/__root.tsx
similarity index 94%
rename from examples/react/start-material-ui/app/routes/__root.tsx
rename to examples/react/start-material-ui/src/routes/__root.tsx
index 6b0b217b63..e9a65ccfd5 100644
--- a/examples/react/start-material-ui/app/routes/__root.tsx
+++ b/examples/react/start-material-ui/src/routes/__root.tsx
@@ -10,8 +10,8 @@ import { Container, CssBaseline, ThemeProvider } from '@mui/material'
import createCache from '@emotion/cache'
import fontsourceVariableRobotoCss from '@fontsource-variable/roboto?url'
import React from 'react'
-import { theme } from '~/setup/theme'
-import { Header } from '~/components/Header'
+import { theme } from 'src/setup/theme'
+import { Header } from 'src/components/Header'
export const Route = createRootRoute({
head: () => ({
diff --git a/examples/react/start-material-ui/app/routes/about.tsx b/examples/react/start-material-ui/src/routes/about.tsx
similarity index 100%
rename from examples/react/start-material-ui/app/routes/about.tsx
rename to examples/react/start-material-ui/src/routes/about.tsx
diff --git a/examples/react/start-material-ui/app/routes/index.tsx b/examples/react/start-material-ui/src/routes/index.tsx
similarity index 90%
rename from examples/react/start-material-ui/app/routes/index.tsx
rename to examples/react/start-material-ui/src/routes/index.tsx
index 75f5d14de4..667a92881d 100644
--- a/examples/react/start-material-ui/app/routes/index.tsx
+++ b/examples/react/start-material-ui/src/routes/index.tsx
@@ -1,7 +1,7 @@
import { createFileRoute } from '@tanstack/react-router'
import { Stack, Typography } from '@mui/material'
import z from 'zod'
-import { Counter } from '~/components/Counter'
+import { Counter } from 'src/components/Counter'
export const Route = createFileRoute('/')({
validateSearch: z.object({
diff --git a/examples/react/start-material-ui/app/setup/theme.ts b/examples/react/start-material-ui/src/setup/theme.ts
similarity index 100%
rename from examples/react/start-material-ui/app/setup/theme.ts
rename to examples/react/start-material-ui/src/setup/theme.ts
diff --git a/examples/react/start-material-ui/app/ssr.tsx b/examples/react/start-material-ui/src/ssr.tsx
similarity index 100%
rename from examples/react/start-material-ui/app/ssr.tsx
rename to examples/react/start-material-ui/src/ssr.tsx
diff --git a/examples/react/start-material-ui/tsconfig.json b/examples/react/start-material-ui/tsconfig.json
index a6747faec5..23f12840c3 100644
--- a/examples/react/start-material-ui/tsconfig.json
+++ b/examples/react/start-material-ui/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/examples/react/start-supabase-basic/app/components/Auth.tsx b/examples/react/start-supabase-basic/src/components/Auth.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/components/Auth.tsx
rename to examples/react/start-supabase-basic/src/components/Auth.tsx
diff --git a/examples/react/start-supabase-basic/app/components/DefaultCatchBoundary.tsx b/examples/react/start-supabase-basic/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/components/DefaultCatchBoundary.tsx
rename to examples/react/start-supabase-basic/src/components/DefaultCatchBoundary.tsx
diff --git a/examples/react/start-supabase-basic/app/components/Login.tsx b/examples/react/start-supabase-basic/src/components/Login.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/components/Login.tsx
rename to examples/react/start-supabase-basic/src/components/Login.tsx
diff --git a/examples/react/start-supabase-basic/app/components/NotFound.tsx b/examples/react/start-supabase-basic/src/components/NotFound.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/components/NotFound.tsx
rename to examples/react/start-supabase-basic/src/components/NotFound.tsx
diff --git a/examples/react/start-supabase-basic/app/hooks/useMutation.ts b/examples/react/start-supabase-basic/src/hooks/useMutation.ts
similarity index 100%
rename from examples/react/start-supabase-basic/app/hooks/useMutation.ts
rename to examples/react/start-supabase-basic/src/hooks/useMutation.ts
diff --git a/examples/react/start-supabase-basic/app/routeTree.gen.ts b/examples/react/start-supabase-basic/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-supabase-basic/app/routeTree.gen.ts
rename to examples/react/start-supabase-basic/src/routeTree.gen.ts
diff --git a/examples/react/start-supabase-basic/app/router.tsx b/examples/react/start-supabase-basic/src/router.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/router.tsx
rename to examples/react/start-supabase-basic/src/router.tsx
diff --git a/examples/react/start-supabase-basic/app/routes/__root.tsx b/examples/react/start-supabase-basic/src/routes/__root.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/routes/__root.tsx
rename to examples/react/start-supabase-basic/src/routes/__root.tsx
diff --git a/examples/react/start-supabase-basic/app/routes/_authed.tsx b/examples/react/start-supabase-basic/src/routes/_authed.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/routes/_authed.tsx
rename to examples/react/start-supabase-basic/src/routes/_authed.tsx
diff --git a/examples/react/start-supabase-basic/app/routes/_authed/posts.$postId.tsx b/examples/react/start-supabase-basic/src/routes/_authed/posts.$postId.tsx
similarity index 89%
rename from examples/react/start-supabase-basic/app/routes/_authed/posts.$postId.tsx
rename to examples/react/start-supabase-basic/src/routes/_authed/posts.$postId.tsx
index 4dd11756a8..059f35ff73 100644
--- a/examples/react/start-supabase-basic/app/routes/_authed/posts.$postId.tsx
+++ b/examples/react/start-supabase-basic/src/routes/_authed/posts.$postId.tsx
@@ -1,7 +1,7 @@
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from '~/components/NotFound'
-import { fetchPost } from '~/utils/posts'
+import { NotFound } from 'src/components/NotFound'
+import { fetchPost } from 'src/utils/posts'
export const Route = createFileRoute('/_authed/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/examples/react/start-supabase-basic/app/routes/_authed/posts.index.tsx b/examples/react/start-supabase-basic/src/routes/_authed/posts.index.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/routes/_authed/posts.index.tsx
rename to examples/react/start-supabase-basic/src/routes/_authed/posts.index.tsx
diff --git a/examples/react/start-supabase-basic/app/routes/_authed/posts.tsx b/examples/react/start-supabase-basic/src/routes/_authed/posts.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/routes/_authed/posts.tsx
rename to examples/react/start-supabase-basic/src/routes/_authed/posts.tsx
diff --git a/examples/react/start-supabase-basic/app/routes/index.tsx b/examples/react/start-supabase-basic/src/routes/index.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/routes/index.tsx
rename to examples/react/start-supabase-basic/src/routes/index.tsx
diff --git a/examples/react/start-supabase-basic/app/routes/login.tsx b/examples/react/start-supabase-basic/src/routes/login.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/routes/login.tsx
rename to examples/react/start-supabase-basic/src/routes/login.tsx
diff --git a/examples/react/start-supabase-basic/app/routes/logout.tsx b/examples/react/start-supabase-basic/src/routes/logout.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/routes/logout.tsx
rename to examples/react/start-supabase-basic/src/routes/logout.tsx
diff --git a/examples/react/start-supabase-basic/app/routes/signup.tsx b/examples/react/start-supabase-basic/src/routes/signup.tsx
similarity index 100%
rename from examples/react/start-supabase-basic/app/routes/signup.tsx
rename to examples/react/start-supabase-basic/src/routes/signup.tsx
diff --git a/examples/react/start-supabase-basic/app/server.ts b/examples/react/start-supabase-basic/src/server.ts
similarity index 100%
rename from examples/react/start-supabase-basic/app/server.ts
rename to examples/react/start-supabase-basic/src/server.ts
diff --git a/examples/react/start-supabase-basic/app/styles/app.css b/examples/react/start-supabase-basic/src/styles/app.css
similarity index 100%
rename from examples/react/start-supabase-basic/app/styles/app.css
rename to examples/react/start-supabase-basic/src/styles/app.css
diff --git a/examples/react/start-supabase-basic/app/utils/posts.ts b/examples/react/start-supabase-basic/src/utils/posts.ts
similarity index 100%
rename from examples/react/start-supabase-basic/app/utils/posts.ts
rename to examples/react/start-supabase-basic/src/utils/posts.ts
diff --git a/examples/react/start-supabase-basic/app/utils/seo.ts b/examples/react/start-supabase-basic/src/utils/seo.ts
similarity index 100%
rename from examples/react/start-supabase-basic/app/utils/seo.ts
rename to examples/react/start-supabase-basic/src/utils/seo.ts
diff --git a/examples/react/start-supabase-basic/app/utils/supabase.ts b/examples/react/start-supabase-basic/src/utils/supabase.ts
similarity index 100%
rename from examples/react/start-supabase-basic/app/utils/supabase.ts
rename to examples/react/start-supabase-basic/src/utils/supabase.ts
diff --git a/examples/react/start-supabase-basic/tsconfig.json b/examples/react/start-supabase-basic/tsconfig.json
index d1b5b77660..9a7cf62c30 100644
--- a/examples/react/start-supabase-basic/tsconfig.json
+++ b/examples/react/start-supabase-basic/tsconfig.json
@@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/examples/react/start-trellaux/app/server.ts b/examples/react/start-trellaux/app/server.ts
deleted file mode 100644
index 65a580f25e..0000000000
--- a/examples/react/start-trellaux/app/server.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-trellaux/app/assets/react.svg b/examples/react/start-trellaux/src/assets/react.svg
similarity index 100%
rename from examples/react/start-trellaux/app/assets/react.svg
rename to examples/react/start-trellaux/src/assets/react.svg
diff --git a/examples/react/start-trellaux/app/components/Board.tsx b/examples/react/start-trellaux/src/components/Board.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/Board.tsx
rename to examples/react/start-trellaux/src/components/Board.tsx
diff --git a/examples/react/start-trellaux/app/components/CancelButton.tsx b/examples/react/start-trellaux/src/components/CancelButton.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/CancelButton.tsx
rename to examples/react/start-trellaux/src/components/CancelButton.tsx
diff --git a/examples/react/start-trellaux/app/components/Card.tsx b/examples/react/start-trellaux/src/components/Card.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/Card.tsx
rename to examples/react/start-trellaux/src/components/Card.tsx
diff --git a/examples/react/start-trellaux/app/components/Column.tsx b/examples/react/start-trellaux/src/components/Column.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/Column.tsx
rename to examples/react/start-trellaux/src/components/Column.tsx
diff --git a/examples/react/start-trellaux/app/components/DefaultCatchBoundary.tsx b/examples/react/start-trellaux/src/components/DefaultCatchBoundary.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/DefaultCatchBoundary.tsx
rename to examples/react/start-trellaux/src/components/DefaultCatchBoundary.tsx
diff --git a/examples/react/start-trellaux/app/components/EditableText.tsx b/examples/react/start-trellaux/src/components/EditableText.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/EditableText.tsx
rename to examples/react/start-trellaux/src/components/EditableText.tsx
diff --git a/examples/react/start-trellaux/app/components/IconLink.tsx b/examples/react/start-trellaux/src/components/IconLink.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/IconLink.tsx
rename to examples/react/start-trellaux/src/components/IconLink.tsx
diff --git a/examples/react/start-trellaux/app/components/Loader.tsx b/examples/react/start-trellaux/src/components/Loader.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/Loader.tsx
rename to examples/react/start-trellaux/src/components/Loader.tsx
diff --git a/examples/react/start-trellaux/app/components/NewCard.tsx b/examples/react/start-trellaux/src/components/NewCard.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/NewCard.tsx
rename to examples/react/start-trellaux/src/components/NewCard.tsx
diff --git a/examples/react/start-trellaux/app/components/NewColumn.tsx b/examples/react/start-trellaux/src/components/NewColumn.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/NewColumn.tsx
rename to examples/react/start-trellaux/src/components/NewColumn.tsx
diff --git a/examples/react/start-trellaux/app/components/NotFound.tsx b/examples/react/start-trellaux/src/components/NotFound.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/NotFound.tsx
rename to examples/react/start-trellaux/src/components/NotFound.tsx
diff --git a/examples/react/start-trellaux/app/components/SaveButton.tsx b/examples/react/start-trellaux/src/components/SaveButton.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/components/SaveButton.tsx
rename to examples/react/start-trellaux/src/components/SaveButton.tsx
diff --git a/examples/react/start-trellaux/app/db/board.ts b/examples/react/start-trellaux/src/db/board.ts
similarity index 100%
rename from examples/react/start-trellaux/app/db/board.ts
rename to examples/react/start-trellaux/src/db/board.ts
diff --git a/examples/react/start-trellaux/app/db/schema.ts b/examples/react/start-trellaux/src/db/schema.ts
similarity index 100%
rename from examples/react/start-trellaux/app/db/schema.ts
rename to examples/react/start-trellaux/src/db/schema.ts
diff --git a/examples/react/start-trellaux/app/hooks/useOfflineIndicator.tsx b/examples/react/start-trellaux/src/hooks/useOfflineIndicator.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/hooks/useOfflineIndicator.tsx
rename to examples/react/start-trellaux/src/hooks/useOfflineIndicator.tsx
diff --git a/examples/react/start-trellaux/app/icons/icons.svg b/examples/react/start-trellaux/src/icons/icons.svg
similarity index 100%
rename from examples/react/start-trellaux/app/icons/icons.svg
rename to examples/react/start-trellaux/src/icons/icons.svg
diff --git a/examples/react/start-trellaux/app/icons/icons.tsx b/examples/react/start-trellaux/src/icons/icons.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/icons/icons.tsx
rename to examples/react/start-trellaux/src/icons/icons.tsx
diff --git a/examples/react/start-trellaux/app/queries.ts b/examples/react/start-trellaux/src/queries.ts
similarity index 100%
rename from examples/react/start-trellaux/app/queries.ts
rename to examples/react/start-trellaux/src/queries.ts
diff --git a/examples/react/start-trellaux/app/routeTree.gen.ts b/examples/react/start-trellaux/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/start-trellaux/app/routeTree.gen.ts
rename to examples/react/start-trellaux/src/routeTree.gen.ts
diff --git a/examples/react/start-trellaux/app/router.tsx b/examples/react/start-trellaux/src/router.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/router.tsx
rename to examples/react/start-trellaux/src/router.tsx
diff --git a/examples/react/start-trellaux/app/routes/__root.tsx b/examples/react/start-trellaux/src/routes/__root.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/routes/__root.tsx
rename to examples/react/start-trellaux/src/routes/__root.tsx
diff --git a/examples/react/start-trellaux/app/routes/boards.$boardId.tsx b/examples/react/start-trellaux/src/routes/boards.$boardId.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/routes/boards.$boardId.tsx
rename to examples/react/start-trellaux/src/routes/boards.$boardId.tsx
diff --git a/examples/react/start-trellaux/app/routes/index.tsx b/examples/react/start-trellaux/src/routes/index.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/routes/index.tsx
rename to examples/react/start-trellaux/src/routes/index.tsx
diff --git a/examples/react/start-counter/app/server.ts b/examples/react/start-trellaux/src/server.ts
similarity index 100%
rename from examples/react/start-counter/app/server.ts
rename to examples/react/start-trellaux/src/server.ts
diff --git a/examples/react/start-trellaux/app/styles/app.css b/examples/react/start-trellaux/src/styles/app.css
similarity index 100%
rename from examples/react/start-trellaux/app/styles/app.css
rename to examples/react/start-trellaux/src/styles/app.css
diff --git a/examples/react/start-trellaux/app/types.ts b/examples/react/start-trellaux/src/types.ts
similarity index 100%
rename from examples/react/start-trellaux/app/types.ts
rename to examples/react/start-trellaux/src/types.ts
diff --git a/examples/react/start-trellaux/app/utils/posts.tsx b/examples/react/start-trellaux/src/utils/posts.tsx
similarity index 100%
rename from examples/react/start-trellaux/app/utils/posts.tsx
rename to examples/react/start-trellaux/src/utils/posts.tsx
diff --git a/examples/react/start-trellaux/app/utils/seo.ts b/examples/react/start-trellaux/src/utils/seo.ts
similarity index 100%
rename from examples/react/start-trellaux/app/utils/seo.ts
rename to examples/react/start-trellaux/src/utils/seo.ts
diff --git a/examples/react/with-trpc-react-query/app/main.tsx b/examples/react/with-trpc-react-query/src/main.tsx
similarity index 100%
rename from examples/react/with-trpc-react-query/app/main.tsx
rename to examples/react/with-trpc-react-query/src/main.tsx
diff --git a/examples/react/with-trpc-react-query/app/routeTree.gen.ts b/examples/react/with-trpc-react-query/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/with-trpc-react-query/app/routeTree.gen.ts
rename to examples/react/with-trpc-react-query/src/routeTree.gen.ts
diff --git a/examples/react/with-trpc-react-query/app/router.tsx b/examples/react/with-trpc-react-query/src/router.tsx
similarity index 100%
rename from examples/react/with-trpc-react-query/app/router.tsx
rename to examples/react/with-trpc-react-query/src/router.tsx
diff --git a/examples/react/with-trpc-react-query/app/routes/-components/spinner.tsx b/examples/react/with-trpc-react-query/src/routes/-components/spinner.tsx
similarity index 100%
rename from examples/react/with-trpc-react-query/app/routes/-components/spinner.tsx
rename to examples/react/with-trpc-react-query/src/routes/-components/spinner.tsx
diff --git a/examples/react/with-trpc-react-query/app/routes/__root.tsx b/examples/react/with-trpc-react-query/src/routes/__root.tsx
similarity index 100%
rename from examples/react/with-trpc-react-query/app/routes/__root.tsx
rename to examples/react/with-trpc-react-query/src/routes/__root.tsx
diff --git a/examples/react/with-trpc-react-query/app/routes/dashboard.index.tsx b/examples/react/with-trpc-react-query/src/routes/dashboard.index.tsx
similarity index 100%
rename from examples/react/with-trpc-react-query/app/routes/dashboard.index.tsx
rename to examples/react/with-trpc-react-query/src/routes/dashboard.index.tsx
diff --git a/examples/react/with-trpc-react-query/app/routes/dashboard.posts.$postId.tsx b/examples/react/with-trpc-react-query/src/routes/dashboard.posts.$postId.tsx
similarity index 100%
rename from examples/react/with-trpc-react-query/app/routes/dashboard.posts.$postId.tsx
rename to examples/react/with-trpc-react-query/src/routes/dashboard.posts.$postId.tsx
diff --git a/examples/react/with-trpc-react-query/app/routes/dashboard.posts.index.tsx b/examples/react/with-trpc-react-query/src/routes/dashboard.posts.index.tsx
similarity index 100%
rename from examples/react/with-trpc-react-query/app/routes/dashboard.posts.index.tsx
rename to examples/react/with-trpc-react-query/src/routes/dashboard.posts.index.tsx
diff --git a/examples/react/with-trpc-react-query/app/routes/dashboard.posts.tsx b/examples/react/with-trpc-react-query/src/routes/dashboard.posts.tsx
similarity index 100%
rename from examples/react/with-trpc-react-query/app/routes/dashboard.posts.tsx
rename to examples/react/with-trpc-react-query/src/routes/dashboard.posts.tsx
diff --git a/examples/react/with-trpc-react-query/app/routes/dashboard.tsx b/examples/react/with-trpc-react-query/src/routes/dashboard.tsx
similarity index 100%
rename from examples/react/with-trpc-react-query/app/routes/dashboard.tsx
rename to examples/react/with-trpc-react-query/src/routes/dashboard.tsx
diff --git a/examples/react/with-trpc-react-query/app/routes/index.tsx b/examples/react/with-trpc-react-query/src/routes/index.tsx
similarity index 100%
rename from examples/react/with-trpc-react-query/app/routes/index.tsx
rename to examples/react/with-trpc-react-query/src/routes/index.tsx
diff --git a/examples/react/with-trpc-react-query/app/styles.css b/examples/react/with-trpc-react-query/src/styles.css
similarity index 100%
rename from examples/react/with-trpc-react-query/app/styles.css
rename to examples/react/with-trpc-react-query/src/styles.css
diff --git a/examples/react/with-trpc/app/main.tsx b/examples/react/with-trpc/src/main.tsx
similarity index 100%
rename from examples/react/with-trpc/app/main.tsx
rename to examples/react/with-trpc/src/main.tsx
diff --git a/examples/react/with-trpc/app/routeTree.gen.ts b/examples/react/with-trpc/src/routeTree.gen.ts
similarity index 100%
rename from examples/react/with-trpc/app/routeTree.gen.ts
rename to examples/react/with-trpc/src/routeTree.gen.ts
diff --git a/examples/react/with-trpc/app/routes/-components/spinner.tsx b/examples/react/with-trpc/src/routes/-components/spinner.tsx
similarity index 100%
rename from examples/react/with-trpc/app/routes/-components/spinner.tsx
rename to examples/react/with-trpc/src/routes/-components/spinner.tsx
diff --git a/examples/react/with-trpc/app/routes/__root.tsx b/examples/react/with-trpc/src/routes/__root.tsx
similarity index 100%
rename from examples/react/with-trpc/app/routes/__root.tsx
rename to examples/react/with-trpc/src/routes/__root.tsx
diff --git a/examples/react/with-trpc/app/routes/dashboard.index.tsx b/examples/react/with-trpc/src/routes/dashboard.index.tsx
similarity index 100%
rename from examples/react/with-trpc/app/routes/dashboard.index.tsx
rename to examples/react/with-trpc/src/routes/dashboard.index.tsx
diff --git a/examples/react/with-trpc/app/routes/dashboard.posts.$postId.tsx b/examples/react/with-trpc/src/routes/dashboard.posts.$postId.tsx
similarity index 100%
rename from examples/react/with-trpc/app/routes/dashboard.posts.$postId.tsx
rename to examples/react/with-trpc/src/routes/dashboard.posts.$postId.tsx
diff --git a/examples/react/with-trpc/app/routes/dashboard.posts.index.tsx b/examples/react/with-trpc/src/routes/dashboard.posts.index.tsx
similarity index 100%
rename from examples/react/with-trpc/app/routes/dashboard.posts.index.tsx
rename to examples/react/with-trpc/src/routes/dashboard.posts.index.tsx
diff --git a/examples/react/with-trpc/app/routes/dashboard.posts.tsx b/examples/react/with-trpc/src/routes/dashboard.posts.tsx
similarity index 100%
rename from examples/react/with-trpc/app/routes/dashboard.posts.tsx
rename to examples/react/with-trpc/src/routes/dashboard.posts.tsx
diff --git a/examples/react/with-trpc/app/routes/dashboard.tsx b/examples/react/with-trpc/src/routes/dashboard.tsx
similarity index 100%
rename from examples/react/with-trpc/app/routes/dashboard.tsx
rename to examples/react/with-trpc/src/routes/dashboard.tsx
diff --git a/examples/react/with-trpc/app/routes/index.tsx b/examples/react/with-trpc/src/routes/index.tsx
similarity index 100%
rename from examples/react/with-trpc/app/routes/index.tsx
rename to examples/react/with-trpc/src/routes/index.tsx
diff --git a/examples/react/with-trpc/app/styles.css b/examples/react/with-trpc/src/styles.css
similarity index 100%
rename from examples/react/with-trpc/app/styles.css
rename to examples/react/with-trpc/src/styles.css
diff --git a/examples/react/with-trpc/app/trpc.ts b/examples/react/with-trpc/src/trpc.ts
similarity index 100%
rename from examples/react/with-trpc/app/trpc.ts
rename to examples/react/with-trpc/src/trpc.ts
diff --git a/e2e/solid-start/website/app/client.tsx b/examples/solid/start-bare/src/client.tsx
similarity index 100%
rename from e2e/solid-start/website/app/client.tsx
rename to examples/solid/start-bare/src/client.tsx
diff --git a/examples/solid/start-bare/app/components/Counter.css b/examples/solid/start-bare/src/components/Counter.css
similarity index 100%
rename from examples/solid/start-bare/app/components/Counter.css
rename to examples/solid/start-bare/src/components/Counter.css
diff --git a/examples/solid/start-bare/app/components/Counter.tsx b/examples/solid/start-bare/src/components/Counter.tsx
similarity index 100%
rename from examples/solid/start-bare/app/components/Counter.tsx
rename to examples/solid/start-bare/src/components/Counter.tsx
diff --git a/examples/solid/start-bare/app/routeTree.gen.ts b/examples/solid/start-bare/src/routeTree.gen.ts
similarity index 100%
rename from examples/solid/start-bare/app/routeTree.gen.ts
rename to examples/solid/start-bare/src/routeTree.gen.ts
diff --git a/examples/solid/start-bare/app/router.tsx b/examples/solid/start-bare/src/router.tsx
similarity index 100%
rename from examples/solid/start-bare/app/router.tsx
rename to examples/solid/start-bare/src/router.tsx
diff --git a/examples/solid/start-bare/app/routes/__root.tsx b/examples/solid/start-bare/src/routes/__root.tsx
similarity index 100%
rename from examples/solid/start-bare/app/routes/__root.tsx
rename to examples/solid/start-bare/src/routes/__root.tsx
diff --git a/examples/solid/start-bare/app/routes/about.tsx b/examples/solid/start-bare/src/routes/about.tsx
similarity index 100%
rename from examples/solid/start-bare/app/routes/about.tsx
rename to examples/solid/start-bare/src/routes/about.tsx
diff --git a/examples/solid/start-bare/app/routes/index.tsx b/examples/solid/start-bare/src/routes/index.tsx
similarity index 86%
rename from examples/solid/start-bare/app/routes/index.tsx
rename to examples/solid/start-bare/src/routes/index.tsx
index 6a91bd1999..507865f60f 100644
--- a/examples/solid/start-bare/app/routes/index.tsx
+++ b/examples/solid/start-bare/src/routes/index.tsx
@@ -1,5 +1,5 @@
import { createFileRoute } from '@tanstack/solid-router'
-import Counter from '~/components/Counter'
+import Counter from 'src/components/Counter'
export const Route = createFileRoute('/')({
component: RouteComponent,
})
diff --git a/examples/solid/start-bare/app/ssr.tsx b/examples/solid/start-bare/src/ssr.tsx
similarity index 100%
rename from examples/solid/start-bare/app/ssr.tsx
rename to examples/solid/start-bare/src/ssr.tsx
diff --git a/examples/solid/start-bare/app/styles/app.css b/examples/solid/start-bare/src/styles/app.css
similarity index 100%
rename from examples/solid/start-bare/app/styles/app.css
rename to examples/solid/start-bare/src/styles/app.css
diff --git a/examples/solid/start-bare/tsconfig.json b/examples/solid/start-bare/tsconfig.json
index 73e4856648..3f2c37eff4 100644
--- a/examples/solid/start-bare/tsconfig.json
+++ b/examples/solid/start-bare/tsconfig.json
@@ -16,7 +16,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "~/*": ["./app/*"]
+ "~/*": ["src/*"]
},
"noEmit": true
}
diff --git a/packages/create-start/src/modules/core/template/app/client.tsx b/packages/create-start/src/modules/core/template/src/client.tsx
similarity index 100%
rename from packages/create-start/src/modules/core/template/app/client.tsx
rename to packages/create-start/src/modules/core/template/src/client.tsx
diff --git a/packages/create-start/src/modules/core/template/app/router.tsx b/packages/create-start/src/modules/core/template/src/router.tsx
similarity index 100%
rename from packages/create-start/src/modules/core/template/app/router.tsx
rename to packages/create-start/src/modules/core/template/src/router.tsx
diff --git a/packages/create-start/src/modules/core/template/app/routes/__root.tsx b/packages/create-start/src/modules/core/template/src/routes/__root.tsx
similarity index 100%
rename from packages/create-start/src/modules/core/template/app/routes/__root.tsx
rename to packages/create-start/src/modules/core/template/src/routes/__root.tsx
From 8cce13b9e993d799b699f034ec29b46375c8c9cd Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Fri, 7 Mar 2025 23:28:51 -0700
Subject: [PATCH 027/155] fix start-basic
---
.../react/start-basic/src/routeTree.gen.ts | 86 ++++++-------------
.../start-basic/src/routes/posts.route.tsx | 38 --------
.../start-basic/src/routes/users.route.tsx | 48 -----------
3 files changed, 26 insertions(+), 146 deletions(-)
delete mode 100644 examples/react/start-basic/src/routes/posts.route.tsx
delete mode 100644 examples/react/start-basic/src/routes/users.route.tsx
diff --git a/examples/react/start-basic/src/routeTree.gen.ts b/examples/react/start-basic/src/routeTree.gen.ts
index c7786de3e4..12ee484c06 100644
--- a/examples/react/start-basic/src/routeTree.gen.ts
+++ b/examples/react/start-basic/src/routeTree.gen.ts
@@ -17,8 +17,6 @@ import { Route as PostsImport } from './routes/posts'
import { Route as DeferredImport } from './routes/deferred'
import { Route as PathlessLayoutImport } from './routes/_pathlessLayout'
import { Route as LayoutImport } from './routes/_layout'
-import { Route as UsersRouteImport } from './routes/users.route'
-import { Route as PostsRouteImport } from './routes/posts.route'
import { Route as IndexImport } from './routes/index'
import { Route as UsersIndexImport } from './routes/users.index'
import { Route as PostsIndexImport } from './routes/posts.index'
@@ -65,18 +63,6 @@ const LayoutRoute = LayoutImport.update({
getParentRoute: () => rootRoute,
} as any)
-const UsersRouteRoute = UsersRouteImport.update({
- id: '/users',
- path: '/users',
- getParentRoute: () => rootRoute,
-} as any)
-
-const PostsRouteRoute = PostsRouteImport.update({
- id: '/posts',
- path: '/posts',
- getParentRoute: () => rootRoute,
-} as any)
-
const IndexRoute = IndexImport.update({
id: '/',
path: '/',
@@ -145,20 +131,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof IndexImport
parentRoute: typeof rootRoute
}
- '/posts': {
- id: '/posts'
- path: '/posts'
- fullPath: '/posts'
- preLoaderRoute: typeof PostsRouteImport
- parentRoute: typeof rootRoute
- }
- '/users': {
- id: '/users'
- path: '/users'
- fullPath: '/users'
- preLoaderRoute: typeof UsersRouteImport
- parentRoute: typeof rootRoute
- }
'/_layout': {
id: '/_layout'
path: ''
@@ -318,11 +290,11 @@ const UsersRouteWithChildren = UsersRoute._addFileChildren(UsersRouteChildren)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
- '/posts': typeof PostsRouteWithChildren
- '/users': typeof UsersRouteWithChildren
'': typeof PathlessLayoutNestedLayoutRouteWithChildren
'/deferred': typeof DeferredRoute
+ '/posts': typeof PostsRouteWithChildren
'/redirect': typeof RedirectRoute
+ '/users': typeof UsersRouteWithChildren
'/posts/$postId': typeof PostsPostIdRoute
'/users/$userId': typeof UsersUserIdRoute
'/posts/': typeof PostsIndexRoute
@@ -334,13 +306,13 @@ export interface FileRoutesByFullPath {
export interface FileRoutesByTo {
'/': typeof IndexRoute
- '/posts': typeof PostsIndexRoute
- '/users': typeof UsersIndexRoute
'': typeof PathlessLayoutNestedLayoutRouteWithChildren
'/deferred': typeof DeferredRoute
'/redirect': typeof RedirectRoute
'/posts/$postId': typeof PostsPostIdRoute
'/users/$userId': typeof UsersUserIdRoute
+ '/posts': typeof PostsIndexRoute
+ '/users': typeof UsersIndexRoute
'/route-a': typeof PathlessLayoutNestedLayoutRouteARoute
'/route-b': typeof PathlessLayoutNestedLayoutRouteBRoute
'/posts/$postId/deep': typeof PostsPostIdDeepRoute
@@ -349,12 +321,12 @@ export interface FileRoutesByTo {
export interface FileRoutesById {
__root__: typeof rootRoute
'/': typeof IndexRoute
- '/posts': typeof PostsRouteWithChildren
- '/users': typeof UsersRouteWithChildren
'/_layout': typeof LayoutRoute
'/_pathlessLayout': typeof PathlessLayoutRouteWithChildren
'/deferred': typeof DeferredRoute
+ '/posts': typeof PostsRouteWithChildren
'/redirect': typeof RedirectRoute
+ '/users': typeof UsersRouteWithChildren
'/_pathlessLayout/_nested-layout': typeof PathlessLayoutNestedLayoutRouteWithChildren
'/posts/$postId': typeof PostsPostIdRoute
'/users/$userId': typeof UsersUserIdRoute
@@ -369,11 +341,11 @@ export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths:
| '/'
- | '/posts'
- | '/users'
| ''
| '/deferred'
+ | '/posts'
| '/redirect'
+ | '/users'
| '/posts/$postId'
| '/users/$userId'
| '/posts/'
@@ -384,25 +356,25 @@ export interface FileRouteTypes {
fileRoutesByTo: FileRoutesByTo
to:
| '/'
- | '/posts'
- | '/users'
| ''
| '/deferred'
| '/redirect'
| '/posts/$postId'
| '/users/$userId'
+ | '/posts'
+ | '/users'
| '/route-a'
| '/route-b'
| '/posts/$postId/deep'
id:
| '__root__'
| '/'
- | '/posts'
- | '/users'
| '/_layout'
| '/_pathlessLayout'
| '/deferred'
+ | '/posts'
| '/redirect'
+ | '/users'
| '/_pathlessLayout/_nested-layout'
| '/posts/$postId'
| '/users/$userId'
@@ -416,8 +388,6 @@ export interface FileRouteTypes {
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
- PostsRouteRoute: typeof PostsRouteRoute
- UsersRouteRoute: typeof UsersRouteRoute
LayoutRoute: typeof LayoutRoute
PathlessLayoutRoute: typeof PathlessLayoutRouteWithChildren
DeferredRoute: typeof DeferredRoute
@@ -429,8 +399,6 @@ export interface RootRouteChildren {
const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
- PostsRouteRoute: PostsRouteRoute,
- UsersRouteRoute: UsersRouteRoute,
LayoutRoute: LayoutRoute,
PathlessLayoutRoute: PathlessLayoutRouteWithChildren,
DeferredRoute: DeferredRoute,
@@ -451,8 +419,6 @@ export const routeTree = rootRoute
"filePath": "__root.tsx",
"children": [
"/",
- "/posts",
- "/users",
"/_layout",
"/_pathlessLayout",
"/deferred",
@@ -465,20 +431,6 @@ export const routeTree = rootRoute
"/": {
"filePath": "index.tsx"
},
- "/posts": {
- "filePath": "posts.tsx",
- "children": [
- "/posts/$postId",
- "/posts/"
- ]
- },
- "/users": {
- "filePath": "users.tsx",
- "children": [
- "/users/$userId",
- "/users/"
- ]
- },
"/_layout": {
"filePath": "_layout.tsx"
},
@@ -491,9 +443,23 @@ export const routeTree = rootRoute
"/deferred": {
"filePath": "deferred.tsx"
},
+ "/posts": {
+ "filePath": "posts.tsx",
+ "children": [
+ "/posts/$postId",
+ "/posts/"
+ ]
+ },
"/redirect": {
"filePath": "redirect.tsx"
},
+ "/users": {
+ "filePath": "users.tsx",
+ "children": [
+ "/users/$userId",
+ "/users/"
+ ]
+ },
"/_pathlessLayout/_nested-layout": {
"filePath": "_pathlessLayout/_nested-layout.tsx",
"parent": "/_pathlessLayout",
diff --git a/examples/react/start-basic/src/routes/posts.route.tsx b/examples/react/start-basic/src/routes/posts.route.tsx
deleted file mode 100644
index f29619363e..0000000000
--- a/examples/react/start-basic/src/routes/posts.route.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from '../utils/posts'
-
-export const Route = createFileRoute('/posts')({
- loader: async () => fetchPosts(),
- component: PostsLayoutComponent,
-})
-
-function PostsLayoutComponent() {
- const posts = Route.useLoaderData()
-
- return (
-
- )
-}
diff --git a/examples/react/start-basic/src/routes/users.route.tsx b/examples/react/start-basic/src/routes/users.route.tsx
deleted file mode 100644
index 76cf588f6a..0000000000
--- a/examples/react/start-basic/src/routes/users.route.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import axios from 'redaxios'
-import { DEPLOY_URL } from '../utils/users'
-import type { User } from '../utils/users'
-
-export const Route = createFileRoute('/users')({
- loader: async () => {
- return await axios
- .get>(DEPLOY_URL + '/api/users')
- .then((r) => r.data)
- .catch(() => {
- throw new Error('Failed to fetch users')
- })
- },
- component: UsersLayoutComponent,
-})
-
-function UsersLayoutComponent() {
- const users = Route.useLoaderData()
-
- return (
-
-
- {[
- ...users,
- { id: 'i-do-not-exist', name: 'Non-existent User', email: '' },
- ].map((user) => {
- return (
-
-
- {user.name}
-
-
- )
- })}
-
-
-
-
- )
-}
From 2aa374014b9f6fdbf00c5cfdeffbf302a8dd393d Mon Sep 17 00:00:00 2001
From: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
Date: Sat, 8 Mar 2025 20:30:54 +1300
Subject: [PATCH 028/155] fix(react-router): revert experimental change about
removing the route path for `createFileRoute`
---
packages/react-router/src/fileRoute.ts | 40 +++++++++-----------------
1 file changed, 13 insertions(+), 27 deletions(-)
diff --git a/packages/react-router/src/fileRoute.ts b/packages/react-router/src/fileRoute.ts
index c72e45ca15..d645cc840d 100644
--- a/packages/react-router/src/fileRoute.ts
+++ b/packages/react-router/src/fileRoute.ts
@@ -33,33 +33,19 @@ import type { UseLoaderDepsRoute } from './useLoaderDeps'
import type { UseLoaderDataRoute } from './useLoaderData'
import type { UseRouteContextRoute } from './useRouteContext'
-type RouteInfo = {
- parentRoute: AnyRoute
- id: RouteConstraints['TId']
- path: keyof FileRoutesByPath
- fullPath: RouteConstraints['TFullPath']
-}
-
-export function createFileRoute(): FileRoute<
- TRouteInfo['path'],
- TRouteInfo['parentRoute'],
- TRouteInfo['id'],
- TRouteInfo['path'],
- TRouteInfo['fullPath']
->['createRoute'] {
- return new FileRoute<
- TRouteInfo['path'],
- TRouteInfo['parentRoute'],
- TRouteInfo['id'],
- TRouteInfo['path'],
- TRouteInfo['fullPath']
- >(
- // @ts-expect-error
- undefined,
- {
- silent: true,
- },
- ).createRoute
+export function createFileRoute<
+ TFilePath extends keyof FileRoutesByPath,
+ TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],
+ TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],
+ TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],
+ TFullPath extends
+ RouteConstraints['TFullPath'] = FileRoutesByPath[TFilePath]['fullPath'],
+>(
+ path: TFilePath,
+): FileRoute['createRoute'] {
+ return new FileRoute(path, {
+ silent: true,
+ }).createRoute
}
/**
From 18f91ad125e73038e7710c65e34be59ef2f687db Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Mon, 10 Mar 2025 00:09:14 +0100
Subject: [PATCH 029/155] remove unwanted client/ssr files
---
e2e/react-start/basic-auth/src/client.tsx | 8 --------
e2e/react-start/basic-auth/src/ssr.tsx | 12 ------------
e2e/react-start/basic-react-query/src/ssr.tsx | 12 ------------
e2e/react-start/basic-rsc/src/ssr.tsx | 12 ------------
e2e/react-start/clerk-basic/src/ssr.tsx | 16 ----------------
.../scroll-restoration/src/client.tsx | 9 ---------
e2e/react-start/scroll-restoration/src/ssr.tsx | 12 ------------
e2e/react-start/server-functions/src/ssr.tsx | 12 ------------
examples/react/start-bare/src/ssr.tsx | 12 ------------
examples/react/start-basic-auth/src/ssr.tsx | 14 --------------
.../react/start-basic-react-query/src/ssr.tsx | 14 --------------
examples/react/start-basic-rsc/src/ssr.tsx | 12 ------------
examples/react/start-basic-static/src/ssr.tsx | 13 -------------
13 files changed, 158 deletions(-)
delete mode 100644 e2e/react-start/basic-auth/src/client.tsx
delete mode 100644 e2e/react-start/basic-auth/src/ssr.tsx
delete mode 100644 e2e/react-start/basic-react-query/src/ssr.tsx
delete mode 100644 e2e/react-start/basic-rsc/src/ssr.tsx
delete mode 100644 e2e/react-start/clerk-basic/src/ssr.tsx
delete mode 100644 e2e/react-start/scroll-restoration/src/client.tsx
delete mode 100644 e2e/react-start/scroll-restoration/src/ssr.tsx
delete mode 100644 e2e/react-start/server-functions/src/ssr.tsx
delete mode 100644 examples/react/start-bare/src/ssr.tsx
delete mode 100644 examples/react/start-basic-auth/src/ssr.tsx
delete mode 100644 examples/react/start-basic-react-query/src/ssr.tsx
delete mode 100644 examples/react/start-basic-rsc/src/ssr.tsx
delete mode 100644 examples/react/start-basic-static/src/ssr.tsx
diff --git a/e2e/react-start/basic-auth/src/client.tsx b/e2e/react-start/basic-auth/src/client.tsx
deleted file mode 100644
index 1593d1b3c7..0000000000
--- a/e2e/react-start/basic-auth/src/client.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-///
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/basic-auth/src/ssr.tsx b/e2e/react-start/basic-auth/src/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/e2e/react-start/basic-auth/src/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/e2e/react-start/basic-react-query/src/ssr.tsx b/e2e/react-start/basic-react-query/src/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/e2e/react-start/basic-react-query/src/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/e2e/react-start/basic-rsc/src/ssr.tsx b/e2e/react-start/basic-rsc/src/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/e2e/react-start/basic-rsc/src/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/e2e/react-start/clerk-basic/src/ssr.tsx b/e2e/react-start/clerk-basic/src/ssr.tsx
deleted file mode 100644
index ef5ba0bc95..0000000000
--- a/e2e/react-start/clerk-basic/src/ssr.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-import { createClerkHandler } from '@clerk/tanstack-start/server'
-import { createRouter } from './router'
-
-const handler = createStartHandler({
- createRouter,
- getRouterManifest,
-})
-
-const clerkHandler = createClerkHandler(handler)
-
-export default clerkHandler(defaultStreamHandler)
diff --git a/e2e/react-start/scroll-restoration/src/client.tsx b/e2e/react-start/scroll-restoration/src/client.tsx
deleted file mode 100644
index f675b9c39d..0000000000
--- a/e2e/react-start/scroll-restoration/src/client.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-// @ts-nocheck
-
-import { hydrateRoot } from 'react-dom/client'
-import { StartClient } from '@tanstack/react-start'
-import { createRouter } from './router'
-
-const router = createRouter()
-
-hydrateRoot(document, )
diff --git a/e2e/react-start/scroll-restoration/src/ssr.tsx b/e2e/react-start/scroll-restoration/src/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/e2e/react-start/scroll-restoration/src/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/e2e/react-start/server-functions/src/ssr.tsx b/e2e/react-start/server-functions/src/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/e2e/react-start/server-functions/src/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-bare/src/ssr.tsx b/examples/react/start-bare/src/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/examples/react/start-bare/src/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-basic-auth/src/ssr.tsx b/examples/react/start-basic-auth/src/ssr.tsx
deleted file mode 100644
index cb5ab731aa..0000000000
--- a/examples/react/start-basic-auth/src/ssr.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-// src/server.tsx
-
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-basic-react-query/src/ssr.tsx b/examples/react/start-basic-react-query/src/ssr.tsx
deleted file mode 100644
index cb5ab731aa..0000000000
--- a/examples/react/start-basic-react-query/src/ssr.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-// src/server.tsx
-
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-basic-rsc/src/ssr.tsx b/examples/react/start-basic-rsc/src/ssr.tsx
deleted file mode 100644
index 65a580f25e..0000000000
--- a/examples/react/start-basic-rsc/src/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/react-start/server'
-import { getRouterManifest } from '@tanstack/react-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/examples/react/start-basic-static/src/ssr.tsx b/examples/react/start-basic-static/src/ssr.tsx
deleted file mode 100644
index db95139de1..0000000000
--- a/examples/react/start-basic-static/src/ssr.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-///
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/solid-start/server'
-import { getRouterManifest } from '@tanstack/solid-start/router-manifest'
-
-import { createRouter } from './app/router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
From 07e00db28eef5fb20764c8f9d9acb1c31a8f98d2 Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Mon, 10 Mar 2025 05:59:34 +0100
Subject: [PATCH 030/155] merge main to devinxi
---
.../src/createStartHandler.ts | 6 +-
packages/react-start-server/src/h3.ts | 490 ------------------
.../src/server-functions-handler.ts | 4 +-
packages/react-start-server/tsconfig.json | 2 +-
packages/start-server-core/src/h3.ts | 77 ++-
packages/start-server-core/src/index.tsx | 4 +-
.../src/router-manifest.ts | 0
packages/start-server-core/vite.config.ts | 1 +
pnpm-lock.yaml | 37 ++
9 files changed, 81 insertions(+), 540 deletions(-)
rename packages/{start-server-core => react-start-server}/src/createStartHandler.ts (91%)
delete mode 100644 packages/react-start-server/src/h3.ts
rename packages/{react-start-server => start-server-core}/src/router-manifest.ts (100%)
diff --git a/packages/start-server-core/src/createStartHandler.ts b/packages/react-start-server/src/createStartHandler.ts
similarity index 91%
rename from packages/start-server-core/src/createStartHandler.ts
rename to packages/react-start-server/src/createStartHandler.ts
index 83bbcb895a..2236cb4c46 100644
--- a/packages/start-server-core/src/createStartHandler.ts
+++ b/packages/react-start-server/src/createStartHandler.ts
@@ -2,10 +2,10 @@ import path from 'node:path'
import { createMemoryHistory } from '@tanstack/history'
import { mergeHeaders } from '@tanstack/start-client-core'
import { eventHandler, getResponseHeaders, toWebRequest } from 'h3'
-import { attachRouterServerSsrUtils, dehydrateRouter } from './ssr-server'
+import { getStartManifest } from '@tanstack/start-server-core'
+import { attachRouterServerSsrUtils, dehydrateRouter } from '../../start-server-core/src/ssr-server'
import serverFunctionsHandler from './server-functions-handler'
-import { getStartManifest } from './router-manifest'
-import type { HandlerCallback } from './handlerCallback'
+import type { HandlerCallback } from '../../start-server-core/src/handlerCallback'
import type { EventHandlerResponse, H3Event } from 'h3'
import type { AnyRouter } from '@tanstack/router-core'
diff --git a/packages/react-start-server/src/h3.ts b/packages/react-start-server/src/h3.ts
deleted file mode 100644
index 8e7dbc049c..0000000000
--- a/packages/react-start-server/src/h3.ts
+++ /dev/null
@@ -1,490 +0,0 @@
-import { AsyncLocalStorage } from 'node:async_hooks'
-import {
- H3Event,
- appendCorsHeaders as _appendCorsHeaders,
- appendCorsPreflightHeaders as _appendCorsPreflightHeaders,
- appendHeader as _appendHeader,
- appendHeaders as _appendHeaders,
- appendResponseHeader as _appendResponseHeader,
- appendResponseHeaders as _appendResponseHeaders,
- assertMethod as _assertMethod,
- clearResponseHeaders as _clearResponseHeaders,
- clearSession as _clearSession,
- defaultContentType as _defaultContentType,
- defineEventHandler as _defineEventHandler,
- deleteCookie as _deleteCookie,
- eventHandler as _eventHandler,
- fetchWithEvent as _fetchWithEvent,
- getCookie as _getCookie,
- getHeader as _getHeader,
- getHeaders as _getHeaders,
- getProxyRequestHeaders as _getProxyRequestHeaders,
- getQuery as _getQuery,
- getRequestFingerprint as _getRequestFingerprint,
- getRequestHeader as _getRequestHeader,
- getRequestHeaders as _getRequestHeaders,
- getRequestHost as _getRequestHost,
- getRequestIP as _getRequestIP,
- getRequestProtocol as _getRequestProtocol,
- getRequestURL as _getRequestURL,
- getRequestWebStream as _getRequestWebStream,
- getResponseHeader as _getResponseHeader,
- getResponseHeaders as _getResponseHeaders,
- getResponseStatus as _getResponseStatus,
- getResponseStatusText as _getResponseStatusText,
- getRouterParam as _getRouterParam,
- getRouterParams as _getRouterParams,
- getSession as _getSession,
- getValidatedQuery as _getValidatedQuery,
- getValidatedRouterParams as _getValidatedRouterParams,
- handleCacheHeaders as _handleCacheHeaders,
- handleCors as _handleCors,
- isMethod as _isMethod,
- isPreflightRequest as _isPreflightRequest,
- parseCookies as _parseCookies,
- proxyRequest as _proxyRequest,
- readBody as _readBody,
- readFormData as _readFormData,
- readMultipartFormData as _readMultipartFormData,
- readRawBody as _readRawBody,
- readValidatedBody as _readValidatedBody,
- removeResponseHeader as _removeResponseHeader,
- sealSession as _sealSession,
- send as _send,
- sendError as _sendError,
- sendNoContent as _sendNoContent,
- sendProxy as _sendProxy,
- sendRedirect as _sendRedirect,
- sendStream as _sendStream,
- sendWebResponse as _sendWebResponse,
- setCookie as _setCookie,
- setHeader as _setHeader,
- setHeaders as _setHeaders,
- setResponseHeader as _setResponseHeader,
- setResponseHeaders as _setResponseHeaders,
- setResponseStatus as _setResponseStatus,
- unsealSession as _unsealSession,
- updateSession as _updateSession,
- useSession as _useSession,
- writeEarlyHints as _writeEarlyHints,
-} from 'h3'
-
-import type {
- Encoding,
- EventHandler,
- HTTPHeaderName,
- InferEventInput,
- _RequestMiddleware,
- _ResponseMiddleware,
-} from 'h3'
-
-const eventStorage = new AsyncLocalStorage()
-
-function _setContext(event: H3Event, key: string, value: any) {
- event.context[key] = value
-}
-
-function _getContext(event: H3Event, key: string) {
- return event.context[key]
-}
-
-export function defineMiddleware(options: {
- onRequest?: _RequestMiddleware | Array<_RequestMiddleware>
- onBeforeResponse?: _ResponseMiddleware | Array<_ResponseMiddleware>
-}) {
- return options
-}
-
-function toWebRequestH3(event: H3Event) {
- /**
- * @type {ReadableStream | undefined}
- */
- let readableStream: ReadableStream | undefined
-
- const url = getRequestURL(event)
- const base = {
- // @ts-ignore Undici option
- duplex: 'half',
- method: event.method,
- headers: event.headers,
- }
-
- if ((event.node.req as any).body instanceof ArrayBuffer) {
- return new Request(url, {
- ...base,
- body: (event.node.req as any).body,
- })
- }
-
- return new Request(url, {
- ...base,
- get body() {
- if (readableStream) {
- return readableStream
- }
- readableStream = getRequestWebStream(event)
- return readableStream
- },
- })
-}
-
-export function toWebRequest(event: H3Event) {
- event.web ??= {
- request: toWebRequestH3(event),
- url: getRequestURL(event),
- }
- return event.web.request
-}
-
-export {
- H3Error,
- H3Event,
- MIMES,
- callNodeListener,
- createApp,
- createAppEventHandler,
- createEvent,
- createRouter,
- defineLazyEventHandler,
- defineNodeListener,
- defineNodeMiddleware,
- defineRequestMiddleware,
- defineResponseMiddleware,
- dynamicEventHandler,
- defineWebSocket,
- splitCookiesString,
- fromNodeMiddleware,
- fromPlainHandler,
- fromWebHandler,
- isError,
- isEventHandler,
- isWebResponse,
- lazyEventHandler,
- promisifyNodeListener,
- serveStatic,
- toEventHandler,
- toNodeListener,
- toPlainHandler,
- toWebHandler,
- isCorsOriginAllowed,
- isStream,
- createError,
- sanitizeStatusCode,
- sanitizeStatusMessage,
- useBase,
- type AddRouteShortcuts,
- type App,
- type AppOptions,
- type AppUse,
- type CacheConditions,
- type CreateRouterOptions,
- type Duplex,
- type DynamicEventHandler,
- type Encoding,
- type EventHandler,
- type EventHandlerObject,
- type EventHandlerRequest,
- type EventHandlerResponse,
- type H3CorsOptions,
- type H3EventContext,
- type HTTPHeaderName,
- type HTTPMethod,
- type InferEventInput,
- type InputLayer,
- type InputStack,
- type Layer,
- type LazyEventHandler,
- type Matcher,
- type MultiPartData,
- type NodeEventContext,
- type NodeListener,
- type NodeMiddleware,
- type NodePromisifiedHandler,
- type PlainHandler,
- type PlainRequest,
- type PlainResponse,
- type ProxyOptions,
- type RequestFingerprintOptions,
- type RequestHeaders,
- type RouteNode,
- type Router,
- type RouterMethod,
- type RouterUse,
- type ServeStaticOptions,
- type Session,
- type SessionConfig,
- type SessionData,
- type Stack,
- type StaticAssetMeta,
- type ValidateFunction,
- type ValidateResult,
- type WebEventContext,
- type WebHandler,
- type _RequestMiddleware,
- type _ResponseMiddleware,
-} from 'h3'
-
-export function defineEventHandler(handler: EventHandler) {
- return _defineEventHandler((event) => {
- return runWithEvent(event, () => handler(event))
- })
-}
-
-export function eventHandler(handler: EventHandler) {
- return _eventHandler((event) => {
- return runWithEvent(event, () => handler(event))
- })
-}
-
-export async function runWithEvent(
- event: H3Event,
- fn: () => T | Promise,
-): Promise {
- return eventStorage.run(event, fn)
-}
-
-export function getEvent() {
- const event = eventStorage.getStore() as H3Event | undefined
- if (!event) {
- throw new Error(
- `No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`,
- )
- }
- return event
-}
-
-export const HTTPEventSymbol = Symbol('$HTTPEvent')
-
-export function isEvent(
- obj: any,
-): obj is H3Event | { [HTTPEventSymbol]: H3Event } {
- return (
- typeof obj === 'object' &&
- (obj instanceof H3Event ||
- obj?.[HTTPEventSymbol] instanceof H3Event ||
- obj?.__is_event__ === true)
- )
- // Implement logic to check if obj is an H3Event
-}
-
-type Tail = T extends [any, ...infer U] ? U : never
-
-type PrependOverload<
- TOriginal extends (...args: Array) => any,
- TOverload extends (...args: Array) => any,
-> = TOverload & TOriginal
-
-// add an overload to the function without the event argument
-type WrapFunction) => any> = PrependOverload<
- TFn,
- (
- ...args: Parameters extends [H3Event, ...infer TArgs]
- ? TArgs
- : Parameters
- ) => ReturnType
->
-
-function createWrapperFunction) => any>(
- h3Function: TFn,
-): WrapFunction {
- return function (...args: Array) {
- const event = args[0]
- if (!isEvent(event)) {
- args.unshift(getEvent())
- } else {
- args[0] =
- event instanceof H3Event || (event as any).__is_event__
- ? event
- : event[HTTPEventSymbol]
- }
-
- return (h3Function as any)(...args)
- } as any
-}
-
-// Creating wrappers for each utility and exporting them with their original names
-type WrappedReadRawBody = (
- ...args: Tail>>
-) => ReturnType>
-export const readRawBody: PrependOverload<
- typeof _readRawBody,
- WrappedReadRawBody
-> = createWrapperFunction(_readRawBody)
-type WrappedReadBody = >(
- ...args: Tail>>
-) => ReturnType>
-export const readBody: PrependOverload =
- createWrapperFunction(_readBody)
-type WrappedGetQuery = <
- T,
- TEventInput = Exclude, undefined>,
->(
- ...args: Tail>>
-) => ReturnType>
-export const getQuery: PrependOverload =
- createWrapperFunction(_getQuery)
-export const isMethod = createWrapperFunction(_isMethod)
-export const isPreflightRequest = createWrapperFunction(_isPreflightRequest)
-type WrappedGetValidatedQuery = <
- T,
- TEventInput = InferEventInput<'query', H3Event, T>,
->(
- ...args: Tail>>
-) => ReturnType>
-export const getValidatedQuery: PrependOverload<
- typeof _getValidatedQuery,
- WrappedGetValidatedQuery
-> = createWrapperFunction(_getValidatedQuery)
-export const getRouterParams = createWrapperFunction(_getRouterParams)
-export const getRouterParam = createWrapperFunction(_getRouterParam)
-type WrappedGetValidatedRouterParams = <
- T,
- TEventInput = InferEventInput<'routerParams', H3Event, T>,
->(
- ...args: Tail<
- Parameters>
- >
-) => ReturnType>
-export const getValidatedRouterParams: PrependOverload<
- typeof _getValidatedRouterParams,
- WrappedGetValidatedRouterParams
-> = createWrapperFunction(_getValidatedRouterParams)
-export const assertMethod = createWrapperFunction(_assertMethod)
-export const getRequestHeaders = createWrapperFunction(_getRequestHeaders)
-export const getRequestHeader = createWrapperFunction(_getRequestHeader)
-export const getRequestURL = createWrapperFunction(_getRequestURL)
-export const getRequestHost = createWrapperFunction(_getRequestHost)
-export const getRequestProtocol = createWrapperFunction(_getRequestProtocol)
-export const getRequestIP = createWrapperFunction(_getRequestIP)
-export const send = createWrapperFunction(_send)
-export const sendNoContent = createWrapperFunction(_sendNoContent)
-export const setResponseStatus = createWrapperFunction(_setResponseStatus)
-export const getResponseStatus = createWrapperFunction(_getResponseStatus)
-export const getResponseStatusText = createWrapperFunction(
- _getResponseStatusText,
-)
-export const getResponseHeaders = createWrapperFunction(_getResponseHeaders)
-export const getResponseHeader = createWrapperFunction(_getResponseHeader)
-export const setResponseHeaders = createWrapperFunction(_setResponseHeaders)
-type WrappedSetResponseHeader = (
- ...args: Tail>>
-) => ReturnType>
-export const setResponseHeader: PrependOverload<
- typeof _setResponseHeader,
- WrappedSetResponseHeader
-> = createWrapperFunction(_setResponseHeader)
-export const appendResponseHeaders = createWrapperFunction(
- _appendResponseHeaders,
-)
-type WrappedAppendResponseHeader = (
- ...args: Tail>>
-) => ReturnType>
-export const appendResponseHeader: PrependOverload<
- typeof _appendResponseHeader,
- WrappedAppendResponseHeader
-> = createWrapperFunction(_appendResponseHeader)
-export const defaultContentType = createWrapperFunction(_defaultContentType)
-export const sendRedirect = createWrapperFunction(_sendRedirect)
-export const sendStream = createWrapperFunction(_sendStream)
-export const writeEarlyHints = createWrapperFunction(_writeEarlyHints)
-export const sendError = createWrapperFunction(_sendError)
-export const sendProxy = createWrapperFunction(_sendProxy)
-export const proxyRequest = createWrapperFunction(_proxyRequest)
-type WrappedFetchWithEvent = <
- T = unknown,
- TResponse = any,
- TFetch extends (req: RequestInfo | URL, opts?: any) => any = typeof fetch,
->(
- ...args: Tail>>
-) => ReturnType>
-export const fetchWithEvent: PrependOverload<
- typeof _fetchWithEvent,
- WrappedFetchWithEvent
-> = createWrapperFunction(_fetchWithEvent)
-export const getProxyRequestHeaders = createWrapperFunction(
- _getProxyRequestHeaders,
-)
-
-export const parseCookies = createWrapperFunction(_parseCookies)
-export const getCookie = createWrapperFunction(_getCookie)
-export const setCookie = createWrapperFunction(_setCookie)
-export const deleteCookie = createWrapperFunction(_deleteCookie)
-// not exported :(
-type SessionDataT = Record
-type WrappedUseSession = (
- ...args: Tail>>
-) => ReturnType>
-// we need to `as` these because the WrapFunction doesn't work for them
-// because they also accept CompatEvent instead of H3Event
-export const useSession = createWrapperFunction(_useSession) as PrependOverload<
- typeof _useSession,
- WrappedUseSession
->
-type WrappedGetSession = (
- ...args: Tail>>
-) => ReturnType>
-export const getSession = createWrapperFunction(_getSession) as PrependOverload<
- typeof _getSession,
- WrappedGetSession
->
-type WrappedUpdateSession = (
- ...args: Tail>>
-) => ReturnType>
-export const updateSession: PrependOverload<
- typeof _updateSession,
- WrappedUpdateSession
-> = createWrapperFunction(_updateSession)
-type WrappedSealSession = (
- ...args: Tail>>
-) => ReturnType>
-export const sealSession = createWrapperFunction(
- _sealSession,
-) as PrependOverload
-export const unsealSession = createWrapperFunction(_unsealSession)
-export const clearSession = createWrapperFunction(_clearSession)
-export const handleCacheHeaders = createWrapperFunction(_handleCacheHeaders)
-export const handleCors = createWrapperFunction(_handleCors)
-export const appendCorsHeaders = createWrapperFunction(_appendCorsHeaders)
-export const appendCorsPreflightHeaders = createWrapperFunction(
- _appendCorsPreflightHeaders,
-)
-export const sendWebResponse = createWrapperFunction(_sendWebResponse)
-type WrappedAppendHeader = (
- ...args: Tail>>
-) => ReturnType>
-export const appendHeader: PrependOverload<
- typeof _appendHeader,
- WrappedAppendHeader
-> = createWrapperFunction(_appendHeader)
-export const appendHeaders = createWrapperFunction(_appendHeaders)
-type WrappedSetHeader = (
- ...args: Tail>>
-) => ReturnType>
-export const setHeader: PrependOverload =
- createWrapperFunction(_setHeader)
-export const setHeaders = createWrapperFunction(_setHeaders)
-export const getHeader = createWrapperFunction(_getHeader)
-export const getHeaders = createWrapperFunction(_getHeaders)
-export const getRequestFingerprint = createWrapperFunction(
- _getRequestFingerprint,
-)
-export const getRequestWebStream = createWrapperFunction(_getRequestWebStream)
-export const readFormData = createWrapperFunction(_readFormData)
-export const readMultipartFormData = createWrapperFunction(
- _readMultipartFormData,
-)
-type WrappedReadValidatedBody = <
- T,
- TEventInput = InferEventInput<'body', H3Event, T>,
->(
- ...args: Tail>>
-) => ReturnType>
-export const readValidatedBody: PrependOverload<
- typeof _readValidatedBody,
- WrappedReadValidatedBody
-> = createWrapperFunction(_readValidatedBody)
-export const removeResponseHeader = createWrapperFunction(_removeResponseHeader)
-export const getContext = createWrapperFunction(_getContext)
-export const setContext = createWrapperFunction(_setContext)
-export const clearResponseHeaders = createWrapperFunction(_clearResponseHeaders)
-export const getWebRequest = createWrapperFunction(toWebRequest)
diff --git a/packages/react-start-server/src/server-functions-handler.ts b/packages/react-start-server/src/server-functions-handler.ts
index 72e083c124..6129c1bc52 100644
--- a/packages/react-start-server/src/server-functions-handler.ts
+++ b/packages/react-start-server/src/server-functions-handler.ts
@@ -2,8 +2,8 @@ import { invariant, isNotFound, isRedirect } from '@tanstack/react-router'
import { startSerializer } from '@tanstack/start-client-core'
// @ts-expect-error
import _serverFnManifest from 'tsr:server-fn-manifest'
-import { eventHandler, getEvent, getResponseStatus, toWebRequest } from './h3'
-import type { H3Event } from './h3'
+import { eventHandler, getEvent, getResponseStatus, toWebRequest } from '../../start-server-core/src/h3'
+import type { H3Event } from '../../start-server-core/src/h3'
// NOTE: This is a dummy export to silence warnings about
// only having a default export.
diff --git a/packages/react-start-server/tsconfig.json b/packages/react-start-server/tsconfig.json
index 108c78712f..e4271c4d64 100644
--- a/packages/react-start-server/tsconfig.json
+++ b/packages/react-start-server/tsconfig.json
@@ -4,5 +4,5 @@
"jsx": "react-jsx",
"module": "esnext"
},
- "include": ["src", "tests", "vite.config.ts"]
+ "include": ["src", "tests", "vite.config.ts", "../start-server-core/src/router-manifest.ts", "../start-server-core/src/h3.ts"]
}
diff --git a/packages/start-server-core/src/h3.ts b/packages/start-server-core/src/h3.ts
index d5a2c94844..8e7dbc049c 100644
--- a/packages/start-server-core/src/h3.ts
+++ b/packages/start-server-core/src/h3.ts
@@ -11,7 +11,9 @@ import {
clearResponseHeaders as _clearResponseHeaders,
clearSession as _clearSession,
defaultContentType as _defaultContentType,
+ defineEventHandler as _defineEventHandler,
deleteCookie as _deleteCookie,
+ eventHandler as _eventHandler,
fetchWithEvent as _fetchWithEvent,
getCookie as _getCookie,
getHeader as _getHeader,
@@ -66,15 +68,18 @@ import {
useSession as _useSession,
writeEarlyHints as _writeEarlyHints,
} from 'h3'
-import { getContext as getUnctxContext } from 'unctx'
+
import type {
Encoding,
+ EventHandler,
HTTPHeaderName,
InferEventInput,
_RequestMiddleware,
_ResponseMiddleware,
} from 'h3'
+const eventStorage = new AsyncLocalStorage()
+
function _setContext(event: H3Event, key: string, value: any) {
event.context[key] = value
}
@@ -140,7 +145,6 @@ export {
createAppEventHandler,
createEvent,
createRouter,
- defineEventHandler,
defineLazyEventHandler,
defineNodeListener,
defineNodeMiddleware,
@@ -148,7 +152,6 @@ export {
defineResponseMiddleware,
dynamicEventHandler,
defineWebSocket,
- eventHandler,
splitCookiesString,
fromNodeMiddleware,
fromPlainHandler,
@@ -221,8 +224,33 @@ export {
type _ResponseMiddleware,
} from 'h3'
-function getHTTPEvent() {
- return getEvent()
+export function defineEventHandler(handler: EventHandler) {
+ return _defineEventHandler((event) => {
+ return runWithEvent(event, () => handler(event))
+ })
+}
+
+export function eventHandler(handler: EventHandler) {
+ return _eventHandler((event) => {
+ return runWithEvent(event, () => handler(event))
+ })
+}
+
+export async function runWithEvent(
+ event: H3Event,
+ fn: () => T | Promise,
+): Promise {
+ return eventStorage.run(event, fn)
+}
+
+export function getEvent() {
+ const event = eventStorage.getStore() as H3Event | undefined
+ if (!event) {
+ throw new Error(
+ `No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`,
+ )
+ }
+ return event
}
export const HTTPEventSymbol = Symbol('$HTTPEvent')
@@ -262,12 +290,7 @@ function createWrapperFunction) => any>(
return function (...args: Array) {
const event = args[0]
if (!isEvent(event)) {
- if (!(globalThis as any).app.config.server.experimental?.asyncContext) {
- throw new Error(
- 'AsyncLocalStorage was not enabled. Use the `server.experimental.asyncContext: true` option in your app configuration to enable it. Or, pass the instance of HTTPEvent that you have as the first argument to the function.',
- )
- }
- args.unshift(getHTTPEvent())
+ args.unshift(getEvent())
} else {
args[0] =
event instanceof H3Event || (event as any).__is_event__
@@ -463,37 +486,5 @@ export const readValidatedBody: PrependOverload<
export const removeResponseHeader = createWrapperFunction(_removeResponseHeader)
export const getContext = createWrapperFunction(_getContext)
export const setContext = createWrapperFunction(_setContext)
-
export const clearResponseHeaders = createWrapperFunction(_clearResponseHeaders)
-
export const getWebRequest = createWrapperFunction(toWebRequest)
-
-export { createApp as createServer } from 'h3'
-
-function getNitroAsyncContext() {
- const nitroAsyncContext = getUnctxContext('nitro-app', {
- asyncContext: (globalThis as any).app.config.server.experimental
- ?.asyncContext
- ? true
- : false,
- AsyncLocalStorage,
- })
-
- return nitroAsyncContext
-}
-
-export function getEvent() {
- const event = (getNitroAsyncContext().use() as any).event as
- | H3Event
- | undefined
- if (!event) {
- throw new Error(
- `No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`,
- )
- }
- return event
-}
-
-export async function handleHTTPEvent(event: H3Event) {
- return await (globalThis as any).$handle(event)
-}
diff --git a/packages/start-server-core/src/index.tsx b/packages/start-server-core/src/index.tsx
index d24477934d..072fbeb051 100644
--- a/packages/start-server-core/src/index.tsx
+++ b/packages/start-server-core/src/index.tsx
@@ -3,9 +3,11 @@ export {
transformPipeableStreamWithRouter,
} from './transformStreamWithRouter'
-export { createStartHandler } from './createStartHandler'
+// export { createStartHandler } from './createStartHandler'
export { createRequestHandler } from './createRequestHandler'
+export { getStartManifest } from './router-manifest'
+
export { defineHandlerCallback } from './handlerCallback'
export type { HandlerCallback } from './handlerCallback'
diff --git a/packages/react-start-server/src/router-manifest.ts b/packages/start-server-core/src/router-manifest.ts
similarity index 100%
rename from packages/react-start-server/src/router-manifest.ts
rename to packages/start-server-core/src/router-manifest.ts
diff --git a/packages/start-server-core/vite.config.ts b/packages/start-server-core/vite.config.ts
index 71f9948e0a..99f7062bb5 100644
--- a/packages/start-server-core/vite.config.ts
+++ b/packages/start-server-core/vite.config.ts
@@ -18,5 +18,6 @@ export default mergeConfig(
tanstackViteConfig({
srcDir: './src',
entry: './src/index.tsx',
+ externalDeps: ['tsr:server-fn-manifest', 'tsr:start-manifest'],
}),
)
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 32c7ee5a54..0dea5fe477 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -6669,6 +6669,43 @@ importers:
specifier: ^1.0.3
version: 1.0.3
+ packages/start-server-core:
+ dependencies:
+ '@tanstack/history':
+ specifier: workspace:*
+ version: link:../history
+ '@tanstack/router-core':
+ specifier: workspace:*
+ version: link:../router-core
+ '@tanstack/start-client-core':
+ specifier: workspace:*
+ version: link:../start-client-core
+ h3:
+ specifier: 1.13.0
+ version: 1.13.0
+ isbot:
+ specifier: ^5.1.22
+ version: 5.1.22
+ jsesc:
+ specifier: ^3.1.0
+ version: 3.1.0
+ tiny-warning:
+ specifier: ^1.0.3
+ version: 1.0.3
+ unctx:
+ specifier: ^2.4.1
+ version: 2.4.1
+ devDependencies:
+ '@types/jsesc':
+ specifier: ^3.0.3
+ version: 3.0.3
+ esbuild:
+ specifier: ^0.25.0
+ version: 0.25.0
+ typescript:
+ specifier: ^5.7.2
+ version: 5.8.2
+
packages/start-server-functions-server:
dependencies:
'@tanstack/server-functions-plugin':
From 59b92ec4f2ba5e27e1e47c8dc325cd8b77540816 Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Mon, 10 Mar 2025 06:03:49 +0100
Subject: [PATCH 031/155] fix imports from ssr-server
---
packages/react-start-server/src/createStartHandler.ts | 9 ++++++---
.../react-start-server/src/server-functions-handler.ts | 4 ++--
packages/start-server-core/src/index.tsx | 2 ++
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/packages/react-start-server/src/createStartHandler.ts b/packages/react-start-server/src/createStartHandler.ts
index 2236cb4c46..789c068ab0 100644
--- a/packages/react-start-server/src/createStartHandler.ts
+++ b/packages/react-start-server/src/createStartHandler.ts
@@ -2,10 +2,13 @@ import path from 'node:path'
import { createMemoryHistory } from '@tanstack/history'
import { mergeHeaders } from '@tanstack/start-client-core'
import { eventHandler, getResponseHeaders, toWebRequest } from 'h3'
-import { getStartManifest } from '@tanstack/start-server-core'
-import { attachRouterServerSsrUtils, dehydrateRouter } from '../../start-server-core/src/ssr-server'
+import {
+ attachRouterServerSsrUtils,
+ dehydrateRouter,
+ getStartManifest,
+} from '@tanstack/start-server-core'
import serverFunctionsHandler from './server-functions-handler'
-import type { HandlerCallback } from '../../start-server-core/src/handlerCallback'
+import type { HandlerCallback } from '@tanstack/start-server-core'
import type { EventHandlerResponse, H3Event } from 'h3'
import type { AnyRouter } from '@tanstack/router-core'
diff --git a/packages/react-start-server/src/server-functions-handler.ts b/packages/react-start-server/src/server-functions-handler.ts
index 6129c1bc52..2fada415d8 100644
--- a/packages/react-start-server/src/server-functions-handler.ts
+++ b/packages/react-start-server/src/server-functions-handler.ts
@@ -2,8 +2,8 @@ import { invariant, isNotFound, isRedirect } from '@tanstack/react-router'
import { startSerializer } from '@tanstack/start-client-core'
// @ts-expect-error
import _serverFnManifest from 'tsr:server-fn-manifest'
-import { eventHandler, getEvent, getResponseStatus, toWebRequest } from '../../start-server-core/src/h3'
-import type { H3Event } from '../../start-server-core/src/h3'
+import { eventHandler, getEvent, getResponseStatus, toWebRequest } from '@tanstack/start-server-core'
+import type { H3Event } from '@tanstack/start-server-core'
// NOTE: This is a dummy export to silence warnings about
// only having a default export.
diff --git a/packages/start-server-core/src/index.tsx b/packages/start-server-core/src/index.tsx
index 072fbeb051..a2a239bee4 100644
--- a/packages/start-server-core/src/index.tsx
+++ b/packages/start-server-core/src/index.tsx
@@ -11,4 +11,6 @@ export { getStartManifest } from './router-manifest'
export { defineHandlerCallback } from './handlerCallback'
export type { HandlerCallback } from './handlerCallback'
+export { attachRouterServerSsrUtils, dehydrateRouter } from './ssr-server'
+
export * from './h3'
From 3e57adedec1c0b6952a7ac0f084bd4b7c2ea5777 Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Mon, 10 Mar 2025 06:04:51 +0100
Subject: [PATCH 032/155] format
---
.../react-start-server/src/server-functions-handler.ts | 7 ++++++-
packages/react-start-server/tsconfig.json | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/packages/react-start-server/src/server-functions-handler.ts b/packages/react-start-server/src/server-functions-handler.ts
index 2fada415d8..b744f19754 100644
--- a/packages/react-start-server/src/server-functions-handler.ts
+++ b/packages/react-start-server/src/server-functions-handler.ts
@@ -2,7 +2,12 @@ import { invariant, isNotFound, isRedirect } from '@tanstack/react-router'
import { startSerializer } from '@tanstack/start-client-core'
// @ts-expect-error
import _serverFnManifest from 'tsr:server-fn-manifest'
-import { eventHandler, getEvent, getResponseStatus, toWebRequest } from '@tanstack/start-server-core'
+import {
+ eventHandler,
+ getEvent,
+ getResponseStatus,
+ toWebRequest,
+} from '@tanstack/start-server-core'
import type { H3Event } from '@tanstack/start-server-core'
// NOTE: This is a dummy export to silence warnings about
diff --git a/packages/react-start-server/tsconfig.json b/packages/react-start-server/tsconfig.json
index e4271c4d64..108c78712f 100644
--- a/packages/react-start-server/tsconfig.json
+++ b/packages/react-start-server/tsconfig.json
@@ -4,5 +4,5 @@
"jsx": "react-jsx",
"module": "esnext"
},
- "include": ["src", "tests", "vite.config.ts", "../start-server-core/src/router-manifest.ts", "../start-server-core/src/h3.ts"]
+ "include": ["src", "tests", "vite.config.ts"]
}
From 325ec8c3ef1fc1427e3d104cae3550b5810be893 Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Mon, 10 Mar 2025 06:24:30 +0100
Subject: [PATCH 033/155] fix lockfile
---
pnpm-lock.yaml | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 57e3a77489..95ec8ad9e6 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -5725,19 +5725,6 @@ importers:
specifier: ^0.25.0
version: 0.25.0
- packages/react-start-api-routes:
- dependencies:
- '@tanstack/react-start-server':
- specifier: workspace:*
- version: link:../react-start-server
- '@tanstack/router-core':
- specifier: workspace:*
- version: link:../router-core
- devDependencies:
- typescript:
- specifier: ^5.7.2
- version: 5.8.2
-
packages/react-start-client:
dependencies:
'@tanstack/react-router':
@@ -6631,6 +6618,9 @@ importers:
'@tanstack/react-start-server-functions-ssr':
specifier: workspace:*
version: link:../react-start-server-functions-ssr
+ '@tanstack/start-api-routes':
+ specifier: workspace:*
+ version: link:../start-api-routes
'@tanstack/start-server-functions-server':
specifier: workspace:*
version: link:../start-server-functions-server
@@ -6643,9 +6633,6 @@ importers:
'@tanstack/start-server-core':
specifier: workspace:*
version: link:../start-server-core
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
devDependencies:
typescript:
specifier: ^5.7.2
From caad30ce318f4979982a63a8bc807eebecd69bdf Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Mon, 10 Mar 2025 12:03:29 +0100
Subject: [PATCH 034/155] delete handler
---
packages/react-start-server/package.json | 1 +
.../start-server-functions-handler/README.md | 33 --
.../eslint.config.js | 20 --
.../package.json | 73 ----
.../src/index.ts | 323 ------------------
5 files changed, 1 insertion(+), 449 deletions(-)
delete mode 100644 packages/start-server-functions-handler/README.md
delete mode 100644 packages/start-server-functions-handler/eslint.config.js
delete mode 100644 packages/start-server-functions-handler/package.json
delete mode 100644 packages/start-server-functions-handler/src/index.ts
diff --git a/packages/react-start-server/package.json b/packages/react-start-server/package.json
index 8db5e6fea0..d06ea43dc0 100644
--- a/packages/react-start-server/package.json
+++ b/packages/react-start-server/package.json
@@ -68,6 +68,7 @@
"@tanstack/start-client-core": "workspace:^",
"@tanstack/start-server-core": "workspace:^",
"tiny-warning": "^1.0.3",
+ "tiny-invariant": "^1.3.3",
"h3": "1.13.0",
"isbot": "^5.1.22",
"jsesc": "^3.1.0",
diff --git a/packages/start-server-functions-handler/README.md b/packages/start-server-functions-handler/README.md
deleted file mode 100644
index bb009b0c87..0000000000
--- a/packages/start-server-functions-handler/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-> 🤫 we're cooking up something special!
-
-
-
-# TanStack Start
-
-
-
-🤖 Type-safe router w/ built-in caching & URL state management for React!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Query](https://github.com/tannerlinsley/react-query), [React Table](https://github.com/tanstack/react-table), [React Charts](https://github.com/tannerlinsley/react-charts), [React Virtual](https://github.com/tannerlinsley/react-virtual)
-
-## Visit [tanstack.com/router](https://tanstack.com/router) for docs, guides, API and more!
diff --git a/packages/start-server-functions-handler/eslint.config.js b/packages/start-server-functions-handler/eslint.config.js
deleted file mode 100644
index bd7118fa1a..0000000000
--- a/packages/start-server-functions-handler/eslint.config.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// @ts-check
-
-import rootConfig from '../../eslint.config.js'
-
-export default [
- ...rootConfig,
- {
- files: ['**/*.{ts,tsx}'],
- },
- {
- plugins: {},
- rules: {},
- },
- {
- files: ['**/__tests__/**'],
- rules: {
- '@typescript-eslint/no-unnecessary-condition': 'off',
- },
- },
-]
diff --git a/packages/start-server-functions-handler/package.json b/packages/start-server-functions-handler/package.json
deleted file mode 100644
index bd424aaea9..0000000000
--- a/packages/start-server-functions-handler/package.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "name": "@tanstack/start-server-functions-handler",
- "version": "1.114.10",
- "description": "Modern and scalable routing for applications",
- "author": "Tanner Linsley",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/TanStack/router.git",
- "directory": "packages/start-server-functions-handler"
- },
- "homepage": "https://tanstack.com/start",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/tannerlinsley"
- },
- "keywords": [
- "react",
- "location",
- "router",
- "routing",
- "async",
- "async router",
- "typescript"
- ],
- "scripts": {
- "clean": "rimraf ./dist && rimraf ./coverage",
- "test": "pnpm test:eslint && pnpm test:types && pnpm test:build && pnpm test:unit",
- "test:unit": "exit 0; vitest",
- "test:eslint": "eslint ./src",
- "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"",
- "test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
- "test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
- "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js",
- "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js",
- "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js",
- "test:types:ts58": "tsc",
- "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
- "build": "vite build"
- },
- "type": "module",
- "types": "dist/esm/index.d.ts",
- "exports": {
- ".": {
- "import": {
- "types": "./dist/esm/index.d.ts",
- "default": "./dist/esm/index.js"
- },
- "require": {
- "types": "./dist/cjs/index.d.cts",
- "default": "./dist/cjs/index.cjs"
- }
- },
- "./package.json": "./package.json"
- },
- "sideEffects": false,
- "files": [
- "dist",
- "src"
- ],
- "engines": {
- "node": ">=12"
- },
- "dependencies": {
- "@tanstack/router-core": "workspace:^",
- "@tanstack/start-client-core": "workspace:^",
- "@tanstack/start-server-core": "workspace:^",
- "tiny-invariant": "^1.3.3"
- },
- "devDependencies": {
- "typescript": "^5.7.2"
- }
-}
diff --git a/packages/start-server-functions-handler/src/index.ts b/packages/start-server-functions-handler/src/index.ts
deleted file mode 100644
index be2f992bf3..0000000000
--- a/packages/start-server-functions-handler/src/index.ts
+++ /dev/null
@@ -1,323 +0,0 @@
-<<<<<<<< HEAD:packages/react-start-server/src/server-functions-handler.ts
-import { invariant, isNotFound, isRedirect } from '@tanstack/react-router'
-import { startSerializer } from '@tanstack/start-client-core'
-// @ts-expect-error
-import _serverFnManifest from 'tsr:server-fn-manifest'
-========
-import { isNotFound, isRedirect } from '@tanstack/router-core'
-import invariant from 'tiny-invariant'
->>>>>>>> main:packages/start-server-functions-handler/src/index.ts
-import {
- eventHandler,
- getEvent,
- getResponseStatus,
- toWebRequest,
-} from '@tanstack/start-server-core'
-<<<<<<<< HEAD:packages/react-start-server/src/server-functions-handler.ts
-========
-import { startSerializer } from '@tanstack/start-client-core'
-// @ts-expect-error
-import _serverFnManifest from 'tsr:server-fn-manifest'
->>>>>>>> main:packages/start-server-functions-handler/src/index.ts
-import type { H3Event } from '@tanstack/start-server-core'
-
-// NOTE: This is a dummy export to silence warnings about
-// only having a default export.
-export const dummy = 2
-
-export default eventHandler(handleServerAction)
-
-const serverFnManifest = _serverFnManifest as Record<
- string,
- {
- functionName: string
- extractedFilename: string
- importer: () => Promise
- }
->
-
-async function handleServerAction(event: H3Event) {
- const request = toWebRequest(event)!
-
- const response = await handleServerRequest({
- request,
- event,
- })
- return response
-}
-
-function sanitizeBase(base: string | undefined) {
- if (!base) {
- throw new Error(
- '🚨 process.env.TSS_SERVER_FN_BASE is required in start/server-handler/index',
- )
- }
-
- return base.replace(/^\/|\/$/g, '')
-}
-
-async function handleServerRequest({
- request,
- event,
-}: {
- request: Request
- event: H3Event
-}) {
- const controller = new AbortController()
- const signal = controller.signal
- const abort = () => controller.abort()
- event.node.req.on('close', abort)
-
- const method = request.method
- const url = new URL(request.url, 'http://localhost:3000')
- // extract the serverFnId from the url as host/_server/:serverFnId
- // Define a regex to match the path and extract the :thing part
- const regex = new RegExp(
- `${sanitizeBase(process.env.TSS_SERVER_FN_BASE)}/([^/?#]+)`,
- )
-
- // Execute the regex
- const match = url.pathname.match(regex)
- const serverFnId = match ? match[1] : null
- const search = Object.fromEntries(url.searchParams.entries()) as {
- payload?: any
- createServerFn?: boolean
- }
-
- const isCreateServerFn = 'createServerFn' in search
- const isRaw = 'raw' in search
-
- if (typeof serverFnId !== 'string') {
- throw new Error('Invalid server action param for serverFnId: ' + serverFnId)
- }
-
- const serverFnInfo = serverFnManifest[serverFnId]
-
- if (!serverFnInfo) {
- console.log('serverFnManifest', serverFnManifest)
- throw new Error('Server function info not found for ' + serverFnId)
- }
-
- if (process.env.NODE_ENV === 'development')
- console.info(`\nServerFn Request: ${serverFnId}`)
-
- let fnModule: undefined | { [key: string]: any }
-
- if (process.env.NODE_ENV === 'development') {
- const serverEnv = (globalThis as any).viteDevServer.environments['server']
- if (!serverEnv) {
- throw new Error(`'server' vite dev environment not found`)
- }
- fnModule = await serverEnv.runner.import(serverFnInfo.extractedFilename)
- } else {
- fnModule = await serverFnInfo.importer()
- }
-
- if (!fnModule) {
- console.log('serverFnInfo', serverFnInfo)
- throw new Error('Server function module not resolved for ' + serverFnId)
- }
-
- const action = fnModule[serverFnInfo.functionName]
-
- if (!action) {
- console.log('serverFnInfo', serverFnInfo)
- console.log('fnModule', fnModule)
- throw new Error(
- `Server function module export not resolved for serverFn ID: ${serverFnId}`,
- )
- }
-
- // Known FormData 'Content-Type' header values
- const formDataContentTypes = [
- 'multipart/form-data',
- 'application/x-www-form-urlencoded',
- ]
-
- const response = await (async () => {
- try {
- let result = await (async () => {
- // FormData
- if (
- request.headers.get('Content-Type') &&
- formDataContentTypes.some((type) =>
- request.headers.get('Content-Type')?.includes(type),
- )
- ) {
- // We don't support GET requests with FormData payloads... that seems impossible
- invariant(
- method.toLowerCase() !== 'get',
- 'GET requests with FormData payloads are not supported',
- )
-
- return await action(await request.formData(), signal)
- }
-
- // Get requests use the query string
- if (method.toLowerCase() === 'get') {
- // By default the payload is the search params
- let payload: any = search
-
- // If this GET request was created by createServerFn,
- // then the payload will be on the payload param
- if (isCreateServerFn) {
- payload = search.payload
- }
-
- // If there's a payload, we should try to parse it
- payload = payload ? startSerializer.parse(payload) : payload
-
- // Send it through!
- return await action(payload, signal)
- }
-
- // This must be a POST request, likely JSON???
- const jsonPayloadAsString = await request.text()
-
- // We should probably try to deserialize the payload
- // as JSON, but we'll just pass it through for now.
- const payload = startSerializer.parse(jsonPayloadAsString)
-
- // If this POST request was created by createServerFn,
- // it's payload will be the only argument
- if (isCreateServerFn) {
- return await action(payload, signal)
- }
-
- // Otherwise, we'll spread the payload. Need to
- // support `use server` functions that take multiple
- // arguments.
- return await action(...(payload as any), signal)
- })()
-
- // Any time we get a Response back, we should just
- // return it immediately.
- if (result.result instanceof Response) {
- return result.result
- }
-
- // If this is a non createServerFn request, we need to
- // pull out the result from the result object
- if (!isCreateServerFn) {
- result = result.result
-
- // The result might again be a response,
- // and if it is, return it.
- if (result instanceof Response) {
- return result
- }
- }
-
- // if (!search.createServerFn) {
- // result = result.result
- // }
-
- // else if (
- // isPlainObject(result) &&
- // 'result' in result &&
- // result.result instanceof Response
- // ) {
- // return result.result
- // }
-
- // TODO: RSCs Where are we getting this package?
- // if (isValidElement(result)) {
- // const { renderToPipeableStream } = await import(
- // // @ts-expect-error
- // 'react-server-dom/server'
- // )
-
- // const pipeableStream = renderToPipeableStream(result)
-
- // setHeaders(event, {
- // 'Content-Type': 'text/x-component',
- // } as any)
-
- // sendStream(event, response)
- // event._handled = true
-
- // return new Response(null, { status: 200 })
- // }
-
- if (isRedirect(result) || isNotFound(result)) {
- return redirectOrNotFoundResponse(result)
- }
-
- return new Response(
- result !== undefined ? startSerializer.stringify(result) : undefined,
- {
- status: getResponseStatus(getEvent()),
- headers: {
- 'Content-Type': 'application/json',
- },
- },
- )
- } catch (error: any) {
- if (error instanceof Response) {
- return error
- }
- // else if (
- // isPlainObject(error) &&
- // 'result' in error &&
- // error.result instanceof Response
- // ) {
- // return error.result
- // }
-
- // Currently this server-side context has no idea how to
- // build final URLs, so we need to defer that to the client.
- // The client will check for __redirect and __notFound keys,
- // and if they exist, it will handle them appropriately.
-
- if (isRedirect(error) || isNotFound(error)) {
- return redirectOrNotFoundResponse(error)
- }
-
- console.info()
- console.info('Server Fn Error!')
- console.info()
- console.error(error)
- console.info()
-
- return new Response(startSerializer.stringify(error), {
- status: 500,
- headers: {
- 'Content-Type': 'application/json',
- },
- })
- }
- })()
- event.node.req.removeListener('close', abort)
-
- if (isRaw) {
- return response
- }
- if (process.env.NODE_ENV === 'development')
- console.info(`ServerFn Response: ${response.status}`)
-
- if (response.headers.get('Content-Type') === 'application/json') {
- const cloned = response.clone()
- const text = await cloned.text()
- const payload = text ? JSON.stringify(JSON.parse(text)) : 'undefined'
-
- if (process.env.NODE_ENV === 'development')
- console.info(
- ` - Payload: ${payload.length > 100 ? payload.substring(0, 100) + '...' : payload}`,
- )
- }
- if (process.env.NODE_ENV === 'development') console.info()
-
- return response
-}
-
-function redirectOrNotFoundResponse(error: any) {
- const { headers, ...rest } = error
-
- return new Response(JSON.stringify(rest), {
- status: 200,
- headers: {
- 'Content-Type': 'application/json',
- ...(headers || {}),
- },
- })
-}
From 01d22a35468bc43727a2fe87fd0d811af8374181 Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Mon, 10 Mar 2025 12:10:34 +0100
Subject: [PATCH 035/155] catch up some for solid-start
---
packages/solid-start-config/README.md | 33 -
packages/solid-start-config/eslint.config.js | 31 -
packages/solid-start-config/package.json | 72 --
packages/solid-start-config/src/index.ts | 672 ------------------
packages/solid-start-config/src/schema.ts | 194 -----
.../src/vinxi-file-router.ts | 87 ---
packages/solid-start-config/tsconfig.json | 10 -
.../solid-start-router-manifest/README.md | 33 -
.../eslint.config.js | 31 -
.../solid-start-router-manifest/src/index.ts | 83 ---
.../solid-start-router-manifest/tsconfig.json | 10 -
.../vite.config.ts | 22 -
packages/solid-start/package.json | 24 +-
packages/solid-start/src/config.tsx | 1 -
packages/solid-start/src/plugin.tsx | 1 +
packages/solid-start/src/router-manifest.tsx | 1 -
.../src/server-functions-handler.tsx | 1 -
packages/solid-start/vite.config.ts | 6 +-
.../package.json | 25 +-
pnpm-lock.yaml | 177 +----
20 files changed, 35 insertions(+), 1479 deletions(-)
delete mode 100644 packages/solid-start-config/README.md
delete mode 100644 packages/solid-start-config/eslint.config.js
delete mode 100644 packages/solid-start-config/package.json
delete mode 100644 packages/solid-start-config/src/index.ts
delete mode 100644 packages/solid-start-config/src/schema.ts
delete mode 100644 packages/solid-start-config/src/vinxi-file-router.ts
delete mode 100644 packages/solid-start-config/tsconfig.json
delete mode 100644 packages/solid-start-router-manifest/README.md
delete mode 100644 packages/solid-start-router-manifest/eslint.config.js
delete mode 100644 packages/solid-start-router-manifest/src/index.ts
delete mode 100644 packages/solid-start-router-manifest/tsconfig.json
delete mode 100644 packages/solid-start-router-manifest/vite.config.ts
delete mode 100644 packages/solid-start/src/config.tsx
create mode 100644 packages/solid-start/src/plugin.tsx
delete mode 100644 packages/solid-start/src/router-manifest.tsx
delete mode 100644 packages/solid-start/src/server-functions-handler.tsx
rename packages/{solid-start-router-manifest => start-server-functions-ssr}/package.json (73%)
diff --git a/packages/solid-start-config/README.md b/packages/solid-start-config/README.md
deleted file mode 100644
index bb009b0c87..0000000000
--- a/packages/solid-start-config/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-> 🤫 we're cooking up something special!
-
-
-
-# TanStack Start
-
-
-
-🤖 Type-safe router w/ built-in caching & URL state management for React!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Query](https://github.com/tannerlinsley/react-query), [React Table](https://github.com/tanstack/react-table), [React Charts](https://github.com/tannerlinsley/react-charts), [React Virtual](https://github.com/tannerlinsley/react-virtual)
-
-## Visit [tanstack.com/router](https://tanstack.com/router) for docs, guides, API and more!
diff --git a/packages/solid-start-config/eslint.config.js b/packages/solid-start-config/eslint.config.js
deleted file mode 100644
index 931f0ec774..0000000000
--- a/packages/solid-start-config/eslint.config.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// @ts-check
-
-import pluginReact from '@eslint-react/eslint-plugin'
-import pluginReactHooks from 'eslint-plugin-react-hooks'
-import rootConfig from '../../eslint.config.js'
-
-export default [
- ...rootConfig,
- {
- ...pluginReact.configs.recommended,
- files: ['**/*.{ts,tsx}'],
- },
- {
- plugins: {
- 'react-hooks': pluginReactHooks,
- },
- rules: {
- '@eslint-react/no-unstable-context-value': 'off',
- '@eslint-react/no-unstable-default-props': 'off',
- '@eslint-react/dom/no-missing-button-type': 'off',
- 'react-hooks/exhaustive-deps': 'error',
- 'react-hooks/rules-of-hooks': 'error',
- },
- },
- {
- files: ['**/__tests__/**'],
- rules: {
- '@typescript-eslint/no-unnecessary-condition': 'off',
- },
- },
-]
diff --git a/packages/solid-start-config/package.json b/packages/solid-start-config/package.json
deleted file mode 100644
index cb516ba9d6..0000000000
--- a/packages/solid-start-config/package.json
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- "name": "@tanstack/solid-start-config",
- "version": "1.109.2",
- "description": "Modern and scalable routing for React applications",
- "author": "Tanner Linsley",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/TanStack/router.git",
- "directory": "packages/start"
- },
- "homepage": "https://tanstack.com/start",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/tannerlinsley"
- },
- "keywords": [
- "react",
- "location",
- "router",
- "routing",
- "async",
- "async router",
- "typescript"
- ],
- "scripts": {
- "clean": "rimraf ./dist && rimraf ./coverage",
- "build": "tsc",
- "test": "pnpm test:eslint && pnpm test:types && pnpm test:build && pnpm test:unit",
- "test:unit": "exit 0;vitest",
- "test:eslint": "eslint ./src",
- "test:types": "exit 0; vitest"
- },
- "type": "module",
- "types": "dist/esm/index.d.ts",
- "exports": {
- ".": {
- "import": {
- "types": "./dist/esm/index.d.ts",
- "default": "./dist/esm/index.js"
- }
- },
- "./package.json": "./package.json"
- },
- "sideEffects": false,
- "files": [
- "dist",
- "src"
- ],
- "engines": {
- "node": ">=12"
- },
- "dependencies": {
- "@tanstack/router-core": "workspace:^",
- "@tanstack/router-generator": "workspace:^",
- "@tanstack/router-plugin": "workspace:^",
- "@tanstack/server-functions-plugin": "workspace:^",
- "@tanstack/solid-start-plugin": "workspace:^",
- "@tanstack/start-server-functions-handler": "workspace:^",
- "vite-plugin-solid": "^2.11.2",
- "import-meta-resolve": "^4.1.0",
- "nitropack": "^2.10.4",
- "ofetch": "^1.4.1",
- "vite": "^6.1.0",
- "vinxi": "0.5.3",
- "zod": "^3.24.2"
- },
- "peerDependencies": {
- "solid-js": ">=1.0.0",
- "vite": "^6.0.0"
- }
-}
diff --git a/packages/solid-start-config/src/index.ts b/packages/solid-start-config/src/index.ts
deleted file mode 100644
index b148a4470c..0000000000
--- a/packages/solid-start-config/src/index.ts
+++ /dev/null
@@ -1,672 +0,0 @@
-import path from 'node:path'
-import { existsSync, readFileSync } from 'node:fs'
-import { readFile } from 'node:fs/promises'
-import { fileURLToPath } from 'node:url'
-import viteSolid from 'vite-plugin-solid'
-import { resolve } from 'import-meta-resolve'
-import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
-import { getConfig } from '@tanstack/router-generator'
-import { createApp } from 'vinxi'
-import { config } from 'vinxi/plugins/config'
-// // @ts-expect-error
-// import { serverComponents } from '@vinxi/server-components/plugin'
-import { createTanStackServerFnPlugin } from '@tanstack/server-functions-plugin'
-import { createTanStackStartPlugin } from '@tanstack/solid-start-plugin'
-import { createFetch } from 'ofetch'
-import { createNitro } from 'nitropack'
-import { tanstackStartVinxiFileRouter } from './vinxi-file-router.js'
-import {
- checkDeploymentPresetInput,
- getUserViteConfig,
- inlineConfigSchema,
- serverSchema,
-} from './schema.js'
-import type { configSchema } from '@tanstack/router-generator'
-import type { z } from 'zod'
-import type {
- TanStackStartInputConfig,
- TanStackStartOutputConfig,
-} from './schema.js'
-import type { App as VinxiApp } from 'vinxi'
-import type { Manifest } from '@tanstack/router-core'
-import type * as vite from 'vite'
-
-export type {
- TanStackStartInputConfig,
- TanStackStartOutputConfig,
-} from './schema.js'
-
-function setTsrDefaults(config: TanStackStartOutputConfig['tsr']) {
- // Normally these are `./src/___`, but we're using `./app/___` for Start stuff
- const appDirectory = config?.appDirectory ?? './app'
- return {
- ...config,
- appDirectory: config?.appDirectory ?? appDirectory,
- routesDirectory:
- config?.routesDirectory ?? path.join(appDirectory, 'routes'),
- generatedRouteTree:
- config?.generatedRouteTree ?? path.join(appDirectory, 'routeTree.gen.ts'),
- }
-}
-
-function mergeSsrOptions(options: Array) {
- let ssrOptions: vite.SSROptions = {}
- let noExternal: vite.SSROptions['noExternal'] = []
- for (const option of options) {
- if (!option) {
- continue
- }
-
- if (option.noExternal) {
- if (option.noExternal === true) {
- noExternal = true
- } else if (noExternal !== true) {
- if (Array.isArray(option.noExternal)) {
- noExternal.push(...option.noExternal)
- } else {
- noExternal.push(option.noExternal)
- }
- }
- }
-
- ssrOptions = {
- ...ssrOptions,
- ...option,
- noExternal,
- }
- }
-
- return ssrOptions
-}
-
-export async function defineConfig(
- inlineConfig: TanStackStartInputConfig = {},
-): Promise {
- const opts = inlineConfigSchema.parse(inlineConfig)
-
- const { preset: configDeploymentPreset, ...serverOptions } =
- serverSchema.parse(opts.server || {})
-
- const deploymentPreset = checkDeploymentPresetInput(
- configDeploymentPreset || 'node-server',
- )
- const tsr = setTsrDefaults(opts.tsr)
- const tsrConfig = getConfig(tsr)
-
- const appDirectory = tsr.appDirectory
- const publicDir = opts.routers?.public?.dir || './public'
-
- const publicBase = opts.routers?.public?.base || '/'
- const clientBase = opts.routers?.client?.base || '/_build'
- const apiBase = opts.tsr?.apiBase || '/api'
- const serverBase = opts.routers?.server?.base || '/_server'
-
- const apiMiddleware = opts.routers?.api?.middleware || undefined
- const serverMiddleware = opts.routers?.server?.middleware || undefined
- const ssrMiddleware = opts.routers?.ssr?.middleware || undefined
-
- const clientEntry =
- opts.routers?.client?.entry || path.join(appDirectory, 'client.tsx')
- const ssrEntry =
- opts.routers?.ssr?.entry || path.join(appDirectory, 'ssr.tsx')
- const apiEntry = opts.routers?.api?.entry || path.join(appDirectory, 'api.ts')
-
- const globalMiddlewareEntry =
- opts.routers?.server?.globalMiddlewareEntry ||
- path.join(appDirectory, 'global-middleware.ts')
-
- const apiEntryExists = existsSync(apiEntry)
-
- const viteConfig = getUserViteConfig(opts.vite)
-
- const TanStackServerFnsPlugin = createTanStackServerFnPlugin({
- // This is the ID that will be available to look up and import
- // our server function manifest and resolve its module
- manifestVirtualImportId: 'tsr:server-fn-manifest',
- client: {
- getRuntimeCode: () =>
- `import { createClientRpc } from '@tanstack/solid-start/server-functions-client'`,
- replacer: (opts) =>
- `createClientRpc('${opts.functionId}', '${serverBase}')`,
- },
- ssr: {
- getRuntimeCode: () =>
- `import { createSsrRpc } from '@tanstack/solid-start/server-functions-ssr'`,
- replacer: (opts) => `createSsrRpc('${opts.functionId}', '${serverBase}')`,
- },
- server: {
- getRuntimeCode: () =>
- `import { createServerRpc } from '@tanstack/solid-start/server-functions-server'`,
- replacer: (opts) =>
- `createServerRpc('${opts.functionId}', '${serverBase}', ${opts.fn})`,
- },
- })
-
- const TanStackStartPlugin = createTanStackStartPlugin({
- globalMiddlewareEntry,
- })
-
- // Create a dummy nitro app to get the resolved public output path
- const dummyNitroApp = await createNitro({
- preset: deploymentPreset,
- compatibilityDate: '2024-12-01',
- })
-
- const nitroOutputPublicDir = dummyNitroApp.options.output.publicDir
- await dummyNitroApp.close()
-
- let vinxiApp = createApp({
- server: {
- ...serverOptions,
- preset: deploymentPreset,
- experimental: {
- ...serverOptions.experimental,
- asyncContext: true,
- },
- },
- routers: [
- {
- name: 'public',
- type: 'static',
- dir: publicDir,
- base: publicBase,
- },
- {
- name: 'client',
- type: 'client',
- target: 'browser',
- handler: clientEntry,
- base: clientBase,
- // @ts-expect-error
- build: {
- sourcemap: true,
- },
- plugins: () => {
- const routerType = 'client'
- const clientViteConfig = getUserViteConfig(
- opts.routers?.[routerType]?.vite,
- )
-
- return [
- config('tss-vite-config-client', {
- ...viteConfig.userConfig,
- ...clientViteConfig.userConfig,
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(clientViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv(
- 'TSS_OUTPUT_PUBLIC_DIR',
- nitroOutputPublicDir,
- ),
- },
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- clientViteConfig.userConfig.ssr,
- {
- noExternal,
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(clientViteConfig.userConfig.optimizeDeps || {}),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- target: 'solid',
- enableRouteGeneration: true,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- TanStackStartPlugin.client,
- TanStackServerFnsPlugin.client,
- ...(viteConfig.plugins || []),
- ...(clientViteConfig.plugins || []),
- viteSolid({ ...opts.solid, ssr: true }),
- // TODO: RSCS - enable this
- // serverComponents.client(),
- ]
- },
- },
- {
- name: 'ssr',
- type: 'http',
- target: 'server',
- handler: ssrEntry,
- middleware: ssrMiddleware,
- // @ts-expect-error
- link: {
- client: 'client',
- },
- plugins: () => {
- const routerType = 'ssr'
- const ssrViteConfig = getUserViteConfig(
- opts.routers?.[routerType]?.vite,
- )
-
- return [
- config('tss-vite-config-ssr', {
- ...viteConfig.userConfig,
- ...ssrViteConfig.userConfig,
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(ssrViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv(
- 'TSS_OUTPUT_PUBLIC_DIR',
- nitroOutputPublicDir,
- ),
- },
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- ssrViteConfig.userConfig.ssr,
- {
- noExternal,
- external: ['@vinxi/react-server-dom/client'],
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(ssrViteConfig.userConfig.optimizeDeps || {}),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- target: 'solid',
- enableRouteGeneration: false,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- TanStackStartPlugin.ssr,
- TanStackServerFnsPlugin.ssr,
- tsrRoutesManifest({
- tsrConfig,
- clientBase,
- }),
- ...(getUserViteConfig(opts.vite).plugins || []),
- ...(getUserViteConfig(opts.routers?.ssr?.vite).plugins || []),
- viteSolid({ ...opts.solid, ssr: true }),
- ]
- },
- },
- {
- name: 'server',
- type: 'http',
- target: 'server',
- base: serverBase,
- middleware: serverMiddleware,
- // TODO: RSCS - enable this
- // worker: true,
- handler: importToProjectRelative(
- '@tanstack/start-server-functions-handler',
- ),
- plugins: () => {
- const routerType = 'server'
- const serverViteConfig = getUserViteConfig(
- opts.routers?.[routerType]?.vite,
- )
-
- return [
- config('tss-vite-config-server', {
- ...viteConfig.userConfig,
- ...serverViteConfig.userConfig,
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(serverViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv('TSS_SERVER_FN_BASE', serverBase),
- ...injectDefineEnv(
- 'TSS_OUTPUT_PUBLIC_DIR',
- nitroOutputPublicDir,
- ),
- },
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- serverViteConfig.userConfig.ssr,
- {
- noExternal,
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(serverViteConfig.userConfig.optimizeDeps || {}),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- target: 'solid',
- enableRouteGeneration: false,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- TanStackStartPlugin.server,
- TanStackServerFnsPlugin.server,
- // TODO: RSCS - remove this
- // resolve: {
- // conditions: [],
- // },
- // TODO: RSCs - add this
- // serverComponents.serverActions({
- // resolve: {
- // conditions: [
- // 'react-server',
- // // 'node',
- // 'import',
- // process.env.NODE_ENV,
- // ],
- // },
- // runtime: '@vinxi/react-server-dom/runtime',
- // transpileDeps: ['react', 'react-dom', '@vinxi/react-server-dom'],
- // }),
- ...(viteConfig.plugins || []),
- ...(serverViteConfig.plugins || []),
- viteSolid({ ...opts.solid, ssr: true }),
- ]
- },
- },
- ],
- })
-
- const noExternal = [
- '@tanstack/solid-start',
- '@tanstack/solid-start/server',
- '@tanstack/solid-start-client',
- '@tanstack/solid-start-server',
- '@tanstack/start-server-functions-fetcher',
- '@tanstack/start-server-functions-handler',
- '@tanstack/start-server-functions-client',
- '@tanstack/start-server-functions-ssr',
- '@tanstack/start-server-functions-server',
- '@tanstack/solid-start-router-manifest',
- '@tanstack/solid-start-config',
- '@tanstack/start-api-routes',
- '@tanstack/server-functions-plugin',
- 'tsr:routes-manifest',
- 'tsr:server-fn-manifest',
- ]
-
- // If API routes handler exists, add a router for it
- if (apiEntryExists) {
- vinxiApp = vinxiApp.addRouter({
- name: 'api',
- type: 'http',
- target: 'server',
- base: apiBase,
- handler: apiEntry,
- middleware: apiMiddleware,
- routes: tanstackStartVinxiFileRouter({ tsrConfig, apiBase }),
- plugins: () => {
- const viteConfig = getUserViteConfig(opts.vite)
- const apiViteConfig = getUserViteConfig(opts.routers?.api?.vite)
-
- return [
- config('tsr-vite-config-api', {
- ...viteConfig.userConfig,
- ...apiViteConfig.userConfig,
- ssr: mergeSsrOptions([
- viteConfig.userConfig.ssr,
- apiViteConfig.userConfig.ssr,
- {
- noExternal,
- },
- ]),
- optimizeDeps: {
- entries: [],
- ...(viteConfig.userConfig.optimizeDeps || {}),
- ...(apiViteConfig.userConfig.optimizeDeps || {}),
- },
- define: {
- ...(viteConfig.userConfig.define || {}),
- ...(apiViteConfig.userConfig.define || {}),
- ...injectDefineEnv('TSS_PUBLIC_BASE', publicBase),
- ...injectDefineEnv('TSS_CLIENT_BASE', clientBase),
- ...injectDefineEnv('TSS_API_BASE', apiBase),
- ...injectDefineEnv('TSS_OUTPUT_PUBLIC_DIR', nitroOutputPublicDir),
- },
- }),
- TanStackRouterVite({
- ...tsrConfig,
- target: 'solid',
- enableRouteGeneration: false,
- autoCodeSplitting: true,
- __enableAPIRoutesGeneration: true,
- experimental: {
- ...tsrConfig.experimental,
- },
- }),
- ...(viteConfig.plugins || []),
- ...(apiViteConfig.plugins || []),
- viteSolid({ ...opts.solid, ssr: true }),
- ]
- },
- })
- }
-
- // Because Vinxi doesn't use the normal nitro dev server, it doesn't
- // supply $fetch during dev. We need to hook into the dev server creation,
- // nab the proper utils from the custom nitro instance that is used
- // during dev and supply the $fetch to app.
- // Hopefully and likely, this will just get removed when we move to
- // Nitro directly.
- vinxiApp.hooks.hook('app:dev:nitro:config', (devServer) => {
- vinxiApp.hooks.hook(
- 'app:dev:server:created',
- ({ devApp: { localFetch } }) => {
- const $fetch = createFetch({
- fetch: localFetch,
- defaults: {
- baseURL: devServer.nitro.options.runtimeConfig.app.baseURL,
- },
- })
-
- // @ts-expect-error
- globalThis.$fetch = $fetch
- },
- )
- })
-
- return vinxiApp
-}
-
-function importToProjectRelative(p: string) {
- const resolved = fileURLToPath(resolve(p, import.meta.url))
-
- const relative = path.relative(process.cwd(), resolved)
-
- return relative
-}
-
-function tsrRoutesManifest(opts: {
- tsrConfig: z.infer
- clientBase: string
-}): vite.Plugin {
- let config: vite.ResolvedConfig
-
- return {
- name: 'tsr-routes-manifest',
- configResolved(resolvedConfig) {
- config = resolvedConfig
- },
- resolveId(id) {
- if (id === 'tsr:routes-manifest') {
- return id
- }
- return
- },
- async load(id) {
- if (id === 'tsr:routes-manifest') {
- // If we're in development, return a dummy manifest
-
- if (config.command === 'serve') {
- return `export default () => ({
- routes: {}
- })`
- }
-
- const clientViteManifestPath = path.resolve(
- config.build.outDir,
- `../client/${opts.clientBase}/.vite/manifest.json`,
- )
-
- type ViteManifest = Record<
- string,
- {
- file: string
- isEntry: boolean
- imports: Array
- }
- >
-
- let manifest: ViteManifest
- try {
- manifest = JSON.parse(await readFile(clientViteManifestPath, 'utf-8'))
- } catch (err) {
- console.error(err)
- throw new Error(
- `Could not find the production client vite manifest at '${clientViteManifestPath}'!`,
- )
- }
-
- const routeTreePath = path.resolve(opts.tsrConfig.generatedRouteTree)
-
- let routeTreeContent: string
- try {
- routeTreeContent = readFileSync(routeTreePath, 'utf-8')
- } catch (err) {
- console.error(err)
- throw new Error(
- `Could not find the generated route tree at '${routeTreePath}'!`,
- )
- }
-
- // Extract the routesManifest JSON from the route tree file.
- // It's located between the /* ROUTE_MANIFEST_START and ROUTE_MANIFEST_END */ comment block.
-
- const routerManifest = JSON.parse(
- routeTreeContent.match(
- /\/\* ROUTE_MANIFEST_START([\s\S]*?)ROUTE_MANIFEST_END \*\//,
- )?.[1] || '{ routes: {} }',
- ) as Manifest
-
- const routes = routerManifest.routes
-
- let entryFile:
- | {
- file: string
- imports: Array
- }
- | undefined
-
- const filesByRouteFilePath: ViteManifest = Object.fromEntries(
- Object.entries(manifest).map(([k, v]) => {
- if (v.isEntry) {
- entryFile = v
- }
-
- const rPath = k.split('?')[0]
-
- return [rPath, v]
- }, {}),
- )
-
- // Add preloads to the routes from the vite manifest
- Object.entries(routes).forEach(([k, v]) => {
- const file =
- filesByRouteFilePath[
- path.join(opts.tsrConfig.routesDirectory, v.filePath as string)
- ]
-
- if (file) {
- const preloads = file.imports.map((d) =>
- path.join(opts.clientBase, manifest[d]!.file),
- )
-
- preloads.unshift(path.join(opts.clientBase, file.file))
-
- routes[k] = {
- ...v,
- preloads,
- }
- }
- })
-
- if (entryFile) {
- routes.__root__!.preloads = [
- path.join(opts.clientBase, entryFile.file),
- ...entryFile.imports.map((d) =>
- path.join(opts.clientBase, manifest[d]!.file),
- ),
- ]
- }
-
- const recurseRoute = (
- route: {
- preloads?: Array
- children?: Array
- },
- seenPreloads = {} as Record,
- ) => {
- route.preloads = route.preloads?.filter((preload) => {
- if (seenPreloads[preload]) {
- return false
- }
- seenPreloads[preload] = true
- return true
- })
-
- if (route.children) {
- route.children.forEach((child) => {
- const childRoute = routes[child]!
- recurseRoute(childRoute, { ...seenPreloads })
- })
- }
- }
-
- // @ts-expect-error
- recurseRoute(routes.__root__)
-
- const routesManifest = {
- routes,
- }
-
- if (process.env.TSR_VITE_DEBUG) {
- console.info(
- 'Routes Manifest: \n' + JSON.stringify(routesManifest, null, 2),
- )
- }
-
- return `export default () => (${JSON.stringify(routesManifest)})`
- }
- return
- },
- }
-}
-
-function injectDefineEnv(
- key: TKey,
- value: TValue,
-): { [P in `process.env.${TKey}` | `import.meta.env.${TKey}`]: TValue } {
- return {
- [`process.env.${key}`]: JSON.stringify(value),
- [`import.meta.env.${key}`]: JSON.stringify(value),
- } as { [P in `process.env.${TKey}` | `import.meta.env.${TKey}`]: TValue }
-}
diff --git a/packages/solid-start-config/src/schema.ts b/packages/solid-start-config/src/schema.ts
deleted file mode 100644
index caa4ecbc41..0000000000
--- a/packages/solid-start-config/src/schema.ts
+++ /dev/null
@@ -1,194 +0,0 @@
-import { configSchema } from '@tanstack/router-generator'
-import { z } from 'zod'
-import type { PluginOption } from 'vite'
-import type { AppOptions as VinxiAppOptions } from 'vinxi'
-import type { NitroOptions } from 'nitropack'
-import type { Options as ViteSolidOptions } from 'vite-plugin-solid'
-import type { CustomizableConfig } from 'vinxi/dist/types/lib/vite-dev'
-
-type StartUserViteConfig = CustomizableConfig | (() => CustomizableConfig)
-
-export function getUserViteConfig(config?: StartUserViteConfig): {
- plugins: Array | undefined
- userConfig: CustomizableConfig
-} {
- const { plugins, ...userConfig } =
- typeof config === 'function' ? config() : { ...config }
- return { plugins, userConfig }
-}
-
-/**
- * Not all the deployment presets are fully functional or tested.
- * @see https://github.com/TanStack/router/pull/2002
- */
-const vinxiDeploymentPresets = [
- 'alwaysdata', // untested
- 'aws-amplify', // untested
- 'aws-lambda', // untested
- 'azure', // untested
- 'azure-functions', // untested
- 'base-worker', // untested
- 'bun', // ✅ working
- 'cleavr', // untested
- 'cli', // untested
- 'cloudflare', // untested
- 'cloudflare-module', // untested
- 'cloudflare-pages', // ✅ working
- 'cloudflare-pages-static', // untested
- 'deno', // untested
- 'deno-deploy', // untested
- 'deno-server', // untested
- 'digital-ocean', // untested
- 'edgio', // untested
- 'firebase', // untested
- 'flight-control', // untested
- 'github-pages', // untested
- 'heroku', // untested
- 'iis', // untested
- 'iis-handler', // untested
- 'iis-node', // untested
- 'koyeb', // untested
- 'layer0', // untested
- 'netlify', // ✅ working
- 'netlify-builder', // untested
- 'netlify-edge', // untested
- 'netlify-static', // untested
- 'nitro-dev', // untested
- 'nitro-prerender', // untested
- 'node', // partially working
- 'node-cluster', // untested
- 'node-server', // ✅ working
- 'platform-sh', // untested
- 'service-worker', // untested
- 'static', // 🟧 partially working
- 'stormkit', // untested
- 'vercel', // ✅ working
- 'vercel-edge', // untested
- 'vercel-static', // untested
- 'winterjs', // untested
- 'zeabur', // untested
- 'zeabur-static', // untested
-] as const
-
-type DeploymentPreset = (typeof vinxiDeploymentPresets)[number] | (string & {})
-
-const testedDeploymentPresets: Array = [
- 'bun',
- 'netlify',
- 'vercel',
- 'cloudflare-pages',
- 'node-server',
-]
-
-export function checkDeploymentPresetInput(preset: string): DeploymentPreset {
- if (!vinxiDeploymentPresets.includes(preset as any)) {
- console.warn(
- `Invalid deployment preset "${preset}". Available presets are: ${vinxiDeploymentPresets
- .map((p) => `"${p}"`)
- .join(', ')}.`,
- )
- }
-
- if (!testedDeploymentPresets.includes(preset as any)) {
- console.warn(
- `The deployment preset '${preset}' is not fully supported yet and may not work as expected.`,
- )
- }
-
- return preset
-}
-
-type HTTPSOptions = {
- cert?: string
- key?: string
- pfx?: string
- passphrase?: string
- validityDays?: number
- domains?: Array
-}
-
-type ServerOptions_ = VinxiAppOptions['server'] & {
- https?: boolean | HTTPSOptions
-}
-
-type ServerOptions = {
- [K in keyof ServerOptions_]: ServerOptions_[K]
-}
-
-export const serverSchema = z
- .object({
- routeRules: z.custom().optional(),
- preset: z.custom().optional(),
- static: z.boolean().optional(),
- prerender: z
- .object({
- routes: z.array(z.string()),
- ignore: z
- .array(
- z.custom<
- string | RegExp | ((path: string) => undefined | null | boolean)
- >(),
- )
- .optional(),
- crawlLinks: z.boolean().optional(),
- })
- .optional(),
- })
- .and(z.custom())
-
-const viteSchema = z.custom()
-
-const viteSolidSchema = z.custom()
-
-const routersSchema = z.object({
- ssr: z
- .object({
- entry: z.string().optional(),
- middleware: z.string().optional(),
- vite: viteSchema.optional(),
- })
- .optional(),
- client: z
- .object({
- entry: z.string().optional(),
- base: z.string().optional(),
- vite: viteSchema.optional(),
- })
- .optional(),
- server: z
- .object({
- base: z.string().optional(),
- globalMiddlewareEntry: z.string().optional(),
- middleware: z.string().optional(),
- vite: viteSchema.optional(),
- })
- .optional(),
- api: z
- .object({
- entry: z.string().optional(),
- middleware: z.string().optional(),
- vite: viteSchema.optional(),
- })
- .optional(),
- public: z
- .object({
- dir: z.string().optional(),
- base: z.string().optional(),
- })
- .optional(),
-})
-
-const tsrConfig = configSchema.partial().extend({
- appDirectory: z.string().optional(),
-})
-
-export const inlineConfigSchema = z.object({
- solid: viteSolidSchema.optional(),
- vite: viteSchema.optional(),
- tsr: tsrConfig.optional(),
- routers: routersSchema.optional(),
- server: serverSchema.optional(),
-})
-
-export type TanStackStartInputConfig = z.input
-export type TanStackStartOutputConfig = z.infer
diff --git a/packages/solid-start-config/src/vinxi-file-router.ts b/packages/solid-start-config/src/vinxi-file-router.ts
deleted file mode 100644
index 9e6d829d1b..0000000000
--- a/packages/solid-start-config/src/vinxi-file-router.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-import {
- BaseFileSystemRouter as VinxiBaseFileSystemRouter,
- analyzeModule as vinxiFsRouterAnalyzeModule,
- cleanPath as vinxiFsRouterCleanPath,
-} from 'vinxi/fs-router'
-import {
- CONSTANTS as GENERATOR_CONSTANTS,
- startAPIRouteSegmentsFromTSRFilePath,
-} from '@tanstack/router-generator'
-import type { configSchema } from '@tanstack/router-generator'
-import type {
- AppOptions as VinxiAppOptions,
- RouterSchemaInput as VinxiRouterSchemaInput,
-} from 'vinxi'
-import type { z } from 'zod'
-
-export function tanstackStartVinxiFileRouter(opts: {
- tsrConfig: z.infer
- apiBase: string
-}) {
- const apiBaseSegment = opts.apiBase.split('/').filter(Boolean).join('/')
- const isAPIPath = new RegExp(`/${apiBaseSegment}/`)
-
- return function (router: VinxiRouterSchemaInput, app: VinxiAppOptions) {
- // Our own custom File Router that extends the VinxiBaseFileSystemRouter
- // for splitting the API routes into its own "bundle"
- // and adding the $APIRoute metadata to the route object
- // This could be customized in future to support more complex splits
- class TanStackStartFsRouter extends VinxiBaseFileSystemRouter {
- toPath(src: string): string {
- const inputPath = vinxiFsRouterCleanPath(src, this.config)
-
- const segments = startAPIRouteSegmentsFromTSRFilePath(
- inputPath,
- opts.tsrConfig,
- )
-
- const pathname = segments
- .map((part) => {
- if (part.type === 'splat') {
- return `*splat`
- }
-
- if (part.type === 'param') {
- return `:${part.value}?`
- }
-
- return part.value
- })
- .join('/')
-
- return pathname.length > 0 ? `/${pathname}` : '/'
- }
-
- toRoute(src: string) {
- const webPath = this.toPath(src)
-
- const [_, exports] = vinxiFsRouterAnalyzeModule(src)
-
- const hasAPIRoute = exports.find(
- (exp) => exp.n === GENERATOR_CONSTANTS.APIRouteExportVariable,
- )
-
- return {
- path: webPath,
- filePath: src,
- $APIRoute:
- isAPIPath.test(webPath) && hasAPIRoute
- ? {
- src,
- pick: [GENERATOR_CONSTANTS.APIRouteExportVariable],
- }
- : undefined,
- }
- }
- }
-
- return new TanStackStartFsRouter(
- {
- dir: opts.tsrConfig.routesDirectory,
- extensions: ['js', 'jsx', 'ts', 'tsx'],
- },
- router,
- app,
- )
- }
-}
diff --git a/packages/solid-start-config/tsconfig.json b/packages/solid-start-config/tsconfig.json
deleted file mode 100644
index 940a9cce0a..0000000000
--- a/packages/solid-start-config/tsconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extends": "../../tsconfig.json",
- "include": ["src/index.ts"],
- "compilerOptions": {
- "rootDir": "src",
- "outDir": "dist/esm",
- "target": "esnext",
- "noEmit": false
- }
-}
diff --git a/packages/solid-start-router-manifest/README.md b/packages/solid-start-router-manifest/README.md
deleted file mode 100644
index bb009b0c87..0000000000
--- a/packages/solid-start-router-manifest/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-> 🤫 we're cooking up something special!
-
-
-
-# TanStack Start
-
-
-
-🤖 Type-safe router w/ built-in caching & URL state management for React!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Query](https://github.com/tannerlinsley/react-query), [React Table](https://github.com/tanstack/react-table), [React Charts](https://github.com/tannerlinsley/react-charts), [React Virtual](https://github.com/tannerlinsley/react-virtual)
-
-## Visit [tanstack.com/router](https://tanstack.com/router) for docs, guides, API and more!
diff --git a/packages/solid-start-router-manifest/eslint.config.js b/packages/solid-start-router-manifest/eslint.config.js
deleted file mode 100644
index 931f0ec774..0000000000
--- a/packages/solid-start-router-manifest/eslint.config.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// @ts-check
-
-import pluginReact from '@eslint-react/eslint-plugin'
-import pluginReactHooks from 'eslint-plugin-react-hooks'
-import rootConfig from '../../eslint.config.js'
-
-export default [
- ...rootConfig,
- {
- ...pluginReact.configs.recommended,
- files: ['**/*.{ts,tsx}'],
- },
- {
- plugins: {
- 'react-hooks': pluginReactHooks,
- },
- rules: {
- '@eslint-react/no-unstable-context-value': 'off',
- '@eslint-react/no-unstable-default-props': 'off',
- '@eslint-react/dom/no-missing-button-type': 'off',
- 'react-hooks/exhaustive-deps': 'error',
- 'react-hooks/rules-of-hooks': 'error',
- },
- },
- {
- files: ['**/__tests__/**'],
- rules: {
- '@typescript-eslint/no-unnecessary-condition': 'off',
- },
- },
-]
diff --git a/packages/solid-start-router-manifest/src/index.ts b/packages/solid-start-router-manifest/src/index.ts
deleted file mode 100644
index 9a41e3f788..0000000000
--- a/packages/solid-start-router-manifest/src/index.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-// @ts-expect-error
-import tsrGetManifest from 'tsr:routes-manifest'
-import { getManifest } from 'vinxi/manifest'
-import { default as invariant } from 'tiny-invariant'
-import type { Manifest } from '@tanstack/router-core'
-
-function sanitizeBase(base: string) {
- return base.replace(/^\/|\/$/g, '')
-}
-
-/**
- * @description Returns the full, unfiltered router manifest. This includes relationships
- * between routes, assets, and preloads and is NOT what you want to serialize and
- * send to the client.
- */
-export function getFullRouterManifest() {
- const routerManifest = tsrGetManifest() as Manifest
-
- const rootRoute = (routerManifest.routes.__root__ =
- routerManifest.routes.__root__ || {})
-
- rootRoute.assets = rootRoute.assets || []
-
- const script = ''
- // Always fake that HMR is ready
- if (process.env.NODE_ENV === 'development') {
- const CLIENT_BASE = sanitizeBase(process.env.TSS_CLIENT_BASE || '')
-
- if (!CLIENT_BASE) {
- throw new Error(
- 'tanstack/solid-start-router-manifest: TSS_CLIENT_BASE must be defined in your environment for getFullRouterManifest()',
- )
- }
- }
-
- // Get the entry for the client from vinxi
- const vinxiClientManifest = getManifest('client')
-
- const importPath =
- vinxiClientManifest.inputs[vinxiClientManifest.handler]?.output.path
- if (!importPath) {
- invariant(importPath, 'Could not find client entry in vinxi manifest')
- }
-
- rootRoute.assets.push({
- tag: 'script',
- attrs: {
- type: 'module',
- suppressHydrationWarning: true,
- async: true,
- },
- children: `${script}import("${importPath}")`,
- })
-
- return routerManifest
-}
-
-/**
- * @description Returns the router manifest that should be sent to the client.
- * This includes only the assets and preloads for the current route and any
- * special assets that are needed for the client. It does not include relationships
- * between routes or any other data that is not needed for the client.
- */
-export function getRouterManifest() {
- const routerManifest = getFullRouterManifest()
-
- // Strip out anything that isn't needed for the client
- return {
- ...routerManifest,
- routes: Object.fromEntries(
- Object.entries(routerManifest.routes).map(([k, v]: any) => {
- const { preloads, assets } = v
- return [
- k,
- {
- preloads,
- assets,
- },
- ]
- }),
- ),
- }
-}
diff --git a/packages/solid-start-router-manifest/tsconfig.json b/packages/solid-start-router-manifest/tsconfig.json
deleted file mode 100644
index 940a9cce0a..0000000000
--- a/packages/solid-start-router-manifest/tsconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extends": "../../tsconfig.json",
- "include": ["src/index.ts"],
- "compilerOptions": {
- "rootDir": "src",
- "outDir": "dist/esm",
- "target": "esnext",
- "noEmit": false
- }
-}
diff --git a/packages/solid-start-router-manifest/vite.config.ts b/packages/solid-start-router-manifest/vite.config.ts
deleted file mode 100644
index d6472068fb..0000000000
--- a/packages/solid-start-router-manifest/vite.config.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { defineConfig, mergeConfig } from 'vitest/config'
-import { tanstackViteConfig } from '@tanstack/config/vite'
-import packageJson from './package.json'
-import type { ViteUserConfig } from 'vitest/config'
-
-const config = defineConfig({
- plugins: [] as ViteUserConfig['plugins'],
- test: {
- name: packageJson.name,
- watch: false,
- environment: 'jsdom',
- },
-})
-
-export default mergeConfig(
- config,
- tanstackViteConfig({
- entry: './src/index.ts',
- srcDir: './src',
- externalDeps: ['tsr:routes-manifest'],
- }),
-)
diff --git a/packages/solid-start/package.json b/packages/solid-start/package.json
index 4782d3421a..7c4bea024e 100644
--- a/packages/solid-start/package.json
+++ b/packages/solid-start/package.json
@@ -62,14 +62,14 @@
"default": "./dist/cjs/server.cjs"
}
},
- "./config": {
+ "./plugin": {
"import": {
- "types": "./dist/esm/config.d.ts",
- "default": "./dist/esm/config.js"
+ "types": "./dist/esm/plugin.d.ts",
+ "default": "./dist/esm/plugin.js"
},
"require": {
- "types": "./dist/cjs/config.d.cts",
- "default": "./dist/cjs/config.cjs"
+ "types": "./dist/cjs/plugin.d.cts",
+ "default": "./dist/cjs/plugin.cjs"
}
},
"./api": {
@@ -82,16 +82,6 @@
"default": "./dist/cjs/api.cjs"
}
},
- "./router-manifest": {
- "import": {
- "types": "./dist/esm/router-manifest.d.ts",
- "default": "./dist/esm/router-manifest.js"
- },
- "require": {
- "types": "./dist/cjs/router-manifest.d.cts",
- "default": "./dist/cjs/router-manifest.cjs"
- }
- },
"./server-functions-client": {
"import": {
"types": "./dist/esm/server-functions-client.d.ts",
@@ -145,11 +135,9 @@
"dependencies": {
"@tanstack/solid-start-client": "workspace:^",
"@tanstack/solid-start-server": "workspace:^",
- "@tanstack/solid-start-config": "workspace:^",
- "@tanstack/solid-start-router-manifest": "workspace:^",
+ "@tanstack/solid-start-plugin": "workspace:^",
"@tanstack/start-server-functions-client": "workspace:^",
"@tanstack/start-server-functions-server": "workspace:^",
- "@tanstack/start-server-functions-handler": "workspace:^",
"@tanstack/start-server-functions-ssr": "workspace:^",
"@tanstack/start-api-routes": "workspace:^"
},
diff --git a/packages/solid-start/src/config.tsx b/packages/solid-start/src/config.tsx
deleted file mode 100644
index 5a71360c3a..0000000000
--- a/packages/solid-start/src/config.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export * from '@tanstack/solid-start-config'
diff --git a/packages/solid-start/src/plugin.tsx b/packages/solid-start/src/plugin.tsx
new file mode 100644
index 0000000000..24c76d5516
--- /dev/null
+++ b/packages/solid-start/src/plugin.tsx
@@ -0,0 +1 @@
+export * from '@tanstack/solid-start-plugin'
diff --git a/packages/solid-start/src/router-manifest.tsx b/packages/solid-start/src/router-manifest.tsx
deleted file mode 100644
index 4e939be275..0000000000
--- a/packages/solid-start/src/router-manifest.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export * from '@tanstack/solid-start-router-manifest'
diff --git a/packages/solid-start/src/server-functions-handler.tsx b/packages/solid-start/src/server-functions-handler.tsx
deleted file mode 100644
index c3cc9770d2..0000000000
--- a/packages/solid-start/src/server-functions-handler.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export * from '@tanstack/start-server-functions-handler'
diff --git a/packages/solid-start/vite.config.ts b/packages/solid-start/vite.config.ts
index dfcd5b4b41..262e126d5c 100644
--- a/packages/solid-start/vite.config.ts
+++ b/packages/solid-start/vite.config.ts
@@ -17,8 +17,7 @@ export default mergeConfig(
entry: [
'./src/client.tsx',
'./src/server.tsx',
- './src/config.tsx',
- './src/router-manifest.tsx',
+ './src/plugin.tsx',
'./src/server-functions-client.tsx',
'./src/server-functions-server.tsx',
'./src/server-functions-ssr.tsx',
@@ -27,8 +26,7 @@ export default mergeConfig(
externalDeps: [
'@tanstack/solid-start-client',
'@tanstack/solid-start-server',
- '@tanstack/solid-start-config',
- '@tanstack/solid-start-router-manifest',
+ '@tanstack/solid-start-plugin',
'@tanstack/start-server-functions-client',
'@tanstack/start-server-functions-server',
'@tanstack/start-server-functions-ssr',
diff --git a/packages/solid-start-router-manifest/package.json b/packages/start-server-functions-ssr/package.json
similarity index 73%
rename from packages/solid-start-router-manifest/package.json
rename to packages/start-server-functions-ssr/package.json
index 22d9650333..538f5bcb60 100644
--- a/packages/solid-start-router-manifest/package.json
+++ b/packages/start-server-functions-ssr/package.json
@@ -1,13 +1,13 @@
{
- "name": "@tanstack/solid-start-router-manifest",
- "version": "1.111.7",
- "description": "Modern and scalable routing for React applications",
+ "name": "@tanstack/start-server-functions-ssr",
+ "version": "1.114.10",
+ "description": "Modern and scalable routing for applications",
"author": "Tanner Linsley",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/TanStack/router.git",
- "directory": "packages/start"
+ "directory": "packages/start-server-functions-ssr"
},
"homepage": "https://tanstack.com/start",
"funding": {
@@ -15,7 +15,6 @@
"url": "https://github.com/sponsors/tannerlinsley"
},
"keywords": [
- "react",
"location",
"router",
"routing",
@@ -36,7 +35,7 @@
"test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js",
"test:types:ts58": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
- "build": "tsc"
+ "build": "vite build"
},
"type": "module",
"types": "dist/esm/index.d.ts",
@@ -45,6 +44,10 @@
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
+ },
+ "require": {
+ "types": "./dist/cjs/index.d.cts",
+ "default": "./dist/cjs/index.cjs"
}
},
"./package.json": "./package.json"
@@ -58,11 +61,13 @@
"node": ">=12"
},
"dependencies": {
- "@tanstack/router-core": "workspace:^",
- "tiny-invariant": "^1.3.3",
- "vinxi": "0.5.3"
+ "@tanstack/server-functions-plugin": "workspace:^",
+ "@tanstack/start-server-functions-fetcher": "workspace:^",
+ "@tanstack/start-client-core": "workspace:^",
+ "@tanstack/start-server-core": "workspace:^",
+ "tiny-invariant": "^1.3.3"
},
"devDependencies": {
"typescript": "^5.7.2"
}
-}
+}
\ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4aa4091dd0..e6f6704bd0 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -33,9 +33,9 @@ overrides:
'@tanstack/react-start-client': workspace:*
'@tanstack/react-start-server': workspace:*
'@tanstack/start-api-routes': workspace:*
- '@tanstack/react-start-server-functions-fetcher': workspace:*
- '@tanstack/react-start-server-functions-client': workspace:*
- '@tanstack/react-start-server-functions-ssr': workspace:*
+ '@tanstack/start-server-functions-fetcher': workspace:*
+ '@tanstack/start-server-functions-client': workspace:*
+ '@tanstack/start-server-functions-ssr': workspace:*
'@tanstack/start-server-functions-server': workspace:*
'@tanstack/react-start-plugin': workspace:*
'@tanstack/start-client-core': workspace:*
@@ -5702,21 +5702,12 @@ importers:
'@tanstack/react-start-server':
specifier: workspace:*
version: link:../react-start-server
- '@tanstack/react-start-server-functions-client':
- specifier: workspace:*
- version: link:../react-start-server-functions-client
- '@tanstack/react-start-server-functions-ssr':
- specifier: workspace:*
- version: link:../react-start-server-functions-ssr
'@tanstack/start-api-routes':
specifier: workspace:*
version: link:../start-api-routes
'@tanstack/start-server-functions-client':
specifier: workspace:*
version: link:../start-server-functions-client
- '@tanstack/start-server-functions-handler':
- specifier: workspace:*
- version: link:../start-server-functions-handler
'@tanstack/start-server-functions-server':
specifier: workspace:*
version: link:../start-server-functions-server
@@ -5884,6 +5875,9 @@ importers:
jsesc:
specifier: ^3.1.0
version: 3.1.0
+ tiny-invariant:
+ specifier: ^1.3.3
+ version: 1.3.3
tiny-warning:
specifier: ^1.0.3
version: 1.0.3
@@ -5910,66 +5904,6 @@ importers:
specifier: ^5.7.2
version: 5.8.2
- packages/react-start-server-functions-client:
- dependencies:
- '@tanstack/react-start-server-functions-fetcher':
- specifier: workspace:*
- version: link:../react-start-server-functions-fetcher
- '@tanstack/server-functions-plugin':
- specifier: workspace:*
- version: link:../server-functions-plugin
- devDependencies:
- typescript:
- specifier: ^5.7.2
- version: 5.8.2
-
- packages/react-start-server-functions-fetcher:
- dependencies:
- '@tanstack/react-router':
- specifier: workspace:*
- version: link:../react-router
- '@tanstack/router-core':
- specifier: workspace:*
- version: link:../router-core
- '@tanstack/start-client-core':
- specifier: workspace:*
- version: link:../start-client-core
- devDependencies:
- '@vitejs/plugin-react':
- specifier: ^4.3.4
- version: 4.3.4(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
- react:
- specifier: ^19.0.0
- version: 19.0.0
- react-dom:
- specifier: ^19.0.0
- version: 19.0.0(react@19.0.0)
- typescript:
- specifier: ^5.7.2
- version: 5.8.2
-
- packages/react-start-server-functions-ssr:
- dependencies:
- '@tanstack/react-start-server':
- specifier: workspace:*
- version: link:../react-start-server
- '@tanstack/react-start-server-functions-fetcher':
- specifier: workspace:*
- version: link:../react-start-server-functions-fetcher
- '@tanstack/server-functions-plugin':
- specifier: workspace:*
- version: link:../server-functions-plugin
- '@tanstack/start-client-core':
- specifier: workspace:*
- version: link:../start-client-core
- tiny-invariant:
- specifier: ^1.3.3
- version: 1.3.3
- devDependencies:
- typescript:
- specifier: ^5.7.2
- version: 5.8.2
-
packages/router-cli:
dependencies:
'@tanstack/router-generator':
@@ -6291,12 +6225,9 @@ importers:
'@tanstack/solid-start-client':
specifier: workspace:^
version: link:../solid-start-client
- '@tanstack/solid-start-config':
- specifier: workspace:^
- version: link:../solid-start-config
- '@tanstack/solid-start-router-manifest':
+ '@tanstack/solid-start-plugin':
specifier: workspace:^
- version: link:../solid-start-router-manifest
+ version: link:../solid-start-plugin
'@tanstack/solid-start-server':
specifier: workspace:^
version: link:../solid-start-server
@@ -6306,9 +6237,6 @@ importers:
'@tanstack/start-server-functions-client':
specifier: workspace:*
version: link:../start-server-functions-client
- '@tanstack/start-server-functions-handler':
- specifier: workspace:*
- version: link:../start-server-functions-handler
'@tanstack/start-server-functions-server':
specifier: workspace:*
version: link:../start-server-functions-server
@@ -6369,51 +6297,6 @@ importers:
specifier: ^2.11.2
version: 2.11.6(@testing-library/jest-dom@6.6.3)(solid-js@1.9.5)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
- packages/solid-start-config:
- dependencies:
- '@tanstack/router-core':
- specifier: workspace:*
- version: link:../router-core
- '@tanstack/router-generator':
- specifier: workspace:*
- version: link:../router-generator
- '@tanstack/router-plugin':
- specifier: workspace:*
- version: link:../router-plugin
- '@tanstack/server-functions-plugin':
- specifier: workspace:*
- version: link:../server-functions-plugin
- '@tanstack/solid-start-plugin':
- specifier: workspace:^
- version: link:../solid-start-plugin
- '@tanstack/start-server-functions-handler':
- specifier: workspace:*
- version: link:../start-server-functions-handler
- import-meta-resolve:
- specifier: ^4.1.0
- version: 4.1.0
- nitropack:
- specifier: ^2.10.4
- version: 2.10.4(typescript@5.8.2)
- ofetch:
- specifier: ^1.4.1
- version: 1.4.1
- solid-js:
- specifier: '>=1.0.0'
- version: 1.9.5
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
- vite:
- specifier: 6.1.0
- version: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
- vite-plugin-solid:
- specifier: ^2.11.2
- version: 2.11.6(@testing-library/jest-dom@6.6.3)(solid-js@1.9.5)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
- zod:
- specifier: ^3.24.2
- version: 3.24.2
-
packages/solid-start-plugin:
dependencies:
'@babel/code-frame':
@@ -6463,22 +6346,6 @@ importers:
specifier: ^7.20.6
version: 7.20.6
- packages/solid-start-router-manifest:
- dependencies:
- '@tanstack/router-core':
- specifier: workspace:*
- version: link:../router-core
- tiny-invariant:
- specifier: ^1.3.3
- version: 1.3.3
- vinxi:
- specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
- devDependencies:
- typescript:
- specifier: ^5.7.2
- version: 5.8.2
-
packages/solid-start-server:
dependencies:
'@solidjs/meta':
@@ -6542,15 +6409,12 @@ importers:
'@tanstack/react-start-server':
specifier: workspace:*
version: link:../react-start-server
- '@tanstack/react-start-server-functions-client':
- specifier: workspace:*
- version: link:../react-start-server-functions-client
- '@tanstack/react-start-server-functions-ssr':
- specifier: workspace:*
- version: link:../react-start-server-functions-ssr
'@tanstack/start-api-routes':
specifier: workspace:*
version: link:../start-api-routes
+ '@tanstack/start-server-functions-client':
+ specifier: workspace:*
+ version: link:../start-server-functions-client
'@tanstack/start-server-functions-server':
specifier: workspace:*
version: link:../start-server-functions-server
@@ -6649,25 +6513,6 @@ importers:
specifier: ^5.7.2
version: 5.8.2
- packages/start-server-functions-handler:
- dependencies:
- '@tanstack/router-core':
- specifier: workspace:*
- version: link:../router-core
- '@tanstack/start-client-core':
- specifier: workspace:*
- version: link:../start-client-core
- '@tanstack/start-server-core':
- specifier: workspace:*
- version: link:../start-server-core
- tiny-invariant:
- specifier: ^1.3.3
- version: 1.3.3
- devDependencies:
- typescript:
- specifier: ^5.7.2
- version: 5.8.2
-
packages/start-server-functions-server:
dependencies:
'@tanstack/server-functions-plugin':
From 0b9f6b067689556072c0040e2bdcf821bafeaf93 Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Mon, 10 Mar 2025 19:34:02 +0100
Subject: [PATCH 036/155] keep tsr config routes in src/app/routes
---
e2e/react-start/basic-tsr-config/src/{ => app}/routeTree.gen.ts | 0
e2e/react-start/basic-tsr-config/src/{ => app}/router.tsx | 0
.../basic-tsr-config/src/{ => app}/routes/__root.tsx | 0
e2e/react-start/basic-tsr-config/src/{ => app}/routes/index.tsx | 0
e2e/solid-start/basic-tsr-config/src/{ => app}/client.tsx | 2 +-
e2e/solid-start/basic-tsr-config/src/{ => app}/routeTree.gen.ts | 2 +-
e2e/solid-start/basic-tsr-config/src/{ => app}/router.tsx | 2 +-
.../basic-tsr-config/src/{ => app}/routes/__root.tsx | 0
e2e/solid-start/basic-tsr-config/src/{ => app}/routes/index.tsx | 0
e2e/solid-start/basic-tsr-config/src/{ => app}/ssr.tsx | 2 +-
10 files changed, 4 insertions(+), 4 deletions(-)
rename e2e/react-start/basic-tsr-config/src/{ => app}/routeTree.gen.ts (100%)
rename e2e/react-start/basic-tsr-config/src/{ => app}/router.tsx (100%)
rename e2e/react-start/basic-tsr-config/src/{ => app}/routes/__root.tsx (100%)
rename e2e/react-start/basic-tsr-config/src/{ => app}/routes/index.tsx (100%)
rename e2e/solid-start/basic-tsr-config/src/{ => app}/client.tsx (83%)
rename e2e/solid-start/basic-tsr-config/src/{ => app}/routeTree.gen.ts (96%)
rename e2e/solid-start/basic-tsr-config/src/{ => app}/router.tsx (87%)
rename e2e/solid-start/basic-tsr-config/src/{ => app}/routes/__root.tsx (100%)
rename e2e/solid-start/basic-tsr-config/src/{ => app}/routes/index.tsx (100%)
rename e2e/solid-start/basic-tsr-config/src/{ => app}/ssr.tsx (87%)
diff --git a/e2e/react-start/basic-tsr-config/src/routeTree.gen.ts b/e2e/react-start/basic-tsr-config/src/app/routeTree.gen.ts
similarity index 100%
rename from e2e/react-start/basic-tsr-config/src/routeTree.gen.ts
rename to e2e/react-start/basic-tsr-config/src/app/routeTree.gen.ts
diff --git a/e2e/react-start/basic-tsr-config/src/router.tsx b/e2e/react-start/basic-tsr-config/src/app/router.tsx
similarity index 100%
rename from e2e/react-start/basic-tsr-config/src/router.tsx
rename to e2e/react-start/basic-tsr-config/src/app/router.tsx
diff --git a/e2e/react-start/basic-tsr-config/src/routes/__root.tsx b/e2e/react-start/basic-tsr-config/src/app/routes/__root.tsx
similarity index 100%
rename from e2e/react-start/basic-tsr-config/src/routes/__root.tsx
rename to e2e/react-start/basic-tsr-config/src/app/routes/__root.tsx
diff --git a/e2e/react-start/basic-tsr-config/src/routes/index.tsx b/e2e/react-start/basic-tsr-config/src/app/routes/index.tsx
similarity index 100%
rename from e2e/react-start/basic-tsr-config/src/routes/index.tsx
rename to e2e/react-start/basic-tsr-config/src/app/routes/index.tsx
diff --git a/e2e/solid-start/basic-tsr-config/src/client.tsx b/e2e/solid-start/basic-tsr-config/src/app/client.tsx
similarity index 83%
rename from e2e/solid-start/basic-tsr-config/src/client.tsx
rename to e2e/solid-start/basic-tsr-config/src/app/client.tsx
index 04f043feee..ba0f02fac0 100644
--- a/e2e/solid-start/basic-tsr-config/src/client.tsx
+++ b/e2e/solid-start/basic-tsr-config/src/app/client.tsx
@@ -1,7 +1,7 @@
///
import { hydrate } from 'solid-js/web'
import { StartClient } from '@tanstack/solid-start'
-import { createRouter } from './app/router'
+import { createRouter } from './router'
const router = createRouter()
diff --git a/e2e/solid-start/basic-tsr-config/src/routeTree.gen.ts b/e2e/solid-start/basic-tsr-config/src/app/routeTree.gen.ts
similarity index 96%
rename from e2e/solid-start/basic-tsr-config/src/routeTree.gen.ts
rename to e2e/solid-start/basic-tsr-config/src/app/routeTree.gen.ts
index 7214e0cd01..c260510053 100644
--- a/e2e/solid-start/basic-tsr-config/src/routeTree.gen.ts
+++ b/e2e/solid-start/basic-tsr-config/src/app/routeTree.gen.ts
@@ -11,7 +11,7 @@
// Import Routes
import { Route as rootRoute } from './routes/__root'
-import { Route as IndexImport } from './app/routes/index'
+import { Route as IndexImport } from './routes/index'
// Create/Update Routes
diff --git a/e2e/solid-start/basic-tsr-config/src/router.tsx b/e2e/solid-start/basic-tsr-config/src/app/router.tsx
similarity index 87%
rename from e2e/solid-start/basic-tsr-config/src/router.tsx
rename to e2e/solid-start/basic-tsr-config/src/app/router.tsx
index 768813ab82..e230377cb1 100644
--- a/e2e/solid-start/basic-tsr-config/src/router.tsx
+++ b/e2e/solid-start/basic-tsr-config/src/app/router.tsx
@@ -1,5 +1,5 @@
import { createRouter as createTanStackRouter } from '@tanstack/solid-router'
-import { routeTree } from './app/routeTree.gen'
+import { routeTree } from './routeTree.gen'
export function createRouter() {
const router = createTanStackRouter({
diff --git a/e2e/solid-start/basic-tsr-config/src/routes/__root.tsx b/e2e/solid-start/basic-tsr-config/src/app/routes/__root.tsx
similarity index 100%
rename from e2e/solid-start/basic-tsr-config/src/routes/__root.tsx
rename to e2e/solid-start/basic-tsr-config/src/app/routes/__root.tsx
diff --git a/e2e/solid-start/basic-tsr-config/src/routes/index.tsx b/e2e/solid-start/basic-tsr-config/src/app/routes/index.tsx
similarity index 100%
rename from e2e/solid-start/basic-tsr-config/src/routes/index.tsx
rename to e2e/solid-start/basic-tsr-config/src/app/routes/index.tsx
diff --git a/e2e/solid-start/basic-tsr-config/src/ssr.tsx b/e2e/solid-start/basic-tsr-config/src/app/ssr.tsx
similarity index 87%
rename from e2e/solid-start/basic-tsr-config/src/ssr.tsx
rename to e2e/solid-start/basic-tsr-config/src/app/ssr.tsx
index db95139de1..ebd14c8120 100644
--- a/e2e/solid-start/basic-tsr-config/src/ssr.tsx
+++ b/e2e/solid-start/basic-tsr-config/src/app/ssr.tsx
@@ -5,7 +5,7 @@ import {
} from '@tanstack/solid-start/server'
import { getRouterManifest } from '@tanstack/solid-start/router-manifest'
-import { createRouter } from './app/router'
+import { createRouter } from './router'
export default createStartHandler({
createRouter,
From d34c97dda378cf2091bb32fc34954a9f13a1dce8 Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Mon, 10 Mar 2025 19:38:18 +0100
Subject: [PATCH 037/155] change back imports from "src/" to "~/"
---
examples/react/start-bare/src/routes/index.tsx | 2 +-
examples/react/start-basic-auth/src/components/Login.tsx | 2 +-
examples/react/start-basic-auth/src/routes/__root.tsx | 8 ++++----
examples/react/start-basic-auth/src/routes/_authed.tsx | 6 +++---
.../start-basic-auth/src/routes/_authed/posts.$postId.tsx | 4 ++--
.../start-basic-auth/src/routes/_authed/posts.route.tsx | 2 +-
examples/react/start-basic-auth/src/routes/login.tsx | 2 +-
examples/react/start-basic-auth/src/routes/logout.tsx | 2 +-
examples/react/start-basic-auth/src/routes/signup.tsx | 8 ++++----
examples/react/start-basic-rsc/src/routes/__root.tsx | 6 +++---
.../react/start-basic-rsc/src/routes/posts.$postId.tsx | 2 +-
examples/react/start-basic-rsc/src/routes/posts.tsx | 2 +-
examples/react/start-basic-static/src/routes/__root.tsx | 6 +++---
.../react/start-basic-static/src/routes/posts.$postId.tsx | 2 +-
.../react/start-basic-static/src/routes/users.$userId.tsx | 4 ++--
examples/react/start-clerk-basic/src/routes/__root.tsx | 4 ++--
.../src/routes/_authed/posts.$postId.tsx | 4 ++--
.../react/start-clerk-basic/src/routes/_authed/posts.tsx | 2 +-
.../start-clerk-basic/src/routes/_authed/profile.$.tsx | 2 +-
examples/react/start-large/src/routes/linkProps.tsx | 2 +-
.../react/start-material-ui/src/components/Counter.tsx | 2 +-
examples/react/start-material-ui/src/routes/__root.tsx | 4 ++--
examples/react/start-material-ui/src/routes/index.tsx | 2 +-
.../src/routes/_authed/posts.$postId.tsx | 4 ++--
examples/solid/start-bare/src/routes/index.tsx | 2 +-
25 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/examples/react/start-bare/src/routes/index.tsx b/examples/react/start-bare/src/routes/index.tsx
index 934654e3b8..e9de615dc9 100644
--- a/examples/react/start-bare/src/routes/index.tsx
+++ b/examples/react/start-bare/src/routes/index.tsx
@@ -1,5 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'
-import Counter from 'src/components/Counter'
+import Counter from '~/components/Counter'
export const Route = createFileRoute('/')({
component: RouteComponent,
})
diff --git a/examples/react/start-basic-auth/src/components/Login.tsx b/examples/react/start-basic-auth/src/components/Login.tsx
index 9ba6b8f019..b6b6da0c37 100644
--- a/examples/react/start-basic-auth/src/components/Login.tsx
+++ b/examples/react/start-basic-auth/src/components/Login.tsx
@@ -3,7 +3,7 @@ import { useServerFn } from '@tanstack/react-start'
import { useMutation } from '../hooks/useMutation'
import { loginFn } from '../routes/_authed'
import { Auth } from './Auth'
-import { signupFn } from 'src/routes/signup'
+import { signupFn } from '~/routes/signup'
export function Login() {
const router = useRouter()
diff --git a/examples/react/start-basic-auth/src/routes/__root.tsx b/examples/react/start-basic-auth/src/routes/__root.tsx
index e286ac3499..187cb0dc24 100644
--- a/examples/react/start-basic-auth/src/routes/__root.tsx
+++ b/examples/react/start-basic-auth/src/routes/__root.tsx
@@ -8,11 +8,11 @@ import {
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import { createServerFn } from '@tanstack/react-start'
import * as React from 'react'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary.js'
-import { NotFound } from 'src/components/NotFound.js'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js'
+import { NotFound } from '~/components/NotFound.js'
import appCss from '~/styles/app.css?url'
-import { seo } from 'src/utils/seo.js'
-import { useAppSession } from 'src/utils/session.js'
+import { seo } from '~/utils/seo.js'
+import { useAppSession } from '~/utils/session.js'
const fetchUser = createServerFn({ method: 'GET' }).handler(async () => {
// We need to auth on the server so we have access to secure cookies
diff --git a/examples/react/start-basic-auth/src/routes/_authed.tsx b/examples/react/start-basic-auth/src/routes/_authed.tsx
index 183520c267..0b1ae37317 100644
--- a/examples/react/start-basic-auth/src/routes/_authed.tsx
+++ b/examples/react/start-basic-auth/src/routes/_authed.tsx
@@ -1,8 +1,8 @@
import { createFileRoute } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
-import { hashPassword, prismaClient } from 'src/utils/prisma'
-import { Login } from 'src/components/Login'
-import { useAppSession } from 'src/utils/session'
+import { hashPassword, prismaClient } from '~/utils/prisma'
+import { Login } from '~/components/Login'
+import { useAppSession } from '~/utils/session'
export const loginFn = createServerFn()
.validator((d) => d as { email: string; password: string })
diff --git a/examples/react/start-basic-auth/src/routes/_authed/posts.$postId.tsx b/examples/react/start-basic-auth/src/routes/_authed/posts.$postId.tsx
index 763ac98f14..039271bb89 100644
--- a/examples/react/start-basic-auth/src/routes/_authed/posts.$postId.tsx
+++ b/examples/react/start-basic-auth/src/routes/_authed/posts.$postId.tsx
@@ -1,7 +1,7 @@
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from 'src/components/NotFound.js'
-import { fetchPost } from 'src/utils/posts.js'
+import { NotFound } from '~/components/NotFound.js'
+import { fetchPost } from '~/utils/posts.js'
export const Route = createFileRoute('/_authed/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/examples/react/start-basic-auth/src/routes/_authed/posts.route.tsx b/examples/react/start-basic-auth/src/routes/_authed/posts.route.tsx
index a3144ce55a..86c8ef4138 100644
--- a/examples/react/start-basic-auth/src/routes/_authed/posts.route.tsx
+++ b/examples/react/start-basic-auth/src/routes/_authed/posts.route.tsx
@@ -1,5 +1,5 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from 'src/utils/posts.js'
+import { fetchPosts } from '~/utils/posts.js'
export const Route = createFileRoute('/_authed/posts')({
loader: () => fetchPosts(),
diff --git a/examples/react/start-basic-auth/src/routes/login.tsx b/examples/react/start-basic-auth/src/routes/login.tsx
index 4d06eaf91a..03ced20832 100644
--- a/examples/react/start-basic-auth/src/routes/login.tsx
+++ b/examples/react/start-basic-auth/src/routes/login.tsx
@@ -1,5 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'
-import { Login } from 'src/components/Login'
+import { Login } from '~/components/Login'
export const Route = createFileRoute('/login')({
component: LoginComp,
diff --git a/examples/react/start-basic-auth/src/routes/logout.tsx b/examples/react/start-basic-auth/src/routes/logout.tsx
index 5bed47b3ed..d072c25008 100644
--- a/examples/react/start-basic-auth/src/routes/logout.tsx
+++ b/examples/react/start-basic-auth/src/routes/logout.tsx
@@ -1,6 +1,6 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
-import { useAppSession } from 'src/utils/session'
+import { useAppSession } from '~/utils/session'
const logoutFn = createServerFn().handler(async () => {
const session = await useAppSession()
diff --git a/examples/react/start-basic-auth/src/routes/signup.tsx b/examples/react/start-basic-auth/src/routes/signup.tsx
index d22930060b..8895af0579 100644
--- a/examples/react/start-basic-auth/src/routes/signup.tsx
+++ b/examples/react/start-basic-auth/src/routes/signup.tsx
@@ -1,9 +1,9 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { createServerFn, useServerFn } from '@tanstack/react-start'
-import { hashPassword, prismaClient } from 'src/utils/prisma'
-import { useMutation } from 'src/hooks/useMutation'
-import { Auth } from 'src/components/Auth'
-import { useAppSession } from 'src/utils/session'
+import { hashPassword, prismaClient } from '~/utils/prisma'
+import { useMutation } from '~/hooks/useMutation'
+import { Auth } from '~/components/Auth'
+import { useAppSession } from '~/utils/session'
export const signupFn = createServerFn()
.validator(
diff --git a/examples/react/start-basic-rsc/src/routes/__root.tsx b/examples/react/start-basic-rsc/src/routes/__root.tsx
index 137dea301c..9d96f79ab3 100644
--- a/examples/react/start-basic-rsc/src/routes/__root.tsx
+++ b/examples/react/start-basic-rsc/src/routes/__root.tsx
@@ -7,10 +7,10 @@ import {
} from '@tanstack/react-router'
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import * as React from 'react'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
-import { NotFound } from 'src/components/NotFound'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
+import { NotFound } from '~/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from 'src/utils/seo'
+import { seo } from '~/utils/seo'
export const Route = createRootRoute({
head: () => ({
diff --git a/examples/react/start-basic-rsc/src/routes/posts.$postId.tsx b/examples/react/start-basic-rsc/src/routes/posts.$postId.tsx
index 63a622a8e2..5404a690a0 100644
--- a/examples/react/start-basic-rsc/src/routes/posts.$postId.tsx
+++ b/examples/react/start-basic-rsc/src/routes/posts.$postId.tsx
@@ -2,7 +2,7 @@ import { ErrorComponent, Link, createFileRoute } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
import { fetchPost } from '../utils/posts'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from 'src/components/NotFound'
+import { NotFound } from '~/components/NotFound'
const renderPost = createServerFn({ method: 'GET' })
.validator((postId: string) => postId)
diff --git a/examples/react/start-basic-rsc/src/routes/posts.tsx b/examples/react/start-basic-rsc/src/routes/posts.tsx
index 5f544c568d..a3ef2a2e20 100644
--- a/examples/react/start-basic-rsc/src/routes/posts.tsx
+++ b/examples/react/start-basic-rsc/src/routes/posts.tsx
@@ -1,6 +1,6 @@
import { createFileRoute } from '@tanstack/react-router'
import { createServerFn, renderRsc } from '@tanstack/react-start'
-import { renderPosts } from 'src/utils/renderPosts'
+import { renderPosts } from '~/utils/renderPosts'
export const serverRenderPosts = createServerFn({ method: 'GET' }).handler(
renderPosts,
diff --git a/examples/react/start-basic-static/src/routes/__root.tsx b/examples/react/start-basic-static/src/routes/__root.tsx
index 170fcca832..70140f2306 100644
--- a/examples/react/start-basic-static/src/routes/__root.tsx
+++ b/examples/react/start-basic-static/src/routes/__root.tsx
@@ -7,10 +7,10 @@ import {
} from '@tanstack/react-router'
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import * as React from 'react'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
-import { NotFound } from 'src/components/NotFound'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
+import { NotFound } from '~/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from 'src/utils/seo'
+import { seo } from '~/utils/seo'
export const Route = createRootRoute({
head: () => ({
diff --git a/examples/react/start-basic-static/src/routes/posts.$postId.tsx b/examples/react/start-basic-static/src/routes/posts.$postId.tsx
index 6a1f72bb07..0d4d2de8eb 100644
--- a/examples/react/start-basic-static/src/routes/posts.$postId.tsx
+++ b/examples/react/start-basic-static/src/routes/posts.$postId.tsx
@@ -1,7 +1,7 @@
import { ErrorComponent, Link, createFileRoute } from '@tanstack/react-router'
import { fetchPost } from '../utils/posts'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from 'src/components/NotFound'
+import { NotFound } from '~/components/NotFound'
export const Route = createFileRoute('/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/examples/react/start-basic-static/src/routes/users.$userId.tsx b/examples/react/start-basic-static/src/routes/users.$userId.tsx
index bbc21f1274..d166885e29 100644
--- a/examples/react/start-basic-static/src/routes/users.$userId.tsx
+++ b/examples/react/start-basic-static/src/routes/users.$userId.tsx
@@ -2,8 +2,8 @@ import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import axios from 'redaxios'
import { createServerFn } from '@tanstack/react-start'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import type { User } from 'src/utils/users'
-import { NotFound } from 'src/components/NotFound'
+import type { User } from '~/utils/users'
+import { NotFound } from '~/components/NotFound'
const fetchUser = createServerFn({ method: 'GET', type: 'static' })
.validator((d: string) => d)
diff --git a/examples/react/start-clerk-basic/src/routes/__root.tsx b/examples/react/start-clerk-basic/src/routes/__root.tsx
index 358f9d8be3..489e80715f 100644
--- a/examples/react/start-clerk-basic/src/routes/__root.tsx
+++ b/examples/react/start-clerk-basic/src/routes/__root.tsx
@@ -18,8 +18,8 @@ import { createServerFn } from '@tanstack/react-start'
import * as React from 'react'
import { getAuth } from '@clerk/tanstack-start/server'
import { getWebRequest } from '@tanstack/react-start/server'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary.js'
-import { NotFound } from 'src/components/NotFound.js'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js'
+import { NotFound } from '~/components/NotFound.js'
import appCss from '~/styles/app.css?url'
const fetchClerkAuth = createServerFn({ method: 'GET' }).handler(async () => {
diff --git a/examples/react/start-clerk-basic/src/routes/_authed/posts.$postId.tsx b/examples/react/start-clerk-basic/src/routes/_authed/posts.$postId.tsx
index 763ac98f14..039271bb89 100644
--- a/examples/react/start-clerk-basic/src/routes/_authed/posts.$postId.tsx
+++ b/examples/react/start-clerk-basic/src/routes/_authed/posts.$postId.tsx
@@ -1,7 +1,7 @@
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from 'src/components/NotFound.js'
-import { fetchPost } from 'src/utils/posts.js'
+import { NotFound } from '~/components/NotFound.js'
+import { fetchPost } from '~/utils/posts.js'
export const Route = createFileRoute('/_authed/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/examples/react/start-clerk-basic/src/routes/_authed/posts.tsx b/examples/react/start-clerk-basic/src/routes/_authed/posts.tsx
index a3144ce55a..86c8ef4138 100644
--- a/examples/react/start-clerk-basic/src/routes/_authed/posts.tsx
+++ b/examples/react/start-clerk-basic/src/routes/_authed/posts.tsx
@@ -1,5 +1,5 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from 'src/utils/posts.js'
+import { fetchPosts } from '~/utils/posts.js'
export const Route = createFileRoute('/_authed/posts')({
loader: () => fetchPosts(),
diff --git a/examples/react/start-clerk-basic/src/routes/_authed/profile.$.tsx b/examples/react/start-clerk-basic/src/routes/_authed/profile.$.tsx
index 4e0b434c2b..208a38e230 100644
--- a/examples/react/start-clerk-basic/src/routes/_authed/profile.$.tsx
+++ b/examples/react/start-clerk-basic/src/routes/_authed/profile.$.tsx
@@ -1,5 +1,5 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from 'src/utils/posts.js'
+import { fetchPosts } from '~/utils/posts.js'
export const Route = createFileRoute('/_authed/profile/$')({
loader: () => fetchPosts(),
diff --git a/examples/react/start-large/src/routes/linkProps.tsx b/examples/react/start-large/src/routes/linkProps.tsx
index cb81ec1ac7..4804161ccf 100644
--- a/examples/react/start-large/src/routes/linkProps.tsx
+++ b/examples/react/start-large/src/routes/linkProps.tsx
@@ -5,7 +5,7 @@ import {
ListItems,
MyLink,
useCustomNavigate,
-} from 'src/typePrimitives'
+} from '~/typePrimitives'
export const Route = createFileRoute('/linkProps')({
component: LinkPropsPage,
diff --git a/examples/react/start-material-ui/src/components/Counter.tsx b/examples/react/start-material-ui/src/components/Counter.tsx
index 363c5f11c4..205bbea855 100644
--- a/examples/react/start-material-ui/src/components/Counter.tsx
+++ b/examples/react/start-material-ui/src/components/Counter.tsx
@@ -1,6 +1,6 @@
import { Stack } from '@mui/material'
import { useSearch } from '@tanstack/react-router'
-import { CustomButtonLink } from 'src/components/CustomButtonLink'
+import { CustomButtonLink } from '~/components/CustomButtonLink'
export function Counter() {
const { count = 0 } = useSearch({ from: '/' })
diff --git a/examples/react/start-material-ui/src/routes/__root.tsx b/examples/react/start-material-ui/src/routes/__root.tsx
index e9a65ccfd5..6b0b217b63 100644
--- a/examples/react/start-material-ui/src/routes/__root.tsx
+++ b/examples/react/start-material-ui/src/routes/__root.tsx
@@ -10,8 +10,8 @@ import { Container, CssBaseline, ThemeProvider } from '@mui/material'
import createCache from '@emotion/cache'
import fontsourceVariableRobotoCss from '@fontsource-variable/roboto?url'
import React from 'react'
-import { theme } from 'src/setup/theme'
-import { Header } from 'src/components/Header'
+import { theme } from '~/setup/theme'
+import { Header } from '~/components/Header'
export const Route = createRootRoute({
head: () => ({
diff --git a/examples/react/start-material-ui/src/routes/index.tsx b/examples/react/start-material-ui/src/routes/index.tsx
index 667a92881d..75f5d14de4 100644
--- a/examples/react/start-material-ui/src/routes/index.tsx
+++ b/examples/react/start-material-ui/src/routes/index.tsx
@@ -1,7 +1,7 @@
import { createFileRoute } from '@tanstack/react-router'
import { Stack, Typography } from '@mui/material'
import z from 'zod'
-import { Counter } from 'src/components/Counter'
+import { Counter } from '~/components/Counter'
export const Route = createFileRoute('/')({
validateSearch: z.object({
diff --git a/examples/react/start-supabase-basic/src/routes/_authed/posts.$postId.tsx b/examples/react/start-supabase-basic/src/routes/_authed/posts.$postId.tsx
index 059f35ff73..4dd11756a8 100644
--- a/examples/react/start-supabase-basic/src/routes/_authed/posts.$postId.tsx
+++ b/examples/react/start-supabase-basic/src/routes/_authed/posts.$postId.tsx
@@ -1,7 +1,7 @@
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from 'src/components/NotFound'
-import { fetchPost } from 'src/utils/posts'
+import { NotFound } from '~/components/NotFound'
+import { fetchPost } from '~/utils/posts'
export const Route = createFileRoute('/_authed/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/examples/solid/start-bare/src/routes/index.tsx b/examples/solid/start-bare/src/routes/index.tsx
index 507865f60f..6a91bd1999 100644
--- a/examples/solid/start-bare/src/routes/index.tsx
+++ b/examples/solid/start-bare/src/routes/index.tsx
@@ -1,5 +1,5 @@
import { createFileRoute } from '@tanstack/solid-router'
-import Counter from 'src/components/Counter'
+import Counter from '~/components/Counter'
export const Route = createFileRoute('/')({
component: RouteComponent,
})
From 006bba29ee62c63d23a0c6676ccf1b8c062b26ba Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Mon, 10 Mar 2025 19:40:35 +0100
Subject: [PATCH 038/155] change "src/" back to "~/"
---
e2e/react-start/basic-auth/src/components/Login.tsx | 2 +-
e2e/react-start/basic-auth/src/routes/__root.tsx | 8 ++++----
e2e/react-start/basic-auth/src/routes/_authed.tsx | 6 +++---
.../basic-auth/src/routes/_authed/posts.$postId.tsx | 4 ++--
e2e/react-start/basic-auth/src/routes/_authed/posts.tsx | 2 +-
e2e/react-start/basic-auth/src/routes/login.tsx | 2 +-
e2e/react-start/basic-auth/src/routes/logout.tsx | 2 +-
e2e/react-start/basic-auth/src/routes/signup.tsx | 8 ++++----
e2e/react-start/basic-react-query/src/routes/__root.tsx | 6 +++---
.../basic-react-query/src/routes/posts.$postId.tsx | 4 ++--
e2e/react-start/basic-react-query/src/routes/posts.tsx | 2 +-
.../basic-react-query/src/routes/users.$userId.tsx | 4 ++--
e2e/react-start/basic-react-query/src/routes/users.tsx | 2 +-
e2e/react-start/basic/src/routes/__root.tsx | 6 +++---
e2e/react-start/basic/src/routes/index.tsx | 2 +-
e2e/react-start/basic/src/routes/posts.$postId.tsx | 4 ++--
e2e/react-start/basic/src/routes/posts.tsx | 2 +-
e2e/react-start/basic/src/routes/users.$userId.tsx | 6 +++---
e2e/react-start/basic/src/routes/users.tsx | 4 ++--
e2e/react-start/clerk-basic/src/routes/__root.tsx | 4 ++--
.../clerk-basic/src/routes/_authed/posts.$postId.tsx | 4 ++--
e2e/react-start/clerk-basic/src/routes/_authed/posts.tsx | 2 +-
.../clerk-basic/src/routes/_authed/profile.$.tsx | 2 +-
.../scroll-restoration/src/routes/(tests)/with-loader.tsx | 2 +-
e2e/react-start/scroll-restoration/src/routes/__root.tsx | 6 +++---
e2e/solid-start/scroll-restoration/src/routes/__root.tsx | 6 +++---
e2e/solid-start/server-functions/src/routes/__root.tsx | 4 ++--
e2e/solid-start/website/src/routes/__root.tsx | 4 ++--
e2e/solid-start/website/src/routes/_library.$project.tsx | 4 ++--
e2e/solid-start/website/src/routes/_library.tsx | 2 +-
30 files changed, 58 insertions(+), 58 deletions(-)
diff --git a/e2e/react-start/basic-auth/src/components/Login.tsx b/e2e/react-start/basic-auth/src/components/Login.tsx
index 9ba6b8f019..b6b6da0c37 100644
--- a/e2e/react-start/basic-auth/src/components/Login.tsx
+++ b/e2e/react-start/basic-auth/src/components/Login.tsx
@@ -3,7 +3,7 @@ import { useServerFn } from '@tanstack/react-start'
import { useMutation } from '../hooks/useMutation'
import { loginFn } from '../routes/_authed'
import { Auth } from './Auth'
-import { signupFn } from 'src/routes/signup'
+import { signupFn } from '~/routes/signup'
export function Login() {
const router = useRouter()
diff --git a/e2e/react-start/basic-auth/src/routes/__root.tsx b/e2e/react-start/basic-auth/src/routes/__root.tsx
index 3eeb03a93d..a3c8d1e872 100644
--- a/e2e/react-start/basic-auth/src/routes/__root.tsx
+++ b/e2e/react-start/basic-auth/src/routes/__root.tsx
@@ -9,11 +9,11 @@ import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import { createServerFn } from '@tanstack/react-start'
import * as React from 'react'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary.js'
-import { NotFound } from 'src/components/NotFound.js'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js'
+import { NotFound } from '~/components/NotFound.js'
import appCss from '~/styles/app.css?url'
-import { seo } from 'src/utils/seo.js'
-import { useAppSession } from 'src/utils/session.js'
+import { seo } from '~/utils/seo.js'
+import { useAppSession } from '~/utils/session.js'
const fetchUser = createServerFn({ method: 'GET' }).handler(async () => {
// We need to auth on the server so we have access to secure cookies
diff --git a/e2e/react-start/basic-auth/src/routes/_authed.tsx b/e2e/react-start/basic-auth/src/routes/_authed.tsx
index b238afe63f..c457cf5e57 100644
--- a/e2e/react-start/basic-auth/src/routes/_authed.tsx
+++ b/e2e/react-start/basic-auth/src/routes/_authed.tsx
@@ -1,9 +1,9 @@
import { createFileRoute } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
-import { hashPassword, prismaClient } from 'src/utils/prisma'
-import { Login } from 'src/components/Login'
-import { useAppSession } from 'src/utils/session'
+import { hashPassword, prismaClient } from '~/utils/prisma'
+import { Login } from '~/components/Login'
+import { useAppSession } from '~/utils/session'
export const loginFn = createServerFn({
method: 'POST',
diff --git a/e2e/react-start/basic-auth/src/routes/_authed/posts.$postId.tsx b/e2e/react-start/basic-auth/src/routes/_authed/posts.$postId.tsx
index 612394673b..27296b9658 100644
--- a/e2e/react-start/basic-auth/src/routes/_authed/posts.$postId.tsx
+++ b/e2e/react-start/basic-auth/src/routes/_authed/posts.$postId.tsx
@@ -1,8 +1,8 @@
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from 'src/components/NotFound.js'
-import { fetchPost } from 'src/utils/posts.js'
+import { NotFound } from '~/components/NotFound.js'
+import { fetchPost } from '~/utils/posts.js'
export const Route = createFileRoute('/_authed/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/e2e/react-start/basic-auth/src/routes/_authed/posts.tsx b/e2e/react-start/basic-auth/src/routes/_authed/posts.tsx
index d769f02b68..c01f12c49a 100644
--- a/e2e/react-start/basic-auth/src/routes/_authed/posts.tsx
+++ b/e2e/react-start/basic-auth/src/routes/_authed/posts.tsx
@@ -1,6 +1,6 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from 'src/utils/posts.js'
+import { fetchPosts } from '~/utils/posts.js'
export const Route = createFileRoute('/_authed/posts')({
loader: () => fetchPosts(),
diff --git a/e2e/react-start/basic-auth/src/routes/login.tsx b/e2e/react-start/basic-auth/src/routes/login.tsx
index ef419a72f7..19dc34a439 100644
--- a/e2e/react-start/basic-auth/src/routes/login.tsx
+++ b/e2e/react-start/basic-auth/src/routes/login.tsx
@@ -1,6 +1,6 @@
import { createFileRoute } from '@tanstack/react-router'
-import { Login } from 'src/components/Login'
+import { Login } from '~/components/Login'
export const Route = createFileRoute('/login')({
component: LoginComp,
diff --git a/e2e/react-start/basic-auth/src/routes/logout.tsx b/e2e/react-start/basic-auth/src/routes/logout.tsx
index 0060780d11..43a14fa39a 100644
--- a/e2e/react-start/basic-auth/src/routes/logout.tsx
+++ b/e2e/react-start/basic-auth/src/routes/logout.tsx
@@ -1,7 +1,7 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
-import { useAppSession } from 'src/utils/session'
+import { useAppSession } from '~/utils/session'
const logoutFn = createServerFn({ method: 'POST' }).handler(async () => {
const session = await useAppSession()
diff --git a/e2e/react-start/basic-auth/src/routes/signup.tsx b/e2e/react-start/basic-auth/src/routes/signup.tsx
index 864ab0ab38..5edbb4993f 100644
--- a/e2e/react-start/basic-auth/src/routes/signup.tsx
+++ b/e2e/react-start/basic-auth/src/routes/signup.tsx
@@ -1,10 +1,10 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { createServerFn, useServerFn } from '@tanstack/react-start'
-import { hashPassword, prismaClient } from 'src/utils/prisma'
-import { useMutation } from 'src/hooks/useMutation'
-import { Auth } from 'src/components/Auth'
-import { useAppSession } from 'src/utils/session'
+import { hashPassword, prismaClient } from '~/utils/prisma'
+import { useMutation } from '~/hooks/useMutation'
+import { Auth } from '~/components/Auth'
+import { useAppSession } from '~/utils/session'
export const signupFn = createServerFn({
method: 'POST',
diff --git a/e2e/react-start/basic-react-query/src/routes/__root.tsx b/e2e/react-start/basic-react-query/src/routes/__root.tsx
index ff8b829c6a..6bd9e76801 100644
--- a/e2e/react-start/basic-react-query/src/routes/__root.tsx
+++ b/e2e/react-start/basic-react-query/src/routes/__root.tsx
@@ -9,10 +9,10 @@ import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import { TanStackRouterDevtoolsInProd } from '@tanstack/react-router-devtools'
import * as React from 'react'
import type { QueryClient } from '@tanstack/react-query'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
-import { NotFound } from 'src/components/NotFound'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
+import { NotFound } from '~/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from 'src/utils/seo'
+import { seo } from '~/utils/seo'
export const Route = createRootRouteWithContext<{
queryClient: QueryClient
diff --git a/e2e/react-start/basic-react-query/src/routes/posts.$postId.tsx b/e2e/react-start/basic-react-query/src/routes/posts.$postId.tsx
index 688e23a674..16a6bf29aa 100644
--- a/e2e/react-start/basic-react-query/src/routes/posts.$postId.tsx
+++ b/e2e/react-start/basic-react-query/src/routes/posts.$postId.tsx
@@ -2,8 +2,8 @@ import { ErrorComponent, Link, createFileRoute } from '@tanstack/react-router'
import { useSuspenseQuery } from '@tanstack/react-query'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { postQueryOptions } from 'src/utils/posts'
-import { NotFound } from 'src/components/NotFound'
+import { postQueryOptions } from '~/utils/posts'
+import { NotFound } from '~/components/NotFound'
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params: { postId }, context }) => {
diff --git a/e2e/react-start/basic-react-query/src/routes/posts.tsx b/e2e/react-start/basic-react-query/src/routes/posts.tsx
index 83919aafc9..3f678ed1f1 100644
--- a/e2e/react-start/basic-react-query/src/routes/posts.tsx
+++ b/e2e/react-start/basic-react-query/src/routes/posts.tsx
@@ -1,7 +1,7 @@
import { useSuspenseQuery } from '@tanstack/react-query'
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { postsQueryOptions } from 'src/utils/posts'
+import { postsQueryOptions } from '~/utils/posts'
export const Route = createFileRoute('/posts')({
loader: async ({ context }) => {
diff --git a/e2e/react-start/basic-react-query/src/routes/users.$userId.tsx b/e2e/react-start/basic-react-query/src/routes/users.$userId.tsx
index 8db366a551..656fb6dbb8 100644
--- a/e2e/react-start/basic-react-query/src/routes/users.$userId.tsx
+++ b/e2e/react-start/basic-react-query/src/routes/users.$userId.tsx
@@ -2,8 +2,8 @@ import { useSuspenseQuery } from '@tanstack/react-query'
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from 'src/components/NotFound'
-import { userQueryOptions } from 'src/utils/users'
+import { NotFound } from '~/components/NotFound'
+import { userQueryOptions } from '~/utils/users'
export const Route = createFileRoute('/users/$userId')({
loader: async ({ context, params: { userId } }) => {
diff --git a/e2e/react-start/basic-react-query/src/routes/users.tsx b/e2e/react-start/basic-react-query/src/routes/users.tsx
index c0ad4349aa..1b56bb9890 100644
--- a/e2e/react-start/basic-react-query/src/routes/users.tsx
+++ b/e2e/react-start/basic-react-query/src/routes/users.tsx
@@ -1,7 +1,7 @@
import { useSuspenseQuery } from '@tanstack/react-query'
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { usersQueryOptions } from 'src/utils/users'
+import { usersQueryOptions } from '~/utils/users'
export const Route = createFileRoute('/users')({
loader: async ({ context }) => {
diff --git a/e2e/react-start/basic/src/routes/__root.tsx b/e2e/react-start/basic/src/routes/__root.tsx
index 9c62771a63..1b64b1c468 100644
--- a/e2e/react-start/basic/src/routes/__root.tsx
+++ b/e2e/react-start/basic/src/routes/__root.tsx
@@ -7,10 +7,10 @@ import {
createRootRoute,
} from '@tanstack/react-router'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
-import { NotFound } from 'src/components/NotFound'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
+import { NotFound } from '~/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from 'src/utils/seo'
+import { seo } from '~/utils/seo'
export const Route = createRootRoute({
head: () => ({
diff --git a/e2e/react-start/basic/src/routes/index.tsx b/e2e/react-start/basic/src/routes/index.tsx
index 55e4693651..37169a78b4 100644
--- a/e2e/react-start/basic/src/routes/index.tsx
+++ b/e2e/react-start/basic/src/routes/index.tsx
@@ -1,5 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'
-import { CustomMessage } from 'src/components/CustomMessage'
+import { CustomMessage } from '~/components/CustomMessage'
export const Route = createFileRoute('/')({
component: Home,
diff --git a/e2e/react-start/basic/src/routes/posts.$postId.tsx b/e2e/react-start/basic/src/routes/posts.$postId.tsx
index 368c1d3c1f..005228a0fe 100644
--- a/e2e/react-start/basic/src/routes/posts.$postId.tsx
+++ b/e2e/react-start/basic/src/routes/posts.$postId.tsx
@@ -1,8 +1,8 @@
import { ErrorComponent, Link, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { fetchPost } from 'src/utils/posts'
-import { NotFound } from 'src/components/NotFound'
+import { fetchPost } from '~/utils/posts'
+import { NotFound } from '~/components/NotFound'
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/e2e/react-start/basic/src/routes/posts.tsx b/e2e/react-start/basic/src/routes/posts.tsx
index 60e9aa37c3..0f69c18341 100644
--- a/e2e/react-start/basic/src/routes/posts.tsx
+++ b/e2e/react-start/basic/src/routes/posts.tsx
@@ -1,6 +1,6 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from 'src/utils/posts'
+import { fetchPosts } from '~/utils/posts'
export const Route = createFileRoute('/posts')({
head: () => ({
diff --git a/e2e/react-start/basic/src/routes/users.$userId.tsx b/e2e/react-start/basic/src/routes/users.$userId.tsx
index 56f0a472da..1e2921411a 100644
--- a/e2e/react-start/basic/src/routes/users.$userId.tsx
+++ b/e2e/react-start/basic/src/routes/users.$userId.tsx
@@ -2,9 +2,9 @@ import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import axios from 'redaxios'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import type { User } from 'src/utils/users'
-import { DEPLOY_URL } from 'src/utils/users'
-import { NotFound } from 'src/components/NotFound'
+import type { User } from '~/utils/users'
+import { DEPLOY_URL } from '~/utils/users'
+import { NotFound } from '~/components/NotFound'
export const Route = createFileRoute('/users/$userId')({
loader: async ({ params: { userId } }) => {
diff --git a/e2e/react-start/basic/src/routes/users.tsx b/e2e/react-start/basic/src/routes/users.tsx
index d4bdb8f53c..45e070657e 100644
--- a/e2e/react-start/basic/src/routes/users.tsx
+++ b/e2e/react-start/basic/src/routes/users.tsx
@@ -1,8 +1,8 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
import axios from 'redaxios'
-import type { User } from 'src/utils/users'
-import { DEPLOY_URL } from 'src/utils/users'
+import type { User } from '~/utils/users'
+import { DEPLOY_URL } from '~/utils/users'
export const Route = createFileRoute('/users')({
loader: async () => {
diff --git a/e2e/react-start/clerk-basic/src/routes/__root.tsx b/e2e/react-start/clerk-basic/src/routes/__root.tsx
index 0ad96f9375..1773a381d0 100644
--- a/e2e/react-start/clerk-basic/src/routes/__root.tsx
+++ b/e2e/react-start/clerk-basic/src/routes/__root.tsx
@@ -18,8 +18,8 @@ import { createServerFn } from '@tanstack/react-start'
import * as React from 'react'
import { getAuth } from '@clerk/tanstack-start/server'
import { getWebRequest } from '@tanstack/react-start/server'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary.js'
-import { NotFound } from 'src/components/NotFound.js'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js'
+import { NotFound } from '~/components/NotFound.js'
import appCss from '~/styles/app.css?url'
const fetchClerkAuth = createServerFn({ method: 'GET' }).handler(async () => {
diff --git a/e2e/react-start/clerk-basic/src/routes/_authed/posts.$postId.tsx b/e2e/react-start/clerk-basic/src/routes/_authed/posts.$postId.tsx
index 612394673b..27296b9658 100644
--- a/e2e/react-start/clerk-basic/src/routes/_authed/posts.$postId.tsx
+++ b/e2e/react-start/clerk-basic/src/routes/_authed/posts.$postId.tsx
@@ -1,8 +1,8 @@
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import type { ErrorComponentProps } from '@tanstack/react-router'
-import { NotFound } from 'src/components/NotFound.js'
-import { fetchPost } from 'src/utils/posts.js'
+import { NotFound } from '~/components/NotFound.js'
+import { fetchPost } from '~/utils/posts.js'
export const Route = createFileRoute('/_authed/posts/$postId')({
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
diff --git a/e2e/react-start/clerk-basic/src/routes/_authed/posts.tsx b/e2e/react-start/clerk-basic/src/routes/_authed/posts.tsx
index d769f02b68..c01f12c49a 100644
--- a/e2e/react-start/clerk-basic/src/routes/_authed/posts.tsx
+++ b/e2e/react-start/clerk-basic/src/routes/_authed/posts.tsx
@@ -1,6 +1,6 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from 'src/utils/posts.js'
+import { fetchPosts } from '~/utils/posts.js'
export const Route = createFileRoute('/_authed/posts')({
loader: () => fetchPosts(),
diff --git a/e2e/react-start/clerk-basic/src/routes/_authed/profile.$.tsx b/e2e/react-start/clerk-basic/src/routes/_authed/profile.$.tsx
index 892d3a7fd9..1e5a8b1429 100644
--- a/e2e/react-start/clerk-basic/src/routes/_authed/profile.$.tsx
+++ b/e2e/react-start/clerk-basic/src/routes/_authed/profile.$.tsx
@@ -1,6 +1,6 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from 'src/utils/posts.js'
+import { fetchPosts } from '~/utils/posts.js'
export const Route = createFileRoute('/_authed/profile/$')({
loader: () => fetchPosts(),
diff --git a/e2e/react-start/scroll-restoration/src/routes/(tests)/with-loader.tsx b/e2e/react-start/scroll-restoration/src/routes/(tests)/with-loader.tsx
index 6a8a0bc545..dfd4c7bf13 100644
--- a/e2e/react-start/scroll-restoration/src/routes/(tests)/with-loader.tsx
+++ b/e2e/react-start/scroll-restoration/src/routes/(tests)/with-loader.tsx
@@ -1,6 +1,6 @@
import { createFileRoute } from '@tanstack/react-router'
import { ScrollBlock } from '../-components/scroll-block'
-import { sleep } from 'src/utils/posts'
+import { sleep } from '~/utils/posts'
export const Route = createFileRoute('/(tests)/with-loader')({
loader: async () => {
diff --git a/e2e/react-start/scroll-restoration/src/routes/__root.tsx b/e2e/react-start/scroll-restoration/src/routes/__root.tsx
index 1628a4ab07..07037679f0 100644
--- a/e2e/react-start/scroll-restoration/src/routes/__root.tsx
+++ b/e2e/react-start/scroll-restoration/src/routes/__root.tsx
@@ -8,10 +8,10 @@ import {
Scripts,
} from '@tanstack/react-router'
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
-import { NotFound } from 'src/components/NotFound'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
+import { NotFound } from '~/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from 'src/utils/seo'
+import { seo } from '~/utils/seo'
export const Route = createRootRoute({
head: () => ({
diff --git a/e2e/solid-start/scroll-restoration/src/routes/__root.tsx b/e2e/solid-start/scroll-restoration/src/routes/__root.tsx
index 72e2c59c9e..5907fa6ecd 100644
--- a/e2e/solid-start/scroll-restoration/src/routes/__root.tsx
+++ b/e2e/solid-start/scroll-restoration/src/routes/__root.tsx
@@ -7,10 +7,10 @@ import {
HeadContent,
Scripts,
} from '@tanstack/solid-router'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
-import { NotFound } from 'src/components/NotFound'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
+import { NotFound } from '~/components/NotFound'
import appCss from '~/styles/app.css?url'
-import { seo } from 'src/utils/seo'
+import { seo } from '~/utils/seo'
import { Dynamic } from 'solid-js/web'
import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
diff --git a/e2e/solid-start/server-functions/src/routes/__root.tsx b/e2e/solid-start/server-functions/src/routes/__root.tsx
index 6c801f97ad..52d64bf7a7 100644
--- a/e2e/solid-start/server-functions/src/routes/__root.tsx
+++ b/e2e/solid-start/server-functions/src/routes/__root.tsx
@@ -1,7 +1,7 @@
import { Outlet, createRootRoute } from '@tanstack/solid-router'
-import { DefaultCatchBoundary } from 'src/components/DefaultCatchBoundary'
-import { NotFound } from 'src/components/NotFound'
+import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
+import { NotFound } from '~/components/NotFound'
import appCss from '~/styles/app.css?url'
import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
diff --git a/e2e/solid-start/website/src/routes/__root.tsx b/e2e/solid-start/website/src/routes/__root.tsx
index b232d1f84a..514d187924 100644
--- a/e2e/solid-start/website/src/routes/__root.tsx
+++ b/e2e/solid-start/website/src/routes/__root.tsx
@@ -1,8 +1,8 @@
import { Outlet, createRootRoute } from '@tanstack/solid-router'
-import { NotFound } from 'src/components/NotFound'
+import { NotFound } from '~/components/NotFound'
import appCss from '~/styles/app.css?url'
import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
-import { seo } from 'src/utils/seo'
+import { seo } from '~/utils/seo'
export const Route = createRootRoute({
head: () => ({
diff --git a/e2e/solid-start/website/src/routes/_library.$project.tsx b/e2e/solid-start/website/src/routes/_library.$project.tsx
index 97e161065e..6fdcb8e530 100644
--- a/e2e/solid-start/website/src/routes/_library.$project.tsx
+++ b/e2e/solid-start/website/src/routes/_library.$project.tsx
@@ -1,6 +1,6 @@
import { Outlet, createFileRoute } from '@tanstack/solid-router'
-import { getProject } from 'src/server/projects'
-import { seo } from 'src/utils/seo'
+import { getProject } from '~/server/projects'
+import { seo } from '~/utils/seo'
export const Route = createFileRoute('/_library/$project')({
loader: ({ params: { project } }) => getProject({ data: project }),
diff --git a/e2e/solid-start/website/src/routes/_library.tsx b/e2e/solid-start/website/src/routes/_library.tsx
index 3b1a7a406e..c25ae5cfe1 100644
--- a/e2e/solid-start/website/src/routes/_library.tsx
+++ b/e2e/solid-start/website/src/routes/_library.tsx
@@ -4,7 +4,7 @@ import {
createFileRoute,
useLocation,
} from '@tanstack/solid-router'
-import { getProjects } from 'src/server/projects'
+import { getProjects } from '~/server/projects'
export const Route = createFileRoute('/_library')({
loader: async () => {
From 8176e758dd43bdd7aa5aaa7937ca33b86978411e Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Mon, 10 Mar 2025 20:03:13 +0100
Subject: [PATCH 039/155] sync main
---
docs/start/framework/react/path-aliases.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/start/framework/react/path-aliases.md b/docs/start/framework/react/path-aliases.md
index ef65f4771b..d0c0b24577 100644
--- a/docs/start/framework/react/path-aliases.md
+++ b/docs/start/framework/react/path-aliases.md
@@ -12,7 +12,7 @@ By default, TanStack Start does not include path aliases. However, you can easil
"compilerOptions": {
"baseUrl": ".",
"paths": {
- "~/*": ["src/*"]
+ "~/*": ["./src/*"]
}
}
}
From 916e1a51be203bcd60b1a14bc2a4239ef6be2b00 Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Mon, 10 Mar 2025 15:46:39 -0600
Subject: [PATCH 040/155] fix: devinxi checkpoint
---
.../react/start-basic/src/routeTree.gen.ts | 21 --------
.../react/start-basic/src/routes/__root.tsx | 2 +-
.../react/start-basic/src/routes/_layout.tsx | 16 -------
.../start-basic/src/routes/posts.route.tsx | 38 ---------------
.../start-basic/src/routes/users.route.tsx | 48 -------------------
packages/react-start-server/tsconfig.json | 7 ++-
packages/start-server-core/package.json | 3 +-
.../src/createStartHandler.ts | 9 ++--
packages/start-server-core/src/index.tsx | 2 +-
.../src/server-functions-handler.ts | 13 +----
pnpm-lock.yaml | 3 ++
11 files changed, 18 insertions(+), 144 deletions(-)
delete mode 100644 examples/react/start-basic/src/routes/_layout.tsx
delete mode 100644 examples/react/start-basic/src/routes/posts.route.tsx
delete mode 100644 examples/react/start-basic/src/routes/users.route.tsx
rename packages/{react-start-server => start-server-core}/src/createStartHandler.ts (93%)
rename packages/{react-start-server => start-server-core}/src/server-functions-handler.ts (98%)
diff --git a/examples/react/start-basic/src/routeTree.gen.ts b/examples/react/start-basic/src/routeTree.gen.ts
index 12ee484c06..762ce1516f 100644
--- a/examples/react/start-basic/src/routeTree.gen.ts
+++ b/examples/react/start-basic/src/routeTree.gen.ts
@@ -16,7 +16,6 @@ import { Route as RedirectImport } from './routes/redirect'
import { Route as PostsImport } from './routes/posts'
import { Route as DeferredImport } from './routes/deferred'
import { Route as PathlessLayoutImport } from './routes/_pathlessLayout'
-import { Route as LayoutImport } from './routes/_layout'
import { Route as IndexImport } from './routes/index'
import { Route as UsersIndexImport } from './routes/users.index'
import { Route as PostsIndexImport } from './routes/posts.index'
@@ -58,11 +57,6 @@ const PathlessLayoutRoute = PathlessLayoutImport.update({
getParentRoute: () => rootRoute,
} as any)
-const LayoutRoute = LayoutImport.update({
- id: '/_layout',
- getParentRoute: () => rootRoute,
-} as any)
-
const IndexRoute = IndexImport.update({
id: '/',
path: '/',
@@ -131,13 +125,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof IndexImport
parentRoute: typeof rootRoute
}
- '/_layout': {
- id: '/_layout'
- path: ''
- fullPath: ''
- preLoaderRoute: typeof LayoutImport
- parentRoute: typeof rootRoute
- }
'/_pathlessLayout': {
id: '/_pathlessLayout'
path: ''
@@ -321,7 +308,6 @@ export interface FileRoutesByTo {
export interface FileRoutesById {
__root__: typeof rootRoute
'/': typeof IndexRoute
- '/_layout': typeof LayoutRoute
'/_pathlessLayout': typeof PathlessLayoutRouteWithChildren
'/deferred': typeof DeferredRoute
'/posts': typeof PostsRouteWithChildren
@@ -369,7 +355,6 @@ export interface FileRouteTypes {
id:
| '__root__'
| '/'
- | '/_layout'
| '/_pathlessLayout'
| '/deferred'
| '/posts'
@@ -388,7 +373,6 @@ export interface FileRouteTypes {
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
- LayoutRoute: typeof LayoutRoute
PathlessLayoutRoute: typeof PathlessLayoutRouteWithChildren
DeferredRoute: typeof DeferredRoute
PostsRoute: typeof PostsRouteWithChildren
@@ -399,7 +383,6 @@ export interface RootRouteChildren {
const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
- LayoutRoute: LayoutRoute,
PathlessLayoutRoute: PathlessLayoutRouteWithChildren,
DeferredRoute: DeferredRoute,
PostsRoute: PostsRouteWithChildren,
@@ -419,7 +402,6 @@ export const routeTree = rootRoute
"filePath": "__root.tsx",
"children": [
"/",
- "/_layout",
"/_pathlessLayout",
"/deferred",
"/posts",
@@ -431,9 +413,6 @@ export const routeTree = rootRoute
"/": {
"filePath": "index.tsx"
},
- "/_layout": {
- "filePath": "_layout.tsx"
- },
"/_pathlessLayout": {
"filePath": "_pathlessLayout.tsx",
"children": [
diff --git a/examples/react/start-basic/src/routes/__root.tsx b/examples/react/start-basic/src/routes/__root.tsx
index 30f0a42b4c..70140f2306 100644
--- a/examples/react/start-basic/src/routes/__root.tsx
+++ b/examples/react/start-basic/src/routes/__root.tsx
@@ -5,7 +5,7 @@ import {
Scripts,
createRootRoute,
} from '@tanstack/react-router'
-import { TanStackRouterDevtools } from '@tanstack/router-devtools'
+import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import * as React from 'react'
import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
import { NotFound } from '~/components/NotFound'
diff --git a/examples/react/start-basic/src/routes/_layout.tsx b/examples/react/start-basic/src/routes/_layout.tsx
deleted file mode 100644
index 02ddbb1cd9..0000000000
--- a/examples/react/start-basic/src/routes/_layout.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Outlet, createFileRoute } from '@tanstack/react-router'
-
-export const Route = createFileRoute('/_layout')({
- component: LayoutComponent,
-})
-
-function LayoutComponent() {
- return (
-
- )
-}
diff --git a/examples/react/start-basic/src/routes/posts.route.tsx b/examples/react/start-basic/src/routes/posts.route.tsx
deleted file mode 100644
index ae49032459..0000000000
--- a/examples/react/start-basic/src/routes/posts.route.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import { fetchPosts } from '../utils/posts'
-
-export const Route = createFileRoute('/posts')({
- loader: async () => fetchPosts(),
- component: PostsComponent,
-})
-
-function PostsComponent() {
- const posts = Route.useLoaderData()
-
- return (
-
- )
-}
diff --git a/examples/react/start-basic/src/routes/users.route.tsx b/examples/react/start-basic/src/routes/users.route.tsx
deleted file mode 100644
index 1c51b659d9..0000000000
--- a/examples/react/start-basic/src/routes/users.route.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
-import axios from 'redaxios'
-import { DEPLOY_URL } from '../utils/users'
-import type { User } from '../utils/users'
-
-export const Route = createFileRoute('/users')({
- loader: async () => {
- return await axios
- .get>(DEPLOY_URL + '/api/users')
- .then((r) => r.data)
- .catch(() => {
- throw new Error('Failed to fetch users')
- })
- },
- component: UsersComponent,
-})
-
-function UsersComponent() {
- const users = Route.useLoaderData()
-
- return (
-
-
- {[
- ...users,
- { id: 'i-do-not-exist', name: 'Non-existent User', email: '' },
- ].map((user) => {
- return (
-
-
- {user.name}
-
-
- )
- })}
-
-
-
-
- )
-}
diff --git a/packages/react-start-server/tsconfig.json b/packages/react-start-server/tsconfig.json
index 108c78712f..b447592593 100644
--- a/packages/react-start-server/tsconfig.json
+++ b/packages/react-start-server/tsconfig.json
@@ -4,5 +4,10 @@
"jsx": "react-jsx",
"module": "esnext"
},
- "include": ["src", "tests", "vite.config.ts"]
+ "include": [
+ "src",
+ "tests",
+ "vite.config.ts",
+ "../start-server-core/src/server-functions-handler.ts"
+ ]
}
diff --git a/packages/start-server-core/package.json b/packages/start-server-core/package.json
index 07517956fa..db7584a345 100644
--- a/packages/start-server-core/package.json
+++ b/packages/start-server-core/package.json
@@ -65,10 +65,11 @@
"@tanstack/history": "workspace:^",
"@tanstack/router-core": "workspace:^",
"@tanstack/start-client-core": "workspace:^",
- "tiny-warning": "^1.0.3",
"h3": "1.13.0",
"isbot": "^5.1.22",
"jsesc": "^3.1.0",
+ "tiny-invariant": "^1.3.3",
+ "tiny-warning": "^1.0.3",
"unctx": "^2.4.1"
},
"devDependencies": {
diff --git a/packages/react-start-server/src/createStartHandler.ts b/packages/start-server-core/src/createStartHandler.ts
similarity index 93%
rename from packages/react-start-server/src/createStartHandler.ts
rename to packages/start-server-core/src/createStartHandler.ts
index 789c068ab0..b39540c05f 100644
--- a/packages/react-start-server/src/createStartHandler.ts
+++ b/packages/start-server-core/src/createStartHandler.ts
@@ -2,13 +2,10 @@ import path from 'node:path'
import { createMemoryHistory } from '@tanstack/history'
import { mergeHeaders } from '@tanstack/start-client-core'
import { eventHandler, getResponseHeaders, toWebRequest } from 'h3'
-import {
- attachRouterServerSsrUtils,
- dehydrateRouter,
- getStartManifest,
-} from '@tanstack/start-server-core'
import serverFunctionsHandler from './server-functions-handler'
-import type { HandlerCallback } from '@tanstack/start-server-core'
+import { attachRouterServerSsrUtils, dehydrateRouter } from './ssr-server'
+import { getStartManifest } from './router-manifest'
+import type { HandlerCallback } from './handlerCallback'
import type { EventHandlerResponse, H3Event } from 'h3'
import type { AnyRouter } from '@tanstack/router-core'
diff --git a/packages/start-server-core/src/index.tsx b/packages/start-server-core/src/index.tsx
index a2a239bee4..88dccaab53 100644
--- a/packages/start-server-core/src/index.tsx
+++ b/packages/start-server-core/src/index.tsx
@@ -3,7 +3,7 @@ export {
transformPipeableStreamWithRouter,
} from './transformStreamWithRouter'
-// export { createStartHandler } from './createStartHandler'
+export { createStartHandler } from './createStartHandler'
export { createRequestHandler } from './createRequestHandler'
export { getStartManifest } from './router-manifest'
diff --git a/packages/react-start-server/src/server-functions-handler.ts b/packages/start-server-core/src/server-functions-handler.ts
similarity index 98%
rename from packages/react-start-server/src/server-functions-handler.ts
rename to packages/start-server-core/src/server-functions-handler.ts
index 8ecd96df16..3422f5254a 100644
--- a/packages/react-start-server/src/server-functions-handler.ts
+++ b/packages/start-server-core/src/server-functions-handler.ts
@@ -1,19 +1,10 @@
-
import { isNotFound, isRedirect } from '@tanstack/router-core'
import invariant from 'tiny-invariant'
-
-import {
- eventHandler,
- getEvent,
- getResponseStatus,
- toWebRequest,
-} from '@tanstack/start-server-core'
-
import { startSerializer } from '@tanstack/start-client-core'
// @ts-expect-error
import _serverFnManifest from 'tsr:server-fn-manifest'
-
-import type { H3Event } from '@tanstack/start-server-core'
+import { eventHandler, getEvent, getResponseStatus, toWebRequest } from './h3'
+import type { H3Event } from './h3'
// NOTE: This is a dummy export to silence warnings about
// only having a default export.
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e6f6704bd0..932c4cbd7e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -6470,6 +6470,9 @@ importers:
jsesc:
specifier: ^3.1.0
version: 3.1.0
+ tiny-invariant:
+ specifier: ^1.3.3
+ version: 1.3.3
tiny-warning:
specifier: ^1.0.3
version: 1.0.3
From 233860badfdffbab8155b7200adfcb441be07431 Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Tue, 11 Mar 2025 09:32:46 -0600
Subject: [PATCH 041/155] checkpoint
---
examples/solid/start-bare/src/ssr.tsx | 12 ----
.../src/nitro/nitro-plugin.ts | 56 +++++++++++++++----
.../src/core/router-generator-plugin.ts | 11 ++++
3 files changed, 55 insertions(+), 24 deletions(-)
delete mode 100644 examples/solid/start-bare/src/ssr.tsx
diff --git a/examples/solid/start-bare/src/ssr.tsx b/examples/solid/start-bare/src/ssr.tsx
deleted file mode 100644
index 6d10bea05f..0000000000
--- a/examples/solid/start-bare/src/ssr.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import {
- createStartHandler,
- defaultStreamHandler,
-} from '@tanstack/solid-start/server'
-import { getRouterManifest } from '@tanstack/solid-start/router-manifest'
-
-import { createRouter } from './router'
-
-export default createStartHandler({
- createRouter,
- getRouterManifest,
-})(defaultStreamHandler)
diff --git a/packages/react-start-plugin/src/nitro/nitro-plugin.ts b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
index 13af417ecb..6e35dd62e4 100644
--- a/packages/react-start-plugin/src/nitro/nitro-plugin.ts
+++ b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
@@ -9,7 +9,7 @@ import { devServerPlugin } from './dev-server-plugin.js'
import type { NitroConfig } from 'nitropack'
import type { TanStackStartOutputConfig } from '../schema.js'
-import type { PluginOption } from 'vite'
+import type { EnvironmentOptions, PluginOption } from 'vite'
export type {
TanStackStartInputConfig,
@@ -26,6 +26,9 @@ export function nitroPlugin(
devServerPlugin(options),
{
name: 'tanstack-vite-plugin-nitro',
+ configResolved(config) {
+ // console.log(config.environments)
+ },
async config() {
const buildPreset =
process.env['BUILD_PRESET'] ??
@@ -50,21 +53,41 @@ export function nitroPlugin(
const nitroRollupOptions = getRollupConfig(nitro)
- return {
- environments: {
- server: {
- build: {
- ssr: true,
- rollupOptions: {
- ...nitroRollupOptions,
- plugins: nitroRollupOptions.plugins as Array,
- },
+ const clientOptions: EnvironmentOptions = {
+ build: {
+ rollupOptions: {
+ input: {
+ main: options.clientEntryPath,
+ },
+ },
+ },
+ }
+
+ const serverOptions: EnvironmentOptions = {
+ build: {
+ ssr: true,
+ sourcemap: true,
+ rollupOptions: {
+ ...nitroRollupOptions,
+ output: {
+ ...nitroRollupOptions.output,
+ sourcemap: undefined,
},
+ // plugins: nitroRollupOptions.plugins as Array,
},
},
+ }
+
+ // console.log('serverOptions', serverOptions.build?.rollupOptions)
+
+ return {
+ environments: {
+ client: clientOptions,
+ server: serverOptions,
+ },
builder: {
sharedPlugins: true,
- buildApp: async (builder) => {
+ async buildApp(builder) {
if (!builder.environments['client']) {
throw new Error('Client environment not found')
}
@@ -73,9 +96,18 @@ export function nitroPlugin(
throw new Error('SSR environment not found')
}
+ console.log(
+ builder.environments['server'].config.build.rollupOptions,
+ )
+
+ console.log('\n\nBuilding client...')
await builder.build(builder.environments['client'])
+
+ console.log('\n\nBuilding server...')
await builder.build(builder.environments['server'])
+ console.log('\n\nBuilding index.html...')
+
if (nitroConfig.prerender?.routes?.length && options.sitemap) {
console.log('Building Sitemap...')
// sitemap needs to be built after all directories are built
@@ -87,7 +119,7 @@ export function nitroPlugin(
}
console.log(
- `\n\nThe 'tanstack-platform' server has been successfully built.`,
+ `\n\n✅ Client and server bundles successfully built.`,
)
},
},
diff --git a/packages/router-plugin/src/core/router-generator-plugin.ts b/packages/router-plugin/src/core/router-generator-plugin.ts
index f61fd2fee5..38d6f7a5fb 100644
--- a/packages/router-plugin/src/core/router-generator-plugin.ts
+++ b/packages/router-plugin/src/core/router-generator-plugin.ts
@@ -85,8 +85,19 @@ export const unpluginRouterGeneratorFactory: UnpluginFactory<
ROOT = config.root
userConfig = getConfig(options, ROOT)
+ if (config.command === 'serve') {
+ await run(generate)
+ }
+ },
+ async buildStart() {
+ if (this.environment.name === 'server') {
+ // When building in environment mode, we only need to generate routes
+ // for the client environment
+ return
+ }
await run(generate)
},
+ sharedDuringBuild: true,
},
async rspack(compiler) {
userConfig = getConfig(options, ROOT)
From 3c1064e75b0cb3bd943c1c8fa3c1581bfe2ca78b Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Tue, 11 Mar 2025 16:19:08 -0600
Subject: [PATCH 042/155] checkpoint
---
examples/react/start-basic/vite.config.ts | 6 +-
packages/react-start-plugin/src/index.ts | 55 ++--
.../src/nitro/hooks/post-rendering-hook.ts | 12 -
.../nitro/hooks/post-rendering-hooks.spec.ts | 33 ---
.../src/nitro/nitro-plugin.ts | 205 +++++++++-----
.../src/routesManifestPlugin.ts | 34 ++-
.../src/core/router-generator-plugin.ts | 8 +-
packages/server-functions-plugin/src/index.ts | 26 +-
packages/start-client-core/vite.config.ts | 1 +
pnpm-lock.yaml | 259 ++----------------
10 files changed, 229 insertions(+), 410 deletions(-)
delete mode 100644 packages/react-start-plugin/src/nitro/hooks/post-rendering-hook.ts
delete mode 100644 packages/react-start-plugin/src/nitro/hooks/post-rendering-hooks.spec.ts
diff --git a/examples/react/start-basic/vite.config.ts b/examples/react/start-basic/vite.config.ts
index 698e4856da..dfee8b17e9 100644
--- a/examples/react/start-basic/vite.config.ts
+++ b/examples/react/start-basic/vite.config.ts
@@ -10,6 +10,10 @@ export default defineConfig({
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
- TanStackStartVitePlugin(),
+ TanStackStartVitePlugin({
+ server: {
+ // preset: 'netlify',
+ },
+ }),
],
})
diff --git a/packages/react-start-plugin/src/index.ts b/packages/react-start-plugin/src/index.ts
index 3ab92a4701..eb29cad8cc 100644
--- a/packages/react-start-plugin/src/index.ts
+++ b/packages/react-start-plugin/src/index.ts
@@ -6,7 +6,7 @@ import viteReact from '@vitejs/plugin-react'
import { mergeConfig } from 'vite'
import { getTanStackStartOptions } from './schema.js'
import { nitroPlugin } from './nitro/nitro-plugin.js'
-import { tsrManifestPlugin } from './routesManifestPlugin.js'
+import { startManifestPlugin } from './routesManifestPlugin.js'
import { TanStackStartCompilerPlugin } from './start-compiler-plugin.js'
import type { PluginOption } from 'vite'
import type { TanStackStartInputConfig } from './schema.js'
@@ -16,6 +16,8 @@ export type {
TanStackStartOutputConfig,
} from './schema.js'
+export const clientDistDir = 'node_modules/.tanstack-start/client-dist'
+
export function TanStackStartVitePlugin(
opts?: TanStackStartInputConfig,
): Array {
@@ -25,7 +27,7 @@ export function TanStackStartVitePlugin(
{
name: 'tss-vite-config-client',
...options.vite,
- async config(config) {
+ async config() {
// Create a dummy nitro app to get the resolved public output path
const dummyNitroApp = await createNitro({
preset: options.server.preset,
@@ -35,20 +37,32 @@ export function TanStackStartVitePlugin(
const nitroOutputPublicDir = dummyNitroApp.options.output.publicDir
await dummyNitroApp.close()
- config.environments = {
- ...(config.environments ?? {}),
- server: {
- ...(config.environments?.server ?? {}),
+ return {
+ environments: {
+ client: {
+ build: {
+ manifest: true,
+ rollupOptions: {
+ input: {
+ main: options.clientEntryPath,
+ },
+ output: {
+ dir: clientDistDir,
+ },
+ external: ['node:fs', 'node:path', 'node:os', 'node:crypto'],
+ },
+ },
+ },
+ server: {},
},
- }
-
- return mergeConfig(config, {
resolve: {
noExternal: [
'@tanstack/start',
'@tanstack/start/server',
'@tanstack/start-client',
+ '@tanstack/start-client-core',
'@tanstack/start-server',
+ '@tanstack/start-server-core',
'@tanstack/start-server-functions-fetcher',
'@tanstack/start-server-functions-client',
'@tanstack/start-server-functions-ssr',
@@ -59,11 +73,18 @@ export function TanStackStartVitePlugin(
'@tanstack/server-functions-plugin',
'tsr:start-manifest',
'tsr:server-fn-manifest',
+ 'use-sync-external-store',
+ 'use-sync-external-store/shim/with-selector',
],
},
optimizeDeps: {
entries: [],
...(options.vite?.optimizeDeps || {}),
+ include: [
+ 'use-sync-external-store',
+ 'use-sync-external-store/shim/with-selector',
+ ...(options.vite?.optimizeDeps?.include || []),
+ ],
},
/* prettier-ignore */
define: {
@@ -74,18 +95,10 @@ export function TanStackStartVitePlugin(
...injectDefineEnv('TSS_SERVER_FN_BASE', options.routers.server.base),
...injectDefineEnv('TSS_OUTPUT_PUBLIC_DIR', nitroOutputPublicDir),
},
- })
+ }
},
configEnvironment(env, config) {
if (env === 'server') {
- config = mergeConfig(config, {
- plugins: [],
- })
-
- config = mergeConfig(
- mergeConfig(config, options.vite || {}),
- options.routers.server.vite || {},
- )
} else {
config = mergeConfig(
mergeConfig(config, options.vite || {}),
@@ -125,7 +138,6 @@ hydrateRoot(document, )
}
if (id === '/~start/default-server-entry.tsx') {
- console.log('routerImportPath', routerImportPath)
return `
import { createStartHandler, defaultStreamHandler } from '@tanstack/react-start/server'
import { createRouter } from ${routerImportPath}
@@ -157,10 +169,7 @@ export default createStartHandler({
`createServerRpc('${d.functionId}', '${options.routers.server.base}', ${d.fn})`,
},
}),
- tsrManifestPlugin({
- clientBase: options.routers.client.base,
- tsrConfig: options.tsr,
- }),
+ startManifestPlugin(options),
TanStackRouterVite({
...options.tsr,
enableRouteGeneration: true,
diff --git a/packages/react-start-plugin/src/nitro/hooks/post-rendering-hook.ts b/packages/react-start-plugin/src/nitro/hooks/post-rendering-hook.ts
deleted file mode 100644
index 5bc1168c8f..0000000000
--- a/packages/react-start-plugin/src/nitro/hooks/post-rendering-hook.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import type { Nitro, PrerenderRoute } from 'nitropack'
-
-export function addPostRenderingHooks(
- nitro: Nitro,
- hooks: Array<(pr: PrerenderRoute) => Promise>,
-): void {
- hooks.forEach((hook: (preRoute: PrerenderRoute) => void) => {
- nitro.hooks.hook('prerender:generate', (route: PrerenderRoute) => {
- hook(route)
- })
- })
-}
diff --git a/packages/react-start-plugin/src/nitro/hooks/post-rendering-hooks.spec.ts b/packages/react-start-plugin/src/nitro/hooks/post-rendering-hooks.spec.ts
deleted file mode 100644
index bda3dbc7f3..0000000000
--- a/packages/react-start-plugin/src/nitro/hooks/post-rendering-hooks.spec.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { describe, expect, it, vi } from 'vitest'
-
-import { addPostRenderingHooks } from './post-rendering-hook'
-import type { Nitro } from 'nitropack'
-
-describe('postRenderingHook', () => {
- const genRoute = {
- route: 'test/testRoute',
- contents: 'This is a test.',
- }
-
- const nitroMock = {
- hooks: {
- hook: vi.fn((name: string, callback: (route: any) => void) =>
- callback(genRoute),
- ),
- },
- } as unknown as Nitro
-
- const mockFunc1 = vi.fn()
- const mockFunc2 = vi.fn()
-
- it('should not attempt to call nitro mocks if no callbacks provided', () => {
- addPostRenderingHooks(nitroMock, [])
- expect(nitroMock.hooks.hook).not.toHaveBeenCalled()
- })
-
- it('should call provided hooks', () => {
- addPostRenderingHooks(nitroMock, [mockFunc1, mockFunc2])
- expect(mockFunc1).toHaveBeenCalledWith(genRoute)
- expect(mockFunc2).toHaveBeenCalled()
- })
-})
diff --git a/packages/react-start-plugin/src/nitro/nitro-plugin.ts b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
index 6e35dd62e4..f3d0b3e847 100644
--- a/packages/react-start-plugin/src/nitro/nitro-plugin.ts
+++ b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
@@ -1,16 +1,17 @@
-import { resolve } from 'node:path'
import { platform } from 'node:os'
+import { promises as fsp } from 'node:fs'
+import path from 'node:path'
+import { copyPublicAssets, createNitro, prepare } from 'nitropack'
+import { version } from 'nitropack/meta'
import { normalizePath } from 'vite'
-import { getRollupConfig } from 'nitropack/rollup'
-import { createNitro } from 'nitropack'
-import { buildSitemap } from './build-sitemap.js'
+import { getRollupConfig } from 'nitropack/rollup'
+import { clientDistDir } from '../index.js'
import { devServerPlugin } from './dev-server-plugin.js'
-import type { NitroConfig } from 'nitropack'
+import type { PluginOption } from 'vite'
+import type { Nitro, NitroConfig } from 'nitropack'
import type { TanStackStartOutputConfig } from '../schema.js'
-import type { EnvironmentOptions, PluginOption } from 'vite'
-
export type {
TanStackStartInputConfig,
TanStackStartOutputConfig,
@@ -22,69 +23,68 @@ const filePrefix = isWindows ? 'file:///' : ''
export function nitroPlugin(
options: TanStackStartOutputConfig,
): Array {
+ let nitro: Nitro
+ let nitroRollupOptions: ReturnType
+
+ const buildPreset =
+ process.env['BUILD_PRESET'] ?? (options.server.preset as string | undefined)
+
+ const nitroConfig: NitroConfig = {
+ compatibilityDate: '2024-11-19',
+ logLevel: options.server.logLevel || 0,
+ srcDir: normalizePath(options.tsr.srcDirectory),
+ ...options.server,
+ preset: buildPreset,
+ publicAssets: [
+ {
+ dir: clientDistDir,
+ },
+ ],
+ typescript: {
+ generateTsConfig: false,
+ },
+ prerender: {
+ ...options.server.prerender,
+ routes: ['/', ...(options.server.prerender?.routes || [])],
+ },
+ renderer: options.serverEntryPath,
+ }
+
return [
devServerPlugin(options),
{
name: 'tanstack-vite-plugin-nitro',
- configResolved(config) {
+ configResolved() {
// console.log(config.environments)
},
- async config() {
- const buildPreset =
- process.env['BUILD_PRESET'] ??
- (options.server.preset as string | undefined)
-
- const nitroConfig: NitroConfig = {
- ...options.server,
- preset: buildPreset,
- compatibilityDate: '2024-11-19',
- logLevel: options.server.logLevel || 0,
- srcDir: normalizePath(options.tsr.srcDirectory),
- // renderer: filePrefix + normalizePath(options.ssrEntryPath),
- }
-
- const nitro = await createNitro({
+ async configEnvironment(name) {
+ nitro = await createNitro({
dev: false,
...nitroConfig,
- typescript: {
- generateTsConfig: false,
- },
})
- const nitroRollupOptions = getRollupConfig(nitro)
-
- const clientOptions: EnvironmentOptions = {
- build: {
- rollupOptions: {
- input: {
- main: options.clientEntryPath,
+ nitroRollupOptions = getRollupConfig(nitro)
+
+ if (name === 'server') {
+ return {
+ build: {
+ ssr: true,
+ sourcemap: true,
+ rollupOptions: {
+ ...nitroRollupOptions,
+ output: {
+ ...nitroRollupOptions.output,
+ sourcemap: undefined,
+ },
},
},
- },
+ }
}
- const serverOptions: EnvironmentOptions = {
- build: {
- ssr: true,
- sourcemap: true,
- rollupOptions: {
- ...nitroRollupOptions,
- output: {
- ...nitroRollupOptions.output,
- sourcemap: undefined,
- },
- // plugins: nitroRollupOptions.plugins as Array,
- },
- },
- }
-
- // console.log('serverOptions', serverOptions.build?.rollupOptions)
-
+ return null
+ },
+ config() {
return {
- environments: {
- client: clientOptions,
- server: serverOptions,
- },
builder: {
sharedPlugins: true,
async buildApp(builder) {
@@ -96,35 +96,96 @@ export function nitroPlugin(
throw new Error('SSR environment not found')
}
- console.log(
- builder.environments['server'].config.build.rollupOptions,
- )
-
- console.log('\n\nBuilding client...')
await builder.build(builder.environments['client'])
+ await prepare(nitro)
+ await copyPublicAssets(nitro)
+
+ // if (
+ // nitroConfig.prerender?.routes &&
+ // nitroConfig.prerender.routes.length > 0
+ // ) {
+ // console.log(`Prerendering static pages...`)
+ // await prerender(nitro)
+ // }
- console.log('\n\nBuilding server...')
await builder.build(builder.environments['server'])
- console.log('\n\nBuilding index.html...')
+ const buildInfoPath = path.resolve(
+ nitro.options.output.dir,
+ 'nitro.json',
+ )
- if (nitroConfig.prerender?.routes?.length && options.sitemap) {
- console.log('Building Sitemap...')
- // sitemap needs to be built after all directories are built
- await buildSitemap({
- host: options.sitemap.host,
- routes: nitroConfig.prerender.routes,
- outputDir: resolve(options.root, 'dist/public'),
- })
+ const presetsWithConfig = [
+ 'awsAmplify',
+ 'awsLambda',
+ 'azure',
+ 'cloudflare',
+ 'firebase',
+ 'netlify',
+ 'vercel',
+ ]
+
+ const buildInfo = {
+ date: /* @__PURE__ */ new Date().toJSON(),
+ preset: nitro.options.preset,
+ framework: nitro.options.framework,
+ versions: {
+ nitro: version,
+ },
+ commands: {
+ preview: nitro.options.commands.preview,
+ deploy: nitro.options.commands.deploy,
+ },
+ config: {
+ ...Object.fromEntries(
+ presetsWithConfig.map((key) => [
+ key,
+ (nitro.options as any)[key],
+ ]),
+ ),
+ },
}
- console.log(
- `\n\n✅ Client and server bundles successfully built.`,
+ await fsp.writeFile(
+ buildInfoPath,
+ JSON.stringify(buildInfo, null, 2),
)
+
+ await nitro.close()
+
+ // if (nitroConfig.prerender?.routes?.length && options.sitemap) {
+ // console.log('Building Sitemap...')
+ // // sitemap needs to be built after all directories are built
+ // await buildSitemap({
+ // host: options.sitemap.host,
+ // routes: nitroConfig.prerender.routes,
+ // outputDir: resolve(options.root, 'dist/public'),
+ // })
+ // }
+
+ // console.log(
+ // `\n\n✅ Client and server bundles successfully built.`,
+ // )
},
},
}
},
+ // async buildStart() {
+ // await Promise.all(
+ // [
+ // nitro.options.output.dir,
+ // nitro.options.output.serverDir,
+ // nitro.options.output.publicDir,
+ // ].map((dir) => {
+ // if (dir) {
+ // return promises.mkdir(dir, {
+ // recursive: true,
+ // })
+ // }
+ // return
+ // }),
+ // )
+ // },
},
]
}
diff --git a/packages/react-start-plugin/src/routesManifestPlugin.ts b/packages/react-start-plugin/src/routesManifestPlugin.ts
index be94ff2405..291dea7c79 100644
--- a/packages/react-start-plugin/src/routesManifestPlugin.ts
+++ b/packages/react-start-plugin/src/routesManifestPlugin.ts
@@ -1,14 +1,12 @@
import { readFileSync } from 'node:fs'
import path from 'node:path'
-import type { configSchema } from '@tanstack/router-generator'
import type { PluginOption, ResolvedConfig } from 'vite'
-import type { z } from 'zod'
import type { Manifest } from '@tanstack/react-router'
+import type { TanStackStartOutputConfig } from './schema'
-export function tsrManifestPlugin(opts: {
- tsrConfig: z.infer
- clientBase: string
-}): PluginOption {
+export function startManifestPlugin(
+ opts: TanStackStartOutputConfig,
+): PluginOption {
let config: ResolvedConfig
return {
@@ -39,8 +37,8 @@ export function tsrManifestPlugin(opts: {
}
const clientViteManifestPath = path.resolve(
- config.build.outDir,
- `../client/${opts.clientBase}/.vite/manifest.json`,
+ opts.root,
+ 'node_modules/.tanstack-start/client-dist/.vite/manifest.json',
)
type ViteManifest = Record<
@@ -62,7 +60,7 @@ export function tsrManifestPlugin(opts: {
)
}
- const routeTreePath = path.resolve(opts.tsrConfig.generatedRouteTree)
+ const routeTreePath = path.resolve(opts.tsr.generatedRouteTree)
let routeTreeContent: string
try {
@@ -88,7 +86,7 @@ export function tsrManifestPlugin(opts: {
let entryFile:
| {
file: string
- imports: Array
+ imports?: Array
}
| undefined
@@ -108,15 +106,15 @@ export function tsrManifestPlugin(opts: {
Object.entries(routes).forEach(([k, v]) => {
const file =
filesByRouteFilePath[
- path.join(opts.tsrConfig.routesDirectory, v.filePath as string)
+ path.join(opts.tsr.routesDirectory, v.filePath as string)
]
- if (file) {
+ if (file?.imports.length) {
const preloads = file.imports.map((d) =>
- path.join(opts.clientBase, manifest[d]!.file),
+ path.join(opts.routers.client.base, manifest[d]!.file),
)
- preloads.unshift(path.join(opts.clientBase, file.file))
+ preloads.unshift(path.join(opts.routers.client.base, file.file))
routes[k] = {
...v,
@@ -127,10 +125,10 @@ export function tsrManifestPlugin(opts: {
if (entryFile) {
routes.__root__!.preloads = [
- path.join(opts.clientBase, entryFile.file),
- ...entryFile.imports.map((d) =>
- path.join(opts.clientBase, manifest[d]!.file),
- ),
+ path.join(opts.routers.client.base, entryFile.file),
+ ...(entryFile.imports?.map((d) =>
+ path.join(opts.routers.client.base, manifest[d]!.file),
+ ) || []),
]
}
diff --git a/packages/router-plugin/src/core/router-generator-plugin.ts b/packages/router-plugin/src/core/router-generator-plugin.ts
index 38d6f7a5fb..a23e9627b0 100644
--- a/packages/router-plugin/src/core/router-generator-plugin.ts
+++ b/packages/router-plugin/src/core/router-generator-plugin.ts
@@ -81,13 +81,13 @@ export const unpluginRouterGeneratorFactory: UnpluginFactory<
})
},
vite: {
- async configResolved(config) {
+ configResolved(config) {
ROOT = config.root
userConfig = getConfig(options, ROOT)
- if (config.command === 'serve') {
- await run(generate)
- }
+ // if (config.command === 'serve') {
+ // await run(generate)
+ // }
},
async buildStart() {
if (this.environment.name === 'server') {
diff --git a/packages/server-functions-plugin/src/index.ts b/packages/server-functions-plugin/src/index.ts
index 6f52ddda45..83ae6c0ab9 100644
--- a/packages/server-functions-plugin/src/index.ts
+++ b/packages/server-functions-plugin/src/index.ts
@@ -40,7 +40,7 @@ export function createTanStackServerFnPlugin(opts: ServerFnPluginOpts): {
} {
const ROOT = process.cwd()
const manifestFilename =
- 'node_modules/.tanstack-start/server-functions-manifest.json'
+ 'node_modules/.tanstack-start/server/server-functions-manifest.json'
globalThis.TSR_directiveFnsById = {}
@@ -95,7 +95,9 @@ export function createTanStackServerFnPlugin(opts: ServerFnPluginOpts): {
// build.
// Ensure the manifest directory exists
- mkdirSync(path.dirname(manifestFilename), { recursive: true })
+ mkdirSync(path.join(ROOT, path.dirname(manifestFilename)), {
+ recursive: true,
+ })
// Write the manifest to disk
writeFileSync(
@@ -200,9 +202,21 @@ export function TanStackServerFnPluginEnv(opts: {
replacer: ReplacerFn
}
}): Array {
+ opts = {
+ ...opts,
+ client: {
+ ...opts.client,
+ envName: opts.client.envName || 'client',
+ },
+ server: {
+ ...opts.server,
+ envName: opts.server.envName || 'server',
+ },
+ }
+
const root = process.cwd()
const manifestFilename =
- 'node_modules/.tanstack-start/server-functions-manifest.json'
+ 'node_modules/.tanstack-start/server/server-functions-manifest.json'
globalThis.TSR_directiveFnsById = {}
@@ -261,7 +275,7 @@ export function TanStackServerFnPluginEnv(opts: {
applyToEnvironment(environment) {
return environment.name === opts.client.envName
},
- generateBundle() {
+ buildEnd() {
// In production, we create a manifest so we can
// access it later in the server build, which likely does not run in the
// same vite build environment. This is essentially a
@@ -269,7 +283,9 @@ export function TanStackServerFnPluginEnv(opts: {
// build.
// Ensure the manifest directory exists
- mkdirSync(path.dirname(manifestFilename), { recursive: true })
+ mkdirSync(path.join(root, path.dirname(manifestFilename)), {
+ recursive: true,
+ })
// Write the manifest to disk
writeFileSync(
diff --git a/packages/start-client-core/vite.config.ts b/packages/start-client-core/vite.config.ts
index ac2026fbb7..fb0b2664aa 100644
--- a/packages/start-client-core/vite.config.ts
+++ b/packages/start-client-core/vite.config.ts
@@ -16,5 +16,6 @@ export default mergeConfig(
tanstackViteConfig({
srcDir: './src',
entry: './src/index.tsx',
+ // externalDeps: ['node:fs', 'node:path', 'node:os', 'node:crypto'],
}),
)
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 932c4cbd7e..c70342310b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -345,7 +345,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -397,7 +397,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -959,7 +959,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -2496,7 +2496,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -2545,7 +2545,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -2994,7 +2994,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -3049,7 +3049,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -3466,7 +3466,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -4264,7 +4264,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -4475,7 +4475,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -4667,7 +4667,7 @@ importers:
version: 19.0.0(react@19.0.0)
vinxi:
specifier: 0.5.3
- version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0)
+ version: 0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0)
zod:
specifier: ^3.24.2
version: 3.24.2
@@ -4683,10 +4683,10 @@ importers:
version: 19.0.3(@types/react@19.0.8)
typescript:
specifier: ^5.7.2
- version: 5.7.3
+ version: 5.8.2
vite-tsconfig-paths:
specifier: ^5.1.4
- version: 5.1.4(typescript@5.7.3)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
+ version: 5.1.4(typescript@5.8.2)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
examples/react/start-supabase-basic:
dependencies:
@@ -4741,7 +4741,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -4912,7 +4912,7 @@ importers:
version: 5.66.0(react@19.0.0)
'@tanstack/react-query-devtools':
specifier: ^5.66.0
- version: 5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
+ version: 5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)
'@tanstack/react-router':
specifier: workspace:*
version: link:../../../packages/react-router
@@ -6202,7 +6202,7 @@ importers:
version: 2.11.6(@testing-library/jest-dom@6.6.3)(solid-js@1.9.5)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))
zod:
specifier: ^3.23.8
- version: 3.24.1
+ version: 3.24.2
packages/solid-router-devtools:
dependencies:
@@ -7758,10 +7758,6 @@ packages:
resolution: {integrity: sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@eslint/js@9.20.0':
- resolution: {integrity: sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==}
- engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
-
'@eslint/js@9.22.0':
resolution: {integrity: sha512-vLFajx9o8d1/oL2ZkpMYbkLv8nDB6yaIwFNt7nI4+I80U/z03SxmfOMsLbvWr3p7C+Wnoh//aOu2pQW8cS0HCQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@@ -9492,12 +9488,6 @@ packages:
'@tanstack/query-devtools@5.67.2':
resolution: {integrity: sha512-O4QXFFd7xqp6EX7sdvc9tsVO8nm4lpWBqwpgjpVLW5g7IeOY6VnS/xvs/YzbRhBVkKTMaJMOUGU7NhSX+YGoNg==}
- '@tanstack/react-query-devtools@5.66.0':
- resolution: {integrity: sha512-uB57wA2YZaQ2fPcFW0E9O1zAGDGSbRKRx84uMk/86VyU9jWVxvJ3Uzp+zNm+nZJYsuekCIo2opTdgNuvM3cKgA==}
- peerDependencies:
- '@tanstack/react-query': 5.66.0
- react: ^19.0.0
-
'@tanstack/react-query-devtools@5.67.2':
resolution: {integrity: sha512-cmj2DxBc+/9btQ66n5xI8wTtAma2BLVa403K7zIYiguzJ/kV201jnGensYqJeu1Rd8uRMLLRM74jLVMLDWNRJA==}
peerDependencies:
@@ -14836,9 +14826,6 @@ packages:
resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==}
engines: {node: '>= 14'}
- zod@3.24.1:
- resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==}
-
zod@3.24.2:
resolution: {integrity: sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==}
@@ -15862,8 +15849,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@eslint/js@9.20.0': {}
-
'@eslint/js@9.22.0': {}
'@eslint/object-schema@2.1.6': {}
@@ -17709,7 +17694,7 @@ snapshots:
'@tanstack/config@0.16.1(@types/node@22.13.4)(esbuild@0.25.0)(eslint@9.22.0(jiti@2.4.2))(rollup@4.34.0)(typescript@5.8.2)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0))':
dependencies:
'@commitlint/parse': 19.5.0
- '@eslint/js': 9.20.0
+ '@eslint/js': 9.22.0
'@stylistic/eslint-plugin-js': 2.13.0(eslint@9.22.0(jiti@2.4.2))
commander: 13.1.0
esbuild-register: 3.6.0(esbuild@0.25.0)
@@ -17747,12 +17732,6 @@ snapshots:
'@tanstack/query-devtools@5.67.2': {}
- '@tanstack/react-query-devtools@5.66.0(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)':
- dependencies:
- '@tanstack/query-devtools': 5.65.0
- '@tanstack/react-query': 5.66.0(react@19.0.0)
- react: 19.0.0
-
'@tanstack/react-query-devtools@5.67.2(@tanstack/react-query@5.66.0(react@19.0.0))(react@19.0.0)':
dependencies:
'@tanstack/query-devtools': 5.67.2
@@ -21257,104 +21236,6 @@ snapshots:
neo-async@2.6.2: {}
- nitropack@2.10.4(typescript@5.7.3):
- dependencies:
- '@cloudflare/kv-asset-handler': 0.3.4
- '@netlify/functions': 2.8.2
- '@rollup/plugin-alias': 5.1.1(rollup@4.34.0)
- '@rollup/plugin-commonjs': 28.0.2(rollup@4.34.0)
- '@rollup/plugin-inject': 5.0.5(rollup@4.34.0)
- '@rollup/plugin-json': 6.1.0(rollup@4.34.0)
- '@rollup/plugin-node-resolve': 15.3.1(rollup@4.34.0)
- '@rollup/plugin-replace': 6.0.2(rollup@4.34.0)
- '@rollup/plugin-terser': 0.4.4(rollup@4.34.0)
- '@rollup/pluginutils': 5.1.4(rollup@4.34.0)
- '@types/http-proxy': 1.17.15
- '@vercel/nft': 0.27.10(rollup@4.34.0)
- archiver: 7.0.1
- c12: 2.0.1(magicast@0.3.5)
- chokidar: 3.6.0
- citty: 0.1.6
- compatx: 0.1.8
- confbox: 0.1.8
- consola: 3.4.0
- cookie-es: 1.2.2
- croner: 9.0.0
- crossws: 0.3.3
- db0: 0.2.3
- defu: 6.1.4
- destr: 2.0.3
- dot-prop: 9.0.0
- esbuild: 0.24.2
- escape-string-regexp: 5.0.0
- etag: 1.8.1
- fs-extra: 11.3.0
- globby: 14.0.2
- gzip-size: 7.0.0
- h3: 1.13.0
- hookable: 5.5.3
- httpxy: 0.1.7
- ioredis: 5.4.2
- jiti: 2.4.2
- klona: 2.0.6
- knitwork: 1.2.0
- listhen: 1.9.0
- magic-string: 0.30.17
- magicast: 0.3.5
- mime: 4.0.6
- mlly: 1.7.4
- node-fetch-native: 1.6.6
- ofetch: 1.4.1
- ohash: 1.1.4
- openapi-typescript: 7.6.0(typescript@5.7.3)
- pathe: 1.1.2
- perfect-debounce: 1.0.0
- pkg-types: 1.3.1
- pretty-bytes: 6.1.1
- radix3: 1.1.2
- rollup: 4.34.0
- rollup-plugin-visualizer: 5.14.0(rollup@4.34.0)
- scule: 1.3.0
- semver: 7.7.0
- serve-placeholder: 2.0.2
- serve-static: 1.16.2
- std-env: 3.8.0
- ufo: 1.5.4
- uncrypto: 0.1.3
- unctx: 2.4.1
- unenv: 1.10.0
- unimport: 3.14.6(rollup@4.34.0)
- unstorage: 1.14.4(db0@0.2.3)(ioredis@5.4.2)
- untyped: 1.5.2
- unwasm: 0.3.9
- transitivePeerDependencies:
- - '@azure/app-configuration'
- - '@azure/cosmos'
- - '@azure/data-tables'
- - '@azure/identity'
- - '@azure/keyvault-secrets'
- - '@azure/storage-blob'
- - '@capacitor/preferences'
- - '@deno/kv'
- - '@electric-sql/pglite'
- - '@libsql/client'
- - '@netlify/blobs'
- - '@planetscale/database'
- - '@upstash/redis'
- - '@vercel/blob'
- - '@vercel/kv'
- - aws4fetch
- - better-sqlite3
- - drizzle-orm
- - encoding
- - idb-keyval
- - mysql2
- - rolldown
- - sqlite3
- - supports-color
- - typescript
- - uploadthing
-
nitropack@2.10.4(typescript@5.8.2):
dependencies:
'@cloudflare/kv-asset-handler': 0.3.4
@@ -21629,16 +21510,6 @@ snapshots:
is-docker: 2.2.1
is-wsl: 2.2.0
- openapi-typescript@7.6.0(typescript@5.7.3):
- dependencies:
- '@redocly/openapi-core': 1.28.0(supports-color@9.4.0)
- ansi-colors: 4.1.3
- change-case: 5.4.4
- parse-json: 8.1.0
- supports-color: 9.4.0
- typescript: 5.7.3
- yargs-parser: 21.1.1
-
openapi-typescript@7.6.0(typescript@5.8.2):
dependencies:
'@redocly/openapi-core': 1.28.0(supports-color@9.4.0)
@@ -22970,10 +22841,6 @@ snapshots:
ts-pattern@5.6.2: {}
- tsconfck@3.1.4(typescript@5.7.3):
- optionalDependencies:
- typescript: 5.7.3
-
tsconfck@3.1.4(typescript@5.8.2):
optionalDependencies:
typescript: 5.8.2
@@ -23276,85 +23143,6 @@ snapshots:
vary@1.1.2: {}
- vinxi@0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0):
- dependencies:
- '@babel/core': 7.26.8
- '@babel/plugin-syntax-jsx': 7.25.9(@babel/core@7.26.8)
- '@babel/plugin-syntax-typescript': 7.25.9(@babel/core@7.26.8)
- '@types/micromatch': 4.0.9
- '@vinxi/listhen': 1.5.6
- boxen: 7.1.1
- chokidar: 3.6.0
- citty: 0.1.6
- consola: 3.4.0
- crossws: 0.3.3
- dax-sh: 0.39.2
- defu: 6.1.4
- es-module-lexer: 1.6.0
- esbuild: 0.20.2
- fast-glob: 3.3.3
- get-port-please: 3.1.2
- h3: 1.13.0
- hookable: 5.5.3
- http-proxy: 1.18.1
- micromatch: 4.0.8
- nitropack: 2.10.4(typescript@5.7.3)
- node-fetch-native: 1.6.6
- path-to-regexp: 6.3.0
- pathe: 1.1.2
- radix3: 1.1.2
- resolve: 1.22.10
- serve-placeholder: 2.0.2
- serve-static: 1.16.2
- ufo: 1.5.4
- unctx: 2.4.1
- unenv: 1.10.0
- unstorage: 1.14.4(db0@0.2.3)(ioredis@5.4.2)
- vite: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
- zod: 3.24.2
- transitivePeerDependencies:
- - '@azure/app-configuration'
- - '@azure/cosmos'
- - '@azure/data-tables'
- - '@azure/identity'
- - '@azure/keyvault-secrets'
- - '@azure/storage-blob'
- - '@capacitor/preferences'
- - '@deno/kv'
- - '@electric-sql/pglite'
- - '@libsql/client'
- - '@netlify/blobs'
- - '@planetscale/database'
- - '@types/node'
- - '@upstash/redis'
- - '@vercel/blob'
- - '@vercel/kv'
- - aws4fetch
- - better-sqlite3
- - db0
- - debug
- - drizzle-orm
- - encoding
- - idb-keyval
- - ioredis
- - jiti
- - less
- - lightningcss
- - mysql2
- - rolldown
- - sass
- - sass-embedded
- - sqlite3
- - stylus
- - sugarss
- - supports-color
- - terser
- - tsx
- - typescript
- - uploadthing
- - xml2js
- - yaml
-
vinxi@0.5.3(@types/node@22.13.4)(db0@0.2.3)(ioredis@5.4.2)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(typescript@5.8.2)(yaml@2.7.0):
dependencies:
'@babel/core': 7.26.8
@@ -23513,17 +23301,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- vite-tsconfig-paths@5.1.4(typescript@5.7.3)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)):
- dependencies:
- debug: 4.4.0(supports-color@9.4.0)
- globrex: 0.1.2
- tsconfck: 3.1.4(typescript@5.7.3)
- optionalDependencies:
- vite: 6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)
- transitivePeerDependencies:
- - supports-color
- - typescript
-
vite-tsconfig-paths@5.1.4(typescript@5.8.2)(vite@6.1.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.29.1)(terser@5.37.0)(tsx@4.19.2)(yaml@2.7.0)):
dependencies:
debug: 4.4.0(supports-color@9.4.0)
@@ -23923,6 +23700,4 @@ snapshots:
compress-commons: 6.0.2
readable-stream: 4.7.0
- zod@3.24.1: {}
-
zod@3.24.2: {}
From c1d9288577f2e0c36223cee1f6778980d3e35834 Mon Sep 17 00:00:00 2001
From: Manuel Schiller
Date: Wed, 12 Mar 2025 01:58:19 +0100
Subject: [PATCH 043/155] fix commonjsOptions
---
packages/react-start-plugin/src/index.ts | 8 +-------
packages/react-start-plugin/src/nitro/nitro-plugin.ts | 10 +++++-----
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/packages/react-start-plugin/src/index.ts b/packages/react-start-plugin/src/index.ts
index eb29cad8cc..f344f916f9 100644
--- a/packages/react-start-plugin/src/index.ts
+++ b/packages/react-start-plugin/src/index.ts
@@ -73,18 +73,12 @@ export function TanStackStartVitePlugin(
'@tanstack/server-functions-plugin',
'tsr:start-manifest',
'tsr:server-fn-manifest',
- 'use-sync-external-store',
- 'use-sync-external-store/shim/with-selector',
],
},
optimizeDeps: {
entries: [],
...(options.vite?.optimizeDeps || {}),
- include: [
- 'use-sync-external-store',
- 'use-sync-external-store/shim/with-selector',
- ...(options.vite?.optimizeDeps?.include || []),
- ],
+ include: [...(options.vite?.optimizeDeps?.include || [])],
},
/* prettier-ignore */
define: {
diff --git a/packages/react-start-plugin/src/nitro/nitro-plugin.ts b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
index f3d0b3e847..10c1fbc734 100644
--- a/packages/react-start-plugin/src/nitro/nitro-plugin.ts
+++ b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
@@ -8,7 +8,7 @@ import { normalizePath } from 'vite'
import { getRollupConfig } from 'nitropack/rollup'
import { clientDistDir } from '../index.js'
import { devServerPlugin } from './dev-server-plugin.js'
-import type { PluginOption } from 'vite'
+import type { EnvironmentOptions, PluginOption } from 'vite'
import type { Nitro, NitroConfig } from 'nitropack'
import type { TanStackStartOutputConfig } from '../schema.js'
@@ -54,9 +54,6 @@ export function nitroPlugin(
devServerPlugin(options),
{
name: 'tanstack-vite-plugin-nitro',
- configResolved() {
- // console.log(config.environments)
- },
async configEnvironment(name) {
nitro = await createNitro({
dev: false,
@@ -68,6 +65,9 @@ export function nitroPlugin(
if (name === 'server') {
return {
build: {
+ commonjsOptions: {
+ include: [],
+ },
ssr: true,
sourcemap: true,
rollupOptions: {
@@ -78,7 +78,7 @@ export function nitroPlugin(
},
},
},
- }
+ } satisfies EnvironmentOptions
}
return null
From 552e94168c13382735db2e806d900f30d3d2abfb Mon Sep 17 00:00:00 2001
From: Tanner Linsley
Date: Wed, 12 Mar 2025 00:40:44 -0600
Subject: [PATCH 044/155] checkpoint
---
packages/react-start-plugin/src/index.ts | 2 +-
.../src/nitro/nitro-plugin.ts | 2 +-
.../src/routesManifestPlugin.ts | 39 +++++++-----
.../start-server-core/src/router-manifest.ts | 63 ++++++++++---------
4 files changed, 59 insertions(+), 47 deletions(-)
diff --git a/packages/react-start-plugin/src/index.ts b/packages/react-start-plugin/src/index.ts
index f344f916f9..1a8c2837d6 100644
--- a/packages/react-start-plugin/src/index.ts
+++ b/packages/react-start-plugin/src/index.ts
@@ -47,7 +47,7 @@ export function TanStackStartVitePlugin(
main: options.clientEntryPath,
},
output: {
- dir: clientDistDir,
+ dir: path.resolve(options.root, clientDistDir),
},
external: ['node:fs', 'node:path', 'node:os', 'node:crypto'],
},
diff --git a/packages/react-start-plugin/src/nitro/nitro-plugin.ts b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
index 10c1fbc734..d179dc95ee 100644
--- a/packages/react-start-plugin/src/nitro/nitro-plugin.ts
+++ b/packages/react-start-plugin/src/nitro/nitro-plugin.ts
@@ -37,7 +37,7 @@ export function nitroPlugin(
preset: buildPreset,
publicAssets: [
{
- dir: clientDistDir,
+ dir: path.resolve(options.root, clientDistDir),
},
],
typescript: {
diff --git a/packages/react-start-plugin/src/routesManifestPlugin.ts b/packages/react-start-plugin/src/routesManifestPlugin.ts
index 291dea7c79..9e706eef28 100644
--- a/packages/react-start-plugin/src/routesManifestPlugin.ts
+++ b/packages/react-start-plugin/src/routesManifestPlugin.ts
@@ -46,7 +46,7 @@ export function startManifestPlugin(
{
file: string
isEntry: boolean
- imports: Array
+ imports?: Array
}
>
@@ -102,19 +102,26 @@ export function startManifestPlugin(
}, {}),
)
+ const routesDirectoryFromRoot = path.relative(
+ opts.root,
+ opts.tsr.routesDirectory,
+ )
+
// Add preloads to the routes from the vite manifest
Object.entries(routes).forEach(([k, v]) => {
const file =
filesByRouteFilePath[
- path.join(opts.tsr.routesDirectory, v.filePath as string)
+ path.join(routesDirectoryFromRoot, v.filePath as string)
]
- if (file?.imports.length) {
- const preloads = file.imports.map((d) =>
- path.join(opts.routers.client.base, manifest[d]!.file),
+ if (file) {
+ const preloads = (file.imports ?? []).map((d) =>
+ path.join('/', manifest[d]!.file),
)
- preloads.unshift(path.join(opts.routers.client.base, file.file))
+ if (file.file) {
+ preloads.unshift(path.join('/', file.file))
+ }
routes[k] = {
...v,
@@ -125,11 +132,21 @@ export function startManifestPlugin(
if (entryFile) {
routes.__root__!.preloads = [
- path.join(opts.routers.client.base, entryFile.file),
+ path.join('/', entryFile.file),
...(entryFile.imports?.map((d) =>
- path.join(opts.routers.client.base, manifest[d]!.file),
+ path.join('/', manifest[d]!.file),
) || []),
]
+ routes.__root__!.assets = [
+ ...(routes.__root__!.assets || []),
+ {
+ tag: 'script',
+ attrs: {
+ src: path.join('/', entryFile.file),
+ type: 'module',
+ },
+ },
+ ]
}
const recurseRoute = (
@@ -162,12 +179,6 @@ export function startManifestPlugin(
routes,
}
- if (process.env.TSR_VITE_DEBUG) {
- console.info(
- 'Routes Manifest: \n' + JSON.stringify(routesManifest, null, 2),
- )
- }
-
return `export default () => (${JSON.stringify(routesManifest)})`
}
return
diff --git a/packages/start-server-core/src/router-manifest.ts b/packages/start-server-core/src/router-manifest.ts
index 44e851527d..546342724f 100644
--- a/packages/start-server-core/src/router-manifest.ts
+++ b/packages/start-server-core/src/router-manifest.ts
@@ -21,23 +21,6 @@ export function getStartManifest() {
rootRoute.assets = rootRoute.assets || []
- let script = ''
- // Always fake that HMR is ready
- if (process.env.NODE_ENV === 'development') {
- const CLIENT_BASE = sanitizeBase(process.env.TSS_CLIENT_BASE || '')
-
- if (!CLIENT_BASE) {
- throw new Error(
- 'tanstack/start-router-manifest: TSS_CLIENT_BASE must be defined in your environment for getFullRouterManifest()',
- )
- }
- script = `import RefreshRuntime from "${path.join('/', '@react-refresh')}";
- RefreshRuntime.injectIntoGlobalHook(window)
- window.$RefreshReg$ = () => {}
- window.$RefreshSig$ = () => (type) => type
- window.__vite_plugin_react_preamble_installed__ = true;`
- }
-
// Get the entry for the client from vinxi
// const vinxiClientManifest = getManifest('client')
@@ -47,26 +30,41 @@ export function getStartManifest() {
// invariant(importPath, 'Could not find client entry in vinxi manifest')
// }
- if (!process.env.TSS_CLIENT_ENTRY) {
+ if (process.env.NODE_ENV === 'development' && !process.env.TSS_CLIENT_ENTRY) {
throw new Error(
'tanstack/start-router-manifest: TSS_CLIENT_ENTRY must be defined in your environment for getStartManifest()',
)
}
- rootRoute.assets.push({
- tag: 'script',
- attrs: {
- type: 'module',
- suppressHydrationWarning: true,
- async: true,
- },
- children: `${script};\nimport(${JSON.stringify(
- process.env.TSS_CLIENT_ENTRY,
- )})`,
- })
+ if (process.env.NODE_ENV === 'development') {
+ // Always fake that HMR is ready
+ // const CLIENT_BASE = sanitizeBase(process.env.TSS_CLIENT_BASE || '')
- // Strip out anything that isn't needed for the client
- return {
+ // if (!CLIENT_BASE) {
+ // throw new Error(
+ // 'tanstack/start-router-manifest: TSS_CLIENT_BASE must be defined in your environment for getFullRouterManifest()',
+ // )
+ // }
+
+ const script = `import RefreshRuntime from "${path.join('/', '@react-refresh')}";
+ RefreshRuntime.injectIntoGlobalHook(window)
+ window.$RefreshReg$ = () => {}
+ window.$RefreshSig$ = () => (type) => type
+ window.__vite_plugin_react_preamble_installed__ = true;
+ import(${JSON.stringify(process.env.TSS_CLIENT_ENTRY)})`
+
+ rootRoute.assets.push({
+ tag: 'script',
+ attrs: {
+ type: 'module',
+ suppressHydrationWarning: true,
+ async: true,
+ },
+ children: script,
+ })
+ }
+
+ const manifest = {
...startManifest,
routes: Object.fromEntries(
Object.entries(startManifest.routes).map(([k, v]: any) => {
@@ -81,4 +79,7 @@ export function getStartManifest() {
}),
),
}
+
+ // Strip out anything that isn't needed for the client
+ return manifest
}
From e06b787b9ca18e4d57a1ec4217a98e9f17d5c78a Mon Sep 17 00:00:00 2001
From: Birk Skyum
Date: Wed, 12 Mar 2025 15:19:35 +0100
Subject: [PATCH 045/155] add solid-start-plugin and start-basic example
---
examples/solid/start-basic/.gitignore | 18 +
examples/solid/start-basic/.prettierignore | 4 +
.../solid/start-basic/.vscode/settings.json | 11 +
examples/solid/start-basic/README.md | 72 +++
examples/solid/start-basic/package.json | 28 +
examples/solid/start-basic/postcss.config.mjs | 6 +
.../public/android-chrome-192x192.png | Bin 0 -> 29964 bytes
.../public/android-chrome-512x512.png | Bin 0 -> 109271 bytes
.../start-basic/public/apple-touch-icon.png | Bin 0 -> 27246 bytes
.../start-basic/public/favicon-16x16.png | Bin 0 -> 832 bytes
.../start-basic/public/favicon-32x32.png | Bin 0 -> 2115 bytes
examples/solid/start-basic/public/favicon.ico | Bin 0 -> 15406 bytes
examples/solid/start-basic/public/favicon.png | Bin 0 -> 1507 bytes
.../solid/start-basic/public/site.webmanifest | 19 +
.../src/components/DefaultCatchBoundary.tsx | 53 ++
.../start-basic/src/components/NotFound.tsx | 25 +
.../start-basic/src/components/PostError.tsx | 5 +
.../start-basic/src/components/UserError.tsx | 5 +
.../solid/start-basic/src/routeTree.gen.ts | 479 ++++++++++++++++++
examples/solid/start-basic/src/router.tsx | 22 +
.../solid/start-basic/src/routes/__root.tsx | 139 +++++
.../src/routes/_pathlessLayout.tsx | 16 +
.../routes/_pathlessLayout/_nested-layout.tsx | 34 ++
.../_nested-layout/route-a.tsx | 11 +
.../_nested-layout/route-b.tsx | 11 +
.../start-basic/src/routes/api/users.$id.ts | 24 +
.../solid/start-basic/src/routes/api/users.ts | 17 +
.../solid/start-basic/src/routes/deferred.tsx | 62 +++
.../solid/start-basic/src/routes/index.tsx | 13 +
.../start-basic/src/routes/posts.$postId.tsx | 34 ++
.../start-basic/src/routes/posts.index.tsx | 9 +
.../solid/start-basic/src/routes/posts.tsx | 38 ++
.../src/routes/posts_.$postId.deep.tsx | 29 ++
.../solid/start-basic/src/routes/redirect.tsx | 9 +
.../start-basic/src/routes/users.$userId.tsx | 33 ++
.../start-basic/src/routes/users.index.tsx | 9 +
.../solid/start-basic/src/routes/users.tsx | 48 ++
examples/solid/start-basic/src/styles/app.css | 22 +
.../src/utils/loggingMiddleware.tsx | 41 ++
.../solid/start-basic/src/utils/posts.tsx | 36 ++
examples/solid/start-basic/src/utils/seo.ts | 33 ++
.../solid/start-basic/src/utils/users.tsx | 7 +
.../solid/start-basic/tailwind.config.mjs | 4 +
examples/solid/start-basic/tsconfig.json | 23 +
examples/solid/start-basic/vite.config.ts | 19 +
packages/solid-start-plugin/README.md | 2 +-
packages/solid-start-plugin/package.json | 27 +-
packages/solid-start-plugin/src/index.ts | 287 +++++++----
.../src/nitro/build-server.ts | 39 ++
.../src/nitro/build-sitemap.ts | 79 +++
.../src/nitro/dev-server-plugin.ts | 152 ++++++
.../src/nitro/nitro-plugin.ts | 191 +++++++
.../solid-start-plugin/src/nitro/options.ts | 80 +++
.../src/routesManifestPlugin.ts | 187 +++++++
packages/solid-start-plugin/src/schema.ts | 150 ++++++
.../src/start-compiler-plugin.ts | 150 ++++++
packages/solid-start-plugin/tsconfig.json | 5 +-
packages/solid-start-plugin/vite.config.ts | 1 +
pnpm-lock.yaml | 95 +++-
59 files changed, 2782 insertions(+), 131 deletions(-)
create mode 100644 examples/solid/start-basic/.gitignore
create mode 100644 examples/solid/start-basic/.prettierignore
create mode 100644 examples/solid/start-basic/.vscode/settings.json
create mode 100644 examples/solid/start-basic/README.md
create mode 100644 examples/solid/start-basic/package.json
create mode 100644 examples/solid/start-basic/postcss.config.mjs
create mode 100644 examples/solid/start-basic/public/android-chrome-192x192.png
create mode 100644 examples/solid/start-basic/public/android-chrome-512x512.png
create mode 100644 examples/solid/start-basic/public/apple-touch-icon.png
create mode 100644 examples/solid/start-basic/public/favicon-16x16.png
create mode 100644 examples/solid/start-basic/public/favicon-32x32.png
create mode 100644 examples/solid/start-basic/public/favicon.ico
create mode 100644 examples/solid/start-basic/public/favicon.png
create mode 100644 examples/solid/start-basic/public/site.webmanifest
create mode 100644 examples/solid/start-basic/src/components/DefaultCatchBoundary.tsx
create mode 100644 examples/solid/start-basic/src/components/NotFound.tsx
create mode 100644 examples/solid/start-basic/src/components/PostError.tsx
create mode 100644 examples/solid/start-basic/src/components/UserError.tsx
create mode 100644 examples/solid/start-basic/src/routeTree.gen.ts
create mode 100644 examples/solid/start-basic/src/router.tsx
create mode 100644 examples/solid/start-basic/src/routes/__root.tsx
create mode 100644 examples/solid/start-basic/src/routes/_pathlessLayout.tsx
create mode 100644 examples/solid/start-basic/src/routes/_pathlessLayout/_nested-layout.tsx
create mode 100644 examples/solid/start-basic/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
create mode 100644 examples/solid/start-basic/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
create mode 100644 examples/solid/start-basic/src/routes/api/users.$id.ts
create mode 100644 examples/solid/start-basic/src/routes/api/users.ts
create mode 100644 examples/solid/start-basic/src/routes/deferred.tsx
create mode 100644 examples/solid/start-basic/src/routes/index.tsx
create mode 100644 examples/solid/start-basic/src/routes/posts.$postId.tsx
create mode 100644 examples/solid/start-basic/src/routes/posts.index.tsx
create mode 100644 examples/solid/start-basic/src/routes/posts.tsx
create mode 100644 examples/solid/start-basic/src/routes/posts_.$postId.deep.tsx
create mode 100644 examples/solid/start-basic/src/routes/redirect.tsx
create mode 100644 examples/solid/start-basic/src/routes/users.$userId.tsx
create mode 100644 examples/solid/start-basic/src/routes/users.index.tsx
create mode 100644 examples/solid/start-basic/src/routes/users.tsx
create mode 100644 examples/solid/start-basic/src/styles/app.css
create mode 100644 examples/solid/start-basic/src/utils/loggingMiddleware.tsx
create mode 100644 examples/solid/start-basic/src/utils/posts.tsx
create mode 100644 examples/solid/start-basic/src/utils/seo.ts
create mode 100644 examples/solid/start-basic/src/utils/users.tsx
create mode 100644 examples/solid/start-basic/tailwind.config.mjs
create mode 100644 examples/solid/start-basic/tsconfig.json
create mode 100644 examples/solid/start-basic/vite.config.ts
create mode 100644 packages/solid-start-plugin/src/nitro/build-server.ts
create mode 100644 packages/solid-start-plugin/src/nitro/build-sitemap.ts
create mode 100644 packages/solid-start-plugin/src/nitro/dev-server-plugin.ts
create mode 100644 packages/solid-start-plugin/src/nitro/nitro-plugin.ts
create mode 100644 packages/solid-start-plugin/src/nitro/options.ts
create mode 100644 packages/solid-start-plugin/src/routesManifestPlugin.ts
create mode 100644 packages/solid-start-plugin/src/schema.ts
create mode 100644 packages/solid-start-plugin/src/start-compiler-plugin.ts
diff --git a/examples/solid/start-basic/.gitignore b/examples/solid/start-basic/.gitignore
new file mode 100644
index 0000000000..ca63f49885
--- /dev/null
+++ b/examples/solid/start-basic/.gitignore
@@ -0,0 +1,18 @@
+node_modules
+package-lock.json
+yarn.lock
+
+.DS_Store
+.cache
+.env
+.vercel
+.output
+/build/
+/api/
+/server/build
+/public/build# Sentry Config File
+.env.sentry-build-plugin
+/test-results/
+/playwright-report/
+/blob-report/
+/playwright/.cache/
diff --git a/examples/solid/start-basic/.prettierignore b/examples/solid/start-basic/.prettierignore
new file mode 100644
index 0000000000..2be5eaa6ec
--- /dev/null
+++ b/examples/solid/start-basic/.prettierignore
@@ -0,0 +1,4 @@
+**/build
+**/public
+pnpm-lock.yaml
+routeTree.gen.ts
\ No newline at end of file
diff --git a/examples/solid/start-basic/.vscode/settings.json b/examples/solid/start-basic/.vscode/settings.json
new file mode 100644
index 0000000000..00b5278e58
--- /dev/null
+++ b/examples/solid/start-basic/.vscode/settings.json
@@ -0,0 +1,11 @@
+{
+ "files.watcherExclude": {
+ "**/routeTree.gen.ts": true
+ },
+ "search.exclude": {
+ "**/routeTree.gen.ts": true
+ },
+ "files.readonlyInclude": {
+ "**/routeTree.gen.ts": true
+ }
+}
diff --git a/examples/solid/start-basic/README.md b/examples/solid/start-basic/README.md
new file mode 100644
index 0000000000..90cba4aac1
--- /dev/null
+++ b/examples/solid/start-basic/README.md
@@ -0,0 +1,72 @@
+# Welcome to TanStack.com!
+
+This site is built with TanStack Router!
+
+- [TanStack Router Docs](https://tanstack.com/router)
+
+It's deployed automagically with Netlify!
+
+- [Netlify](https://netlify.com/)
+
+## Development
+
+From your terminal:
+
+```sh
+pnpm install
+pnpm dev
+```
+
+This starts your app in development mode, rebuilding assets on file changes.
+
+## Editing and previewing the docs of TanStack projects locally
+
+The documentations for all TanStack projects except for `React Charts` are hosted on [https://tanstack.com](https://tanstack.com), powered by this TanStack Router app.
+In production, the markdown doc pages are fetched from the GitHub repos of the projects, but in development they are read from the local file system.
+
+Follow these steps if you want to edit the doc pages of a project (in these steps we'll assume it's [`TanStack/form`](https://github.com/tanstack/form)) and preview them locally :
+
+1. Create a new directory called `tanstack`.
+
+```sh
+mkdir tanstack
+```
+
+2. Enter the directory and clone this repo and the repo of the project there.
+
+```sh
+cd tanstack
+git clone git@github.com:TanStack/tanstack.com.git
+git clone git@github.com:TanStack/form.git
+```
+
+> [!NOTE]
+> Your `tanstack` directory should look like this:
+>
+> ```
+> tanstack/
+> |
+> +-- form/
+> |
+> +-- tanstack.com/
+> ```
+
+> [!WARNING]
+> Make sure the name of the directory in your local file system matches the name of the project's repo. For example, `tanstack/form` must be cloned into `form` (this is the default) instead of `some-other-name`, because that way, the doc pages won't be found.
+
+3. Enter the `tanstack/tanstack.com` directory, install the dependencies and run the app in dev mode:
+
+```sh
+cd tanstack.com
+pnpm i
+# The app will run on https://localhost:3000 by default
+pnpm dev
+```
+
+4. Now you can visit http://localhost:3000/form/latest/docs/overview in the browser and see the changes you make in `tanstack/form/docs`.
+
+> [!NOTE]
+> The updated pages need to be manually reloaded in the browser.
+
+> [!WARNING]
+> You will need to update the `docs/config.json` file (in the project's repo) if you add a new doc page!
diff --git a/examples/solid/start-basic/package.json b/examples/solid/start-basic/package.json
new file mode 100644
index 0000000000..4695a931f6
--- /dev/null
+++ b/examples/solid/start-basic/package.json
@@ -0,0 +1,28 @@
+{
+ "name": "tanstack-start-example-basic",
+ "private": true,
+ "sideEffects": false,
+ "type": "module",
+ "scripts": {
+ "dev": "vite dev",
+ "build": "vite build",
+ "start": "vite start"
+ },
+ "dependencies": {
+ "@tanstack/solid-router": "^1.114.17",
+ "@tanstack/solid-router-devtools": "^1.114.17",
+ "@tanstack/solid-start": "workspace:*",
+ "solid-js": "^1.9.5",
+ "redaxios": "^0.5.1",
+ "tailwind-merge": "^2.6.0",
+ "vite": "6.1.0"
+ },
+ "devDependencies": {
+ "@types/node": "^22.5.4",
+ "autoprefixer": "^10.4.20",
+ "postcss": "^8.5.1",
+ "tailwindcss": "^3.4.17",
+ "typescript": "^5.7.2",
+ "vite-tsconfig-paths": "^5.1.4"
+ }
+}
diff --git a/examples/solid/start-basic/postcss.config.mjs b/examples/solid/start-basic/postcss.config.mjs
new file mode 100644
index 0000000000..2e7af2b7f1
--- /dev/null
+++ b/examples/solid/start-basic/postcss.config.mjs
@@ -0,0 +1,6 @@
+export default {
+ plugins: {
+ tailwindcss: {},
+ autoprefixer: {},
+ },
+}
diff --git a/examples/solid/start-basic/public/android-chrome-192x192.png b/examples/solid/start-basic/public/android-chrome-192x192.png
new file mode 100644
index 0000000000000000000000000000000000000000..09c8324f8c6781bc90fcf5dd38e0702bd5f171f3
GIT binary patch
literal 29964
zcmV(|K+(U6P)PyA07*naRCr$OT?d?1#nu1MePw&!Wnn2xuPUHa5fOWhim}9AqQ;m6yGg#7n3xz#
z1e2(VEr~UX#u6J?uz-jP0@C{~yUX_8U%B&n=9V}2zI)$$yDXOI&Cl@mmYFkWPMs^5clrlPYm*cvVvo6&eHV`@U}e)m!o2H1BvNgM-Ltm3}(T#N?~
z<%27SG9X#y{9phn00wi8VT^%shbCo2%g^2JQxi^;qXJw3b^|B_c&EaY&p6Nprmg_<
z*0nWY(?e5OF!51+yWjkd0piU6HM@DXFVKA!_psx^*;p`^3GgHimdC)EMy5p41}g33
zZ9J3zHOSj|*J#54#;r~Hy-0r?j5F|hfOUiO7BIerhxy{LKWWju!&uX|o5W*}{yPSc
z@N>gDp5{sK%JVW$|1kK;;JAD>*#vEH%si(L)a>0j={tzDP<3@8P|;~ubA
zLp)p+ZcDEJ(?r((9aCr+_|`K3+3~^Mol_XtL=Md2U^Bt_XbX0n1iUQpoqpRX%t_eW
zm4;ow%ikF7xiL>dFtTk7{38Z@$idh7hNZ0fw)+p?Y6kdqNyqh2`Eg+E01jj`Vas!H
z4lu^RIR_&dA+W?jf6+tnOx)6bnOJ39jqt5vfLqI&a~0J)OjXtM8QA3<
zNc&n&yxk?(&p%5emN|2%hw3J{Q}DWGy~jOUO$M3lkby#`jrNA!}(f>IHSWs4$(v75n9`5@QfQta+JH_SW
z;ok1ox-me!cI4-=+T2$djfjR@KsHf09sKz^0FQZD@b5r(#dU)RcP84_H{reiDF*n{
zp1P?D!}*-CbHLHhBF2qB?Bd;xLY?l*YC(?v%VEnzSGi=0wQHPMK7c)P@1a1#KyVq7pok)E1mpdkS)cTV=9Z3Wf)fgO}MTbbr$r;Ty*QkJi?XQA45I
zRF2~qcxKNL?j}xqYbx~|0_}@L#CmVrwtknlcN3<+aT^Bid_N`w5Ho~QQn2En-(%~b
zA4I`e*u4tJ)Ln*@aFoDr0mBj~xP?uHg**CY1pBX*Zwv!GSzn(S3U!~Ns{Ah;$c>2-
zH@i6E8ybtdQOO{#pT=ratQSj
zH-ULLTC#?tr07J1J!C6IE}zI)S2iXIdB
zXc6cBV0GyQoUva57*4q{6im^Uf~-l%#$9bGM=~;W=`1fuS!4Q<#jogCzlNTuHs!d8
ztv@~2CJM%gpR7S{^DRX`#uA*-pVe=PEVdcA(@^1z6S+UFFKu)>`gA-ROMel38Ncj{
zgvsH0%&xu~g;+?N81N^&oPmzb?k}y|)ujimy
z@M8k5<)^tm69j3)toSz0ca}D75lmNy*Vbl2FzT>b+BEvpxkP@JXq&NMwBy9UhbyiC
zWCgb2gtFr_v14$r(TUXzvTluF_!T(*$qvKbuY$ni_4&19fCpEt@)eB8J2V{PcXE#D
z@dohCf8HDW=*u5AKW7>!rZ30CD$M7)}+zdZfuqpUj?NH)bwcUTcx$F^^zKFQkjh0w5-y8eq?XVFa|r
z`e=zFW5LN}mesF3B1evhEwN%*!j8?jDGn~$g12ZFw4CFGtwbw
zM+E)W|LaaK!0z#vqOSj8j`%;Y;ujd${8FTA>d4Rl#@$%sHs)268srD;1jm_dE;j6M
zB9GPnSH=Le7x%E1ZHI6*{37SD=JCkl+0C|eGMVjSOCGrsV>mHREM{`TqydMMixA6g
zaD(68zg^tR0z!Uf#}j~q{&g)1*DldgAc)Y7GzjCjoEtfX-{vZb?^?uZ`&!M7tePKLsz01gc+)C){Sqhl>Nu4G5y
zlU}s8&!2oH4DdnQx}$gyk3(Ta!Zz23Vd6%Qr#lMm7+J+m8ONqz)W37IiX8egHMUEC
z!UvFGmj$yJj!RI-+~+Pk2gdk~DnosQll=AXV*JDN0g9#BiC<;{VgMho=b#^=bi$9p
z6|$AI^%Y|drffS6solGxHGso7dQ6oZd!gV$b|l{E@wfZl=cB5f!&%K;5%e2I!3ja360yX##lhGMn2g-O?*eeyI$wvh}kw0A(TPd~mOz
z{qCc$3{*on;rY*
zm_z%W0dD2DDyMaxG$kBnF9N(sSd{{^I`zoEW7y8I?CQwWO0yla4>^!8{g!DY>iYx<
z$UYuix<9o4P+eKn;Z#0}gS1r>ROrYS_Pv_f22hAuc4=-rb6|r7O@8Xctm_
zaNY=vEs`R<@!)hL-QIrJV@(m8cl=%D7{2*3ctXvQ7ik?}|0X)qzT@NBar{z;qIFAT7ozndNI@-I|@^UU-HM?Cd}IC}DKUs6=0-?IAMShagOHdU;_
z+C8*xz6B?~P&
zjosEy6zv*Jq~Z)z;T3je-)*YtQwFFEelSPnd=cl|MfBM*6mR5CY#d7#+MgvdBh*K9
zo4aav;I;KHWAXY|EQIe*^1(@!*nKSK{=8&rI
zMjGJD+2=)4=q&a=(
zfOXi*YmCxt(_z@6DF+oB)fa$IOFqHF%l?kChEgHX=^{y=nVkWTM~SL|qJ~v8H?|5b
zkeQr`pP%?E96V%-H6O?rn;m`$rnoq9a44h3C6Ao}-l}rs{^7?F2GEH=G_V+5Q;tSp
z)D(o%a-k-t1HKfK?8T@Z@Rd@#6j@t-AL)hOAv1`qBFg7#G~Z@6m;$asRo0OECK51f!c)?1|=+=rh=b
z)Hj|*(&}a4scGn*J_lXXj)9t*k>JLQXc+TX%mWMA%KnfUP@6>x!d}H
zq(6m3WqB8COb%9oB`sL~*4cUfAv+z9?i1P)G*V;s(HwYVDm=H1cV^CwfJ1^oH==*{`dwJEd8ue6IVA~$
zMijy4lNN)dLP5q{lI>rztqg%~%>x{sKNOP&9f&|EfL(PZsA;W3c4`*J_8%pfBgvbD
zBSsyHjN}YtCTAckB?F4$i5!k+NoZFoyF#LqggRNXe;tlkg0XTnS
zOpvQ9IC!K`ZBP788O8*VLPWN1?`FKQX(`rLY(iUCJHk9Hq-{r_OH5EkQkn=urudT4
zFFhYWm~t8p9d-zkytLBeeqHhJo3XY+o5(@K2B6=-e3PH$>JKFG8|#`;TUjq0U;5jK
z5+#mu>zk?m6lA4jV#?ryaPE}TFd|<+mpck4HZhO@&MZA8;6t<8Jy1S+8cNlAFttUj
z8K}djBXsCBfG<5NzQO80gKzDxqlZpr5HZ1*b2Y$+L)odlt4iG~2H^blq)<5ggbHY;
zPcJTc<<#wSBJi5ldVIKR75?-2>)2UW+T)&v<_^Mnhs?v_Bc~xdB~w3VH`2_vyB6vjr)s$rv+f1d@^?3_})3I21-pV++c6SBZGPd>M;k^sm?J5kx|fBc>R&JT=QM
z9M(()H5i7<$u!gclP_Y_lg1y3Gbf#lLD>W1GH#EN;qn1%s)Mq6F+8hY0$8`Dgt}Th
z8KK!X07+UUdb>9E?0OoW(&qqfTOB8d_{&)vAh4c88ZKZb_WXQ;UNJy-_kYh~3LfSh
zw)*@%6-(|@SlU>QS2r!i+uN3-qPfaObP%hrL}c`@aS=gW+XvRUF)yf~<6ERGv<
zI8Hy1>RU#J{mh#G;xEhoCDI%E4=%v)aYMjZq#zxcITa;UXsm6vv`Nk}`3PRWSD0S}
zi(FgNIdGvvN^pk40@hF{EY=TXW++I{#hei{aOwfaU`zp3i!n#oi@1f`oN%y)8Yt^l
zK-sVytY&*u)d*fV1mQ{ZpbkGAU`{8?av;ZQdo0++g_&}d(0i#iXd1ss>N
zvmtF+OH4fUm;qW_7Zvz?NzX9G^^;i~R!j80qiYXGBwpm1^gRc`lU)5!3Or!!8C9Sy!+d
zcfI!zUfuMLi1v&=a5xGFk?){6&%3wmK~-6e>Eu#>^j=yHG!a6R(3B`7Z`NEW-olVT&-1$kn06y
zr-Kg~fzYv+gXhVmnw)1;3!rIB+e&*0yla06gmosC351qaNDjpfd^ku6cloNlEI;SC
zj{N`&6O;Xs&l7&Xqi)eaU#jtc=k-R{P6T=VK5u(u^rEsuz7QE)
zZ^~g$DGo2EMap7OPwpYp=fl#^aPyKsMWn7r!GIx!$j;BSFn}RRWb?@U$jT2ojcE=i
z5mnjFy{0Chs8L6t6Jf3jvu61CVr*NtQ$%>=i_9&dJ*2jYkW
zkzL>3+9|$kZEiOikF)@31kz?%c^P8OA=*^pP*skWhE_DxHG!)f!~};8Js5W%f3q$3
zSSLZl95Rdf*yqMbOC@O>g0kdAcwT!JeAHNk&%6}8U?7krE#O7XX++#=kEEm~v*>CF
zO2upN?0E)I9gKg90}yZQuWghXDi*Tya9yIDlQ09cH$OAgt9V~#oDZ-vK%#ohO_y2k
zFDqSzdsjS$vX&~7P>Y84M?wEwP$s5)X+28|IQqkA3m^g`5oPK2@~CKz8^VZKiDyTCeX$Qc4pDF76j6KSB}P%2)A
zQu!KKK+BJcnl!SKjO4k*fw8{nZi82X<5YHjVk^W6F+f?_qLji+b_al~!R14!ZN8a(
zFtHqk7z5u{UxEid`8Pf+TVuXOgfe(U5%T)yXwIjOb4T_wS5!55914Zd-qI-uj{Zk>
z_TG|eGc*}%4v6WdG;H2B&VmWGV&)RC>+42gM(j`D@8o~!%
z26fZ?83_&oF
z!%JovF$DP;gNGL(J5P=-Yvxaghm|q|525AskLz+5Onxe`0+kj5`*CJ_T7fTQCagO&(SK)!x&tg|&
zxj7ahHX@Y4BL*O>a_lXw#@>=DOSm%Lz!QBgJKqMwX(Mts{V0)c;Lric$W9Xuux2ku
zdels`Na0QL7b;4sQMyl+$mLS0uBIqnC{R1@_6Zd*iYNMnj_iJh+FQgB#+_b6gG3QU2s0Z<4YG4Ea3{
zW7)Y>Ciqy-Y*5#BG~$^}i}BX(k5JiG7jI0xelFH-g>R=bHc5AnM>w~#tTcZM$5?Y%
zomO@;veHmEumJss^fL)sCNoo1=o3hhDsrxqlBrs4#J3QrqEKsh0BculG@bNc9C{h%
zjXg>O$4xr+#tfC_iPegzv
zE@?k)jF7NfJMFw8>`S{h7m&;7fJG@lq4K9W1QGqpb={1q(zG!ku4ehx3R!yumhPvqzUL6lRFfT
zocL?d0-uRDV;#h4z>?XSkX~qQgy;E%VD-BIFE^!sc+TbE!)9oiqI#RIb1Iv<;dUq;
zWl+kV1Z&?N4WZnK{F?^vu5dNNm!~H3?Lu}^?1)fI2I$`V_>>Hx&hg#eB$StaOy8
z@k}!dXv26!ciYlkB8!vy@a5+M7{gl7GafraUHGWtb3F9<3)m@{LE=?obGnBX%e-PP
zRFzT-!e-PYk(?uWCg^=~xC!Hw=4`Y@_x;H}_`F`?E}4d-b^+4rGevr6q0AT`F~Z0L
zhGEEvfg*jvRczW#B^#NL?M~bt1G%3uC`K>?#~KXp&`ZB$~L5#X$|fQHod(8W`4#
zn7`&mcpkqKjBu_Wo`H;1gpax$>WHZpf;8q$u(m#L7ELEvfSNYrP#RZ4+4}-muvuR`
zi$&pyim#~m%An#{b_%w*wGfj5!h4_mk;?c&aGq?l&?EbO^_Jy^j0{Rc&>5YJA?hz0
z+XdVt2i@P^RE}r2yotpnE6^2+NPSU_flL#9V>&fU&LK%{W5t)=A)=-G#^RUgUW6|d
zk%tqJu2$sJ3NA4Ly-VLxyCVBjRmJKqZHku@=AyKMKFQ>acXtKNXcK)~P?U$voOGn7
zr)oRR7?5WCHmJsIFk%LoI8-?{ui1f}o3!Z4x#Nz393_5sHvnC=Kym?)oa@Y-
z^kO&w*7CV9k68P5unroN%SxH79c6?&Xif2$?kk=yB=x(N9aZ`F9y0(hdn7l+d{1zO
z6Jv6T~ba)v2Wq
zP~4tk>O}mV9bFdUCoSRidPP{2zM=LAQkg-FG0;L)YI?Gn_CRJ$M_Y$r1S9g3mY$-m
z=*GCH?e?~gCb4!j@xC^1%C0T&JbgdV(E{jaiG|Pl8ThD4A}`2k{>*zVrSNR|
zCs?o^Jbehl
zUiW%ZE?|Ry*x>YyD{Ti#|8)rSfNK6(XV^(o$vV~OMUph8ij=)|yGqf&3-J)1-trb6
zT>qkJ>yr~I(g;#C!j>;0d`cal`$^&*zd&?*OS_QrbkQ@C+LY2jOhRS^UCF7*2y_L6
zg!XjBfCqEmMsG5?Rf*l)oi^aU$V$uvQxTKg`r&fS`y
z(OCx8VUKDu@U*c&$^gM#YWjHdw}jgeS24q1e6g*jqxOa?0|ZO|xe(yjL`_mGo5f&r
zH&%0F9_jw$TNmS>8(&3hPzwwb0a6lL#BSCar$w#K_D*zmbPKbDBsRs-$?+vZ6LEi$
zh{lkVlC0(GQ^>iqTiEBMB}f~PmJka}-N2}|Kx03ka+uZ!+3gh5Hx|MSFx4={?*pLy
zz|;?!Lu4|=GmD5(Tbqb6BP%~?z7!N^6bf@M=umMk5hi);m|tT;?$Fq;y3LzG1@^gV
zZ33$<2huXY3kM0wZ@C;8jMZ+1=i|R>L47)vG9w@1gKq+o^$kWc#U(08?M&-NTd`;l
z>|S5-B~l7cq!D)pD0!4}`1IALM5bZi-}%q3_pxBjGp6JxX`YdlE~K%1k?l?kN0dHH
z5t?jDQ}B94f?9KfR-Z>Ber=Uj%gW?XLn>NZ+lA>v_eq&_wrdPQ3^4i=Agu}5FbC++
z*PC>N
z>X=iYjyQ=Nul?6)VlB7(hF+E)i+3!~!n+>6US%wjm1c04#hbD=v9Vpx+aepD
z>}GO4lanb4jSF*#w1Ut8p8%P)Kp+L!GAqIaWb5bk&lRCnyA?<9b+mP%p|(*FH4U
zlADw)n@-khSfQ|rI(=IueSdh-B>dvw^HGqJ9c?JTC~VB?~vv6yu
zt->0Y*w)z8Cf?1=PB$H3lHT;6%mB2IQa1=FnFxe@nkFG;%!zVHwbp6Q$d@4PLrh4p
zQKTm;hl)=*BaWQun!R8!}HePfl#X^{k=f=@GHOvPl+H%rVSlNrSdJXhBbgE3F?q};HeHr
z$H_3bjm6C;k(h~rz4gNCtP{>U>nuy=Q4|9NwmvdV@q}OE98%V&i=K%U&Phx)iMQUa
zSdCw;dK4iwEKH4l1M;GrPm=ItZczN2%$|J84)tqk21HDhFh)d9SEQI#1VA#E$ZR4B
zospGl#+YqO(u{%KOhl+5CaFSVp%0
zsHq6gzAREg(xE@rUJ1{-KWO<63ZNFuggRpXjh!)6s$tJ*{xLtaoJSnR0HGZZT@F?K
zGv`Q=7e-7A##qFZ&d(LkjB{o67L8OF`!n&kgpjUq02jW02X?mX75F6cAv*M@Ij=Pp
zb%GH44=NB59bpowD(b2m%?&K%+-78_o6#Zyhlr7whZePR3$i79p3JEZ@tpg#;}Mtdu@EL#tv1qXm3)9Z*J~M{Wcmyo+TR+Rq6k<=7pg1jglMKcyV}-B?V@K?nax-O
zAfLd#Z-6ueZE8^R_QO74_klpoAdLwGjKlhiP-Lw2
zdGa-?%4^Zm*eVvfatm{iMOzMS(Qwji#4L4H4Z@EpPA|l5lP|`E9IZS`6fO+`BZu&$
zy)Gt`$j_x&wg@JJLF_(&L(JYFO#9rkH=l*_+4~wH`#n%+9uGeCcyql#EQUszC>+X%
zcY(E*nhX%0dNYt-99?!oVq(^`0m`0#1A#`U{f`A7aH7cs#<SlpIlX~0L5=N;ktmFoj$uqT+2(Dn?V8yn{DO$|ZfR~4{sS?+vSlQVkLIkiEs6XR0UhgPnMak6qW$KEi7==)GOj6FLlgnvWV
zq5US{uhV`kixqN%Q7`7>@_ZT+e%01>B%f0fAf0-8M
z%Ezv&1Ew9Mf92$qL>X1qXph|X@|umfW$j~V33iCEBuRf`byTP>kq2KVicyITF~cKn
z34uZ@x;r;&wSver8Zfv}?7g+59&;`jh!)XkmDS={bD*iQMPq<&U;;5fy>)++A%NO5
zfX#D!X!mG)49L+PF>Z+1OB@yEuq8lM?x_)sKw}#^X0WI`YP4%;BZ@|CU%$&-znDMv
zbX+(>&-9E-8n#VY_V@dE-YgW?*#YI<7lkjtXC4P$P~=XH`e5145237iUbFu_fI99t
z@NuU^XWJX&FuvQh2ujrl8oK@I2#>l9$Q)%|ptBHkG@W{&PG=K-X8HjZat(g|*WWQ_
z977|YrEBQoIK}zR9VdqVm24-&_}3>Rq^kJK)|c^A$-4qdinUWkHhH0!Bs*;up)hCh
z=s{+!PJ?J@4}g&$Pqq84VN-4J)CQF~50IMiht`Ad3n?*qB)4EpZ@i
z!T{_%*n_RDT81r|Hbch_Hg|DpWj7sn<_mMEva}jZQ7~lGK;-5}QXGu&G*maDWP7>r
z2MUvOaNpD)V|ZGjgHbFSsD`5;QH%Ll$G^E}*Y=&@LdiZc#i(@Tj&0twUZl{BrAfIz
z{ehkN!a*o2p99;qQa78t2p@YBU~KM@Z8TF%YyGjUi=dP*)4ESeM|k|DK+Z_XQIe?N
zwAmy$gq&cv`40N2SAR@QG3
zl5xn0BBYb^YQoF0Wz7y@9t#ogv&`{GT)*Q|pJR9@Jd=E)t->uUXYYymr
z2ZDD^MwcBuJA+9A&C$VggTn#l_GTzc9@4T*6@V8Gg*x{#fR2-rc-Ul2iH6w5=b`Lb
zroBZBFzFH?cciV8ICRNT>YX&-TsAiufUjAY9cE11#hi$dX@AGSnUe|RfQPb)GIDTA_)m9=p
zx`;vSiEAWjDY8V4v|$2e*Xu%28VCKP5A3K+ixKXhf}ei&chm>8bq6xvsHm36
zAhoCd%99G9bVs?^!A9oXpkYNiy2*#o&`#QF$Ho#7((RX&h5HY=3d7U;Tl^OBkp<5Y
zpC%#m)jmft1eFWtX}6=kbI>NTRw4OYT?XY@iW+GfSNMcOq0XEKP@1{io&!v5?ekD}
zFE=%SI`tCpe7SO-1GEn9csS2tldo;EpfRv|;S~z_gAwHFSc*#Mm#}AlCR%hblgv*d
zZLVzChO5_TS*m23j2IV*0FXr9zG1gW92-7X+W#w!ue!VzdrPTu1bv?+Dl1s>LZd}P^ycS&yO?C`aY&kpMq75JMhOX
z&!dDYB7Z28Z0H{!9hC(tpUc4_O!>wCbK00Cu`DArW3S(wgOl?dsA%
zpxZn0Bx~(0-0@#Lu}AahsT{dhl2E%SO`vppg&^wUQG;~5J;KU?KtNP(6S+W&BGv`W
zP4W_{P&pA=AftmWXk}TZOp>{3D2%;(ss#fSDCsz1#{iUmz8$owOxgu0;HAV;`tP_C
zjuZb;iuU@JQrx`ZG1PWz`*cZ@(K^BKv62;OC0(7|H9VPnsbxEvK`i#IdVigGC)wl2
zl3Bk&I_66#v^!9+g9n)axyqp2q9dp9!pwpFB$B
zz#AJ>h`^icTaiB?dexO|{;g|wphK_HOslL^H^>q`6+6RJvA{&du!fBt616r!7)Y|Iepi~*Mw1G~zXm}TwCji{^CQrNE=c04X0dbIh}BrzF2>07t6N!-4RHQy#%
z*p7QOh)2x3Wd25xuLF#%r3tKT8`SY6`Sl%yHjl+}j)zXDY}pH7n^r^^;HV3Lq7l~o
zEL(pTx;3A%%?eAO$fjHw)EMC7dnT&juW`-?8aAXc>4vZ{w2Y&gM8h5x*WP$&SOwzb&OKOF>Z*pwzciWBc<=)
zz50y^=_jU;UqE(#|H1tn&KQdz$jOSNr&OYG?S~sgao<77dHBbqtC8>5oo4-WCjn%c
zH)++~!fW#4lubaJv}~Jbeb;1^3oR3vg%S-I<(QE~oHE}Si)9iYMGgy+2C1xG3ik0E
zTFayXjy+#6fStZHqSj9ZjSf=NvkHYNC$Z_*uhZWB{Fr1DFc2>RcG>$`akaW5rOn9hY|tUAD=eOoe+(Xq+ak)_$@U?=8&{9Exx
z;lO;1ojl5_N97HxBGWR6^`CAg=j8CS^Lb#5YzZ$Yd!SFhB3hTrUXPW&D?
zYyid_;IjB^vnM?w@3jCRvn>zuEsy-5blZio0WWPwVQ>c`}leDqM>7q!JQIr3v
zgMNZ>=>u`+J@=xzrdlw7*VxCQkCV10cLaf9!-nCfKf1zIh_!~gu(W;yp0EBG8{4d9
zX-FecNR}LY$`qxAG4rwsRtf{JUbbGWV@%2zio3_0hdjUIz7Ff~q7<*)A&YTtTTkay
z=0yw9Ibb}d0_r7<4)ot!
zt-p02Z4$OOIlw+Yox~W4i_mxBFvsT~Z!+QhY{u>4_o5eH!bcx}0!lU|Ca_#wV*m~X
z_uNjWrNaS|
z_klmfP%20p^NMAf8gpuIz{#XZ)LcrWO{2e_(MdE{yY=OSkXUA#&@qcU0yv-XCAanq
zC;JvL@HtvDZX&?Vo=*f(Rsa`Oe~ddybOsnXP(*?3)KBs7Z5v9kN4L?ly{WjV_+%WH
zcM$F@eHFw+f&oShM8SYui^EE3&+Arh5}Vq|K^FN%lJ=*c)fKhk%rCmm?>`II6`v@6
zFJJjF{`2yG1@Q|8(9vOFr858o!oVfxpNoSgOo--?s1T#}%0DaK$D0l7QPJIqws7Y!aPY{#uWeV;f2B^`>W)zPaC=St(FDfKUCJ?P4lLKtC
ze8rJOWd4X9VqYXN{&n<)n3Y9L2$YoW!Ji*`SVVzR{WeFK0bN0$GYA}c_-veV+_8=%
z=XR4!qfc6QVtrdVmNjifX?ML@^2PXu(yb|PiSnW-X|AcR1zSJgDITAaKN-IrChh%=
zgXbOr7mF5q)zE(YC?0<%WX7>w3dfO*zkU07m4!A~gGMs&k>0F?6id|_5IDcHsP+@w
zvFBCM39SH+KZF=SdzUgi$?Ty6sHyUUU-9A>Lr%uYxf9`GT5$f3J+Fb4uPk1c+GG1!nR+7|_?TC!>80b7Lor>t$v$db%jxvn_Mok!s@l(cVgh7&d{chp((v__E
za9QDOT-g6GQTfb3_#I^t1{gM$7{F>5um5C=C?q@TfMFu~V!1f5XJ>`T$Dt|we*P3(
zH|RJd(J6>JjK8_-ZnU+xAtPB^5td6mQW&(Y3&_sO#*Z()2>H3WQQ>bVQ^d)OGDxE>
z+>Q5|w&1QOJ)%e{@l}@6vvU;lh5i
zL>yeeqQh}V#cNnpr&SrIV@(GP?x%I7FMd!3Ws>gXVA>ggHr7yaS=s|Y?f!bu_i#-1
z1WO9jf8KZv%Rl)PSt(K^NTR5wP9P~M1?SJ3hw&pviEWD};Yq%HPjF(4ttQxl@<0RD
zwCxf9Rs@=`wX+JXy5Den@fkQi=Riw;#vdACI?s(kvxG<)mtqaaX>I0Y#domdh@
zW8p-n3z@zwkxd5}>AArSZZOJYi-nVjFkt7i@Zwwk%D{eN6_eUuiJ6$O6rr<%T~xmc
zcT~JC`WP``C=Qx74jWf*#f}XnA}zrK1wS2dB+kj7rb%Yo^~Z|WL2Zcd#}|up#Egqf
zm^B}65J_bROdX@AK$}m+*2Asqb_r8wXi^@Y9(4s$Z0W|YEM1CsmM<3?AW5@AEEkzT
zok50^jyw`a&zj|cx}M=A(t!0lS}E^PgTiU94Ypxf>o&~J9F0TLhQytp-p-x&U2ox!
zMujsRPP!njtdGpGDOa88%SqZh(K83XkA>g3<$eZ4_TMFjIVXNe_};U`0DHA1Z3lpVZWVu%sdHieOkCb?wg~+>UH4VJi$`mhi$^0T3`0?IKg(+++qBsG(9wfTLJ55Ky4*jogFU1e(I8L3&X`7*i(p_MtZHb%LY!^=l`m*uD
zs2{=apkbh
zITK@mZ$y{E!Zb2Ap5It_49?Bf^U!T7zoo4Wk39bz%Bm_+C@s9o&Tws;<_BDJ(Zwh*
z65|p^Vs9j0Z@!5KP~Vw4@p{@n&-V={9Q;|P{`VJ@bDQH75Q`18oSPAO(~?^2(!i?r
zJ-EE=Df1~w;R|!8;fMLNki_I;H=P?G1~_x~!@@_QgXv}*WnUbM{*FSU6ka9YU_??r
z?jLkE3VqIXJli@t@UNF%#Ew0CFhF`mwk?~xv~cM47hR0O1LD^ZlQHCy9PJpCOpI`P
zLkPY3#?aGl_IhH_CiGSuY2I7tEq!w|GWDgO_w8sBP(u{IK6u-m0v2+3FV3Bgi*sfm
z-Q#Zd$beS{n{h??zfm4+65A1H968ywPCtP|5upvAY!#bhyv&0i=FY@rc{AY^#cZOl
z?mz&G-dv2;n>Hao6`%^~cE^eq!x}n(6K5ZeV`m;3drlL;NmK*9`6eOCa(U^S(BFQ5
zk*P1-)GG#Xmh_3pe{BLL@3;$IDEL|a9GsOkIj-3wYpBL>2X3nRFIIK#5hckd9Xdgz
zJ<9_zD>P8rLs>08|9FdtFco?;@IcX781B!DNiJ`ExExD9T7m2oAYIC(GZ-PL0#&WR
z#4%%W$tm9xZMls;zO=HwkvJB6L-FyUNvzerYR9d&omIYFcuJH>6OB>IPMtrBs6x-QI~hU@Yu?I{9_HT0*AXvxZt@WzS{
zk(tbq=>gs}AYT}zL?_qrRkVqJQW+$;iY{?Y&dAOJ~3K~(K0^$}rU>qb8r
z4(o4iQmsNygUz@n7~Y&a^Mp3bJ4PFJ28}&$M!%7_WV*1-iDiriAzE>3z!*&v5#lt2
zms~?tqnk)uM(gtU?IBycl91=tj!OX#f9?j025@e`n)etXQkymFkY#I;%K8ZC-eXOl
z;;hVxBF{%|&uNhM=js12{Q=P8TZROaoN(-?L_vPWy0p}pc
zqaE#OAtdQzLj1bz+wt$W7DEkpn~t!3e|3F_<_BDJ&UqL*V1Q{RMJCgEEyX&4&MWXv
z^B|AU5Gqb>Mab5=cqF%Jfw2ekX3Rw_I*G7>bw=D^wa`9R@39GYxDNhP`uf^tViIsWz9tLP4NV4&^@TM*2E#!i4%g}*=d
zD9k>HB2h9~I!}J&uJ*3=G&LujI^)EuwXEMop2=k3j?3uTb9*=5{fOp|X1(aKIgcR`
zoX9K|p{btXL>mj^&s^tHTGcLZ+~lPl7$<(~$vejP#y9qUHNaPOmE)$m*U+GLh|MKa
zkC-UV5i?0pKUsYnrB-lYcFHjPKJNr%DU^5bG#0D;D5>0wM_+pdo!#vy%GAzYwyy}c
z1vE3Le_lRrKKB9#DG*P9*ongF{djUe9@E%mp&d*orgdUESx&pP84Lczg_|`ZnFvno
zIyVuVXk%df>1*wp#6_IDDLp%4?4R4eb7{Uuw>kEPTk*r%=dd@_BC4|;cEU7E6$aWs
zzkJE3V#ik+^W&DBqj7vHCEX=<1wtX*{p?eyZ*CAK5FPkpRIL*&Fl}EzWebp*o{68H
zekO7=><41V%3SW(4JWY_eqwO5%hPh7Ip?G2&9)@IeX?{7%6C_4&yq*s54p$dktVw(>~2l}@!wCN
zwy7Td(;?C#j7xl>Cui+x1pNLKTyp%$7+FN8A=+^j4=3?(>jbaens#C?C&FMJyhb{N(^W+gNm93)U8
zrEf;z#BQF%GEHL5on*V4b0=?7H(W8}3=>9!>m5$hh~9KA`F8QfAcwm2ccXA(
zzpvAhz*j8ODn3pae>_nW$cg(+O7Fo|%2@3r`b?vg?V&oHS*PU$(e9}e&OHiU?Opij
zt<@syldj9tr{n7MI15!S-9Eo;DVA?shx{}kM++Q@OQzqpZlIzCm^Nkt&YV3Ley_nP
ziAuRd$NXi#x4%psw{h%`{^GaE_+!`VsSq+?@ocMjYR}%5)xnHLK`eD0``P#FpTLd~
z)iei=J8KT;6m{AUOqrh(e1%w$eF_Q{+oqT(0G!9WY~wmSzkI1!4JIbAFo6CC39Bu2
zz{sLOxa8=Qke(vf`*a((thP;-vOyKkgy{_-xe-LXzG8i6hd-8imZ-q|(s0tq_~Y0A
z8>)KFmn~oVs=xc&SK#4xZGZ6aamA>qs1@nXWcu8kJ{PB_M5jAP`i?CjmTl4*APp!W
zx|X!L91$vQ($)ih{{0IuAUC>1OJ9vOF~PB~y~UTB``W|4f8SRyD$g+f&ui}om-Ykf
zJ9J-a3%kP&IIrnxba1WAqH#^}4Z_0A?;(RFmS5xq^zzN?@Z5(>Q9umfq5+60XhDq9
zBF>q83}%jr#c*FLYQF0%9tId5VEoZ*@BhM=OKd-Yp7Dq@6NpT#K^L$7qkOhE7y}u_ejpr91KH+y6yYGQ?t-C}AZ9ZH%9tAz(*6Fm2QX
zoOifXDWW&y>miKVc;iUKzMeM&4~FF!kI)i*?gnR%@F?LT{G13q>~QknHFU@`fKkr^iqvsG$?M>ezW0Tcp=2
zjRk)!4E6?BvUYNk%)Omcw=u*UTP$gA!*N2y6c7I1vIHr$ka1Wxl$Fi&Pruy~DY2lF4(7@#;C@QHi~tHoi^L1imY)dn0s
zZZgi8c0@uW3^z0&ux*>Dx|@8+Az;bTGMv9l5Tk0ePR&XFt9%;e}A;;HgUb}%jr7`V0#W=
z{E_R65m1*>6fx$4o*gEc5@a9Du72gdWwjaad-=JOdb6qE8r}w#szoz-6R!@m43jLu
z-JCcH=J`)9M25})R4!4zWDqGYXj>hSoRp3$=bny%IeN7^8FuM|V0k&(UwaL_lPXlu
zim?aY!huLVdJa7O@~nQX9ex7{`|^eScdW75@##b#_IvT>G1k(N6Mgj5q)CMK-C(5g
zMnBsHpK>JQf4iX{)bJuOHpi?yC7&xRAGt0DB2kc~5|WfIDc?7cZ6Q4JAa#tHZQ9ZT
z%NgzOe^F^v*=ZCms88^=Wxbc9J$Lcxn9^3@|K5Gl5JR)_=%MKnr5sVIRIf
z^+-$~F<$T5sOV%p@Ph|KXkYvWg1dHz;}V%lC18B;jXw~n*W3tJy%T7l;=OvcFFU@(
zuq2$AL?+?O5*(5swWk^g0&&>mZOo1Byas_73oY0vOrBG-l9rquAy?dTkgQ@@ZWX=^
zx{+x}|1Huy62{5sd<1M*57HKUVeqj)ZrB0WWLt^5>fn`m4G!P)Y
zWBxQKOP@XY00lc6I}x>$VJRQpAy1~jmEN)V$Nn3b|MUV81sa(PQ83r|!bua01WOHbG$_UfZ~g5_$%ax#Gme6sACt@g~ouM7WlNFYIT>>O?Bz+{CP$Gi9R_3;OJ^
z$x>d%i6nT;5_qEj#X#VE#&5k{gNzOp%?IlQ_JsG}ngMl7}ReOVz=y4}T3-NH-oB8f7{IO`pp-skaM_tA(
zg6jBRuhWl6(x=ycT#g+2FrGQS;{=4!xzoU8DIbdgY?+Hu3qQ6#98V3A`?telhcWW}
z&c%`ej6)a;ag++P~V_iO#p)M`-t6fO~~G
z#NY++7~Q7BSYzQNDkIi`A)Myhu}z%@5~dT$WO0%%7LrPQ-mE*)
zY~%UjT%<2-rQfihF1Sr&fInY%6gZv%Lw?Lm
zrzQ5&auN$M;`qR6(@4e@-t7Z=lEYvr}xb$bVTH36w3H)^KSr}O`(3Y<2
zqVcFNuA=?bcM&eB2Et@IdBM0B@TVi~_G_Ueg@BSxnwcgKLFNk+cX1YnO+QDTw*<7S
zn+&llf+#w*9e?Bmzg?)wZN^dxrjO)AC;B~$IWKTi2QSWHKUtt1lE?pY-9&^z<(g?n
z$9I>6fd`krh%HsSaZsVQDaP&u%QQ#7sbJQI8enSic$_~?I&~@mtn#jIbiKbC!EJlN
zhzV3L{Fhw{|Fu7X`sBm#be2=u>;zi+?v*$gsDKA2v7ar_k4b&-3Lo0j>1gtCQ6I)q
zbA65HSSDpmDG&pYeKaW_`tT)euG)o(h1!WRc7nGojL~7*DzK4+IQ+Qt)ShRURPHQC
z+Z!LFf5;=WfHGhZl#~qc$~ySxj)0e(5f??$C)3eeJiB$?*X`*F-PKx3Y`!-mt!*N^
z@*(Y@Y|-XD*S+vXHIUQ$1d0Dcjr{$?7qPW^HzxPjw?!I3D%%(hMA88o6b_}di1|mH
zjp2ETE7gwnPQ3Q~Qf%L}8>ja#!eA=jqBDXphqxC>$Bcw$WR8dqF*?L7HHD767betq
zSHc*0kzKz)te8d^;I3<~08<`JxQTDci}x*m4!i5iFv(y5+m0|94W=K^1e7!Z$Bdbd
zlgB%qAK;9sflyF8-1xi8iUF=($!@w=R9B8Lz`|>?5mdBOqrbaM4E%BF
zV`ylv$D{#3iga9olO=AfAJYDS&9y-P%tG97#CZu}^S!rLV&$?m;ykc3&OILE4jcvE
z89?`v%?R&q(w$c9}L~X2cWZq4TOn*ZCqfi
z)6fALv>uS;O~;ipPRGD3_p^PeE@k
zfF2zpMqvF4;JyAFg#Yvscx9``927!LNrmU0bAgU9)N5WenMRq!f$1Z_es>OV?_Yq9
zCLmn}lD|#n6Dwsm-(yxsvogRRulwB>XGqhUz;~C9f%&g25Vb)M?58n+aoIJ1y=WFO
zKwH3vGY>in(*})q#b;}48=igQRaEV*#o*#1%sc0JWMo(m+z7UHq3Wd#$gTmroIG(o
zL`uYNXawnB=1l@SVG_{!1;M|uO}sA{gL}Y^9|QK-X+Zw{R5Ak?)eW571Y~?`Or_h{
zFBbgTaUS`d*G@y2X&Y?6y95U2zq$a~$-n{q^nMGSn^IU_nhY
zP_cQY`b1(KgHP8OS~Q7q{r%
zp;j{|$^^RO<{?mnZ-GNUxmpI}s~TKi_ZzFd=x6g^TOdlJ98jP$fP@lz&Y+pU1%S3m
zE-M9w=MKcB2cLqBB%@k{)&Ly|`}UIM_;lquBqt}~duJSj(PM_iocG$AdOY>m%V=wD
z$I#(}aQ1nph*Rb1Qnv@eTj}g30DBk^_5fX8@h|K40s(^wh*>;B8<^Mk8-dAv!2tV{
zUiyFz7`8$29m9Tp=N@MUxci1QbaP66xk#>n5OY@KRW`v=woE^#m2Rh1eaB9Wm}89c
zr7~XZII@dp6Bg-3`>G@j+(@!x4D(;VM=$^_g!vuL(}-mXttg{GrQ({IKR|v;mM(G_
z!r?GBtlx^a-dKiEIE*=Sr(@cTN$_}R1vmz_8BnsT94|h<1nun|n11MF%$_q1$;tlc
z8p8pA*D!!0-3=a~RYAC&q3-i`1UkbgQinhs#67wTIJF5#BR?PkJlnHIUE#H5X40_i
zv|wNDbsD;5e)T_`vIh)tE}lv6Sty-7h9q`1yYWvZw?}Dke%lR~1L~i_VcS#aMzwlp
zCgC$|%E-m%nfYk+C7B0g)8IYe=-<_b8I9E_?4~?;CyYoO6_v#)bDMz~w|^}dv8F><
zxZBRbR>e4fvBm)81XD7cj9;S}H#2BMEl}1BTs-MyOzuAhVQ&zPS(Rw?)?n?rO{lGH
zKw4S~X3RVo$^Imybz~!_xj#H1y||WyQ*9nORF&hCkJsY8cUOX|s$iTsM@)xT6y%DP
zKftkN(=IG|;RC2)j(!;h_}=NqAfqT1NFw_`7H;jvf)mxpn>VLCiby-vNvT+wGXPad
zsR&ESf0VY96YR!8EwvcmN+qo9^X)LtPVX?*3Gn&smIV*n^^}G0_^sDY15;iC_yD7`
zHm@I@9xs}`N$6G->`2STd-;P9P(0Y4mW}uG=(nhu(5ovw6vQdjyO0~~0{uRgocTzq__-|$!Np!x0K>z-1n*;^sgQTUoZ*Dfix7<41*`^hd1QM2k(4>
z&)(mHP$-0Bj-8F^(wKu`9hH*q)IYzcO
zAxTw{73xMxI3#Gv5F7xj1XoXEw?^!LJ6mfqhSH;1>*5b`i;gKv$-vIEENn~9K}B*p
zHe}|b&i^ItTLmzttq}vd+A*=E7X7+AaX?EQMz=L#Y?~no?C48m5}i=){@wgH?-2|@
z3t^@SM3zN=K+OPnIuPy;5EH05!VlGmT_Sjc_#Fwqhm4`99%QuTAt{i8-S0G_etSDm
z@5hltj>VYKBcldaQ&Wd!%Rj}oEjz)Of{ByHWA5CU!taP(PNnBL3|rE3uq{1X&`C{F
zD%NG@qcS-SThj?KU(S^u=n`}?u&WKD+Zr*Vy%~c$TXA^9-nYOrj%T;tYLTRlV(_rH
zS6;s@J^N1`9v|AhzL;j|moqFt;T&0^0MbJNVLlySU5azdw_seW+uEI*%5{|C4kiGF
zF+1>o@Ba;Xx&~l_fbJ1Ms2{+|rzOcQNq0Me+ogU?4dB8ECbSM3f}W{e0PkY(b|ztP
zXcUUd$0E00J1wWSwjNLaTXUKzl61xyCt$>gV)*?ON{yvG<7i0|nUr0l=C)ZS?(D0C$hN%nNkl
zx*cn9Y;`GycC-rh=W{fd;x%h!7?p8+RJ#_h*1n4Y2LajB08wPlmW@pFoTy2YkOq+3
zOF)Y_X&W+`igzE3_x`#G4cj`9o0^BYvu9!CNc-tH@o*wP=LjkuVFs6^X5!7lAy_bS
zGV1-3tJss~zT9`)F?oozSv=BtECyHz;F>QN&VB3c7|PpkuES9^WjMBG54^oh5Ua>7
zL3LIIb|!5{dy!UnS0KuT*o|lAdphCTrT0EDiW{TZ`?4`j+bS=L)zKIp9*6vz-Z4Ok
zF}&HY81M8OjP+Uhc&nfDd2IVOd;9h4dog*)wN5>_Gr;Q7L!c-t^%a)=3SD0|P6Nsb
zbYWOW3ohQh373{^L~1w`w~Me6Mn!HZJ}>?R&8ZCt_`1QF8dJJE68Ju72)i_wnNFT4
z*_4tk4JU0R+T@CGq|;h+F=E>^Cx0!>;dpRc
zpR*8Dbp{S8UfnYW*jSc}fcgZ$PV8BSU$3__LIKR*wicI_Y{a0BHj7rEQi@%^PE_WU
z;j^JD(U@KrGg4!>;SG&o*A9Z{dSeOych
zhkj_YOhW@$Ypd35SOw~8fzGbjz!7z1W&k-_bbvDj$jt%78C(138rt51Gt0N*%styN
zwXquQ{x*~p?7+@`+fb8T0hMXN0h7pe%$R12199rNEQjaGgfBA!oiS!?s+Zf8`!nv-
z=6Xt~OT=Wdz$d{NWtQ1B)Bm@3El_q8W%{eW_hudmlSwAYOrD645I_MnAO<`TREUvh
z*n|Yo)g=MhU3X7J)ZO(lE1ng_kX_J4AguB-K-Lhzg8_WRvw|WI#RmZ*!I;b>GnvT@
zlg#rzYWcgndj76k-Cg(2osfWi&YYRKx4XK!`hR@?_y1K@a4?~BI+}LQL1XJts2&)H
zrzbRG{jAwoKVvrjJl5YDb2MHD$;;j@2nA8Qx`3X2!z*Y+-Lt0p^%|zh03{4bZb)7x
zPK;jDO<(|UR^h}M--&86UICtYbuOILV-T3>Hn4j)#EzXnM+fki?Vi974FNeHVvs@%
z4%*eAXEL<8)^NY*?=;PU9Rtjn4b;>^o^X8loC>^*S^b?@x%+0!7C%5w&1=XzUf&}*
zd5b`l3tO6Wxz=0Fq@mVZN`=~{5`B7a^f%ve(p4B%t?cH$h}|i8pVJWU+3$TuJ5thw
z8@k^}y^$J9C!a=b?|A%X;3BN4zY2e@X{f*`vnGayAfEpnKnsAqymeS!NN&_Ye`mwX
z+Z#KPN&!_>!w;|Ig$8!k;lQLxkTYihO-k8rutne1gCBdeZ;|{9^>T3ey_^X4AY-ejaG
zxjaztUrkbS%>>uf7;X{su*SI_9himzUI<__$k`k)H~#@V~O|fgY3PSG?(U-+AfM4Sd5Wm#RwFooT0AP2VUt*n?IL+wS<%`G>}~^E
zT7dR;psmf$nkT)qk$>MI9lQ%0*6tjc0?>=PV8u5jaCK~-$Tc-l#h7J!n_d!G2eK69
zOxq)6ploJ+J>NWb5zX1Jb}7aDT4AurZ(wbWQ55R(AKRqD~KxNo{#R4M;cw2
zjE&9;Y!EApUpv8-En6U-c?Rh21_lPp6MBL)jZ*;f^2w&y>&H;mQ#gX!F~{qUd39mq
z+Rr5Ek=<>VTz-_u)INbsW(vlQ^8}p?(DZ5Er0hx^dpaPxU-J}VXN&i+6kpK)gcFk>
z*lDLi9(SA@TsNk6U{TLE@Xo8RY;B|&_9#r~Ex3{4;#S(f@trW`ix%Wy1o)l-}4)Iy+7@7%mbwT{`
zkH9aUh=1es5ERRifV((71I(E2{x9pt1CuKVCi?mzTKwICNHO;BCuMAx*}hY;{&re;
zHAzvDPI-N?n^mi7@Xph(Lv8gx3|G5YTsP8FNZ|MFgCGmjxfkf~_t=8hdc404M@^lB
zxu>VGaQY9?koU^Ii=co`BQncR)}8hPp!Gn>>idL)7pR(qZX}->FusB)YC9$#G+Qa2
z)*tc+R*Y08lCRIBZ{XYb{m(y-HEYa5!rHL&0Cd6KKRO91@gM}ICih{K&Y*~o+%Nh1
zo*oE-PcQ!|@C;R%EIxAbuko&<{)Fm`$123JJN$bRZrTfs0$D10GYP&6X$%&a+KCK$
zl|U+CH(Vb;9bd_mV1{A^29c~|4yFvG2!mN~)w*3hY|UQPuK&t(c1iu;Ka|1dKOBYs
z`N_%X8)W6$bB=-}7*kj05fcPMM^G6&V#$%%g}gi;mwotYo3`u~fLgon(HkJ8F{NyC
zvr##xP(Z4E7wWb>i%-m3ho%W$ah&Nz>X=tyciIJh;#hCS7Z)y`=u$Yn94oB62Uipx
z9|WHpf@5o8w}3`Up(s#(b*~pRo1jr#puBz01bq4N<=A`pdytzv^^FyFlRycv1{a?l
z%lz=mN>hOQAD)iFn5PK+kBTst(I^GBC!{vx%*;AWa$2mCN6Nwyi$gGn;EucEpl0EV
zEV~86lN1jW#SvWSnYV~ykV5U3az2Aw)CU4G1c_*SSAs}-9N-T}@CEbf7Tf)F>@-e9!PJ1xBdXQsc88bQUYF_4G3
zdV)6ubqMPdtHT3N9fJo+E5^m^=ZA#VWQh%N0#AmS=+B~{B)2FIm5MuI~gejENdy?iQ1Xc!C7bXd-`1XN}Ptb7toGGY5r
z91sU*;(~4i%M|n_j$Rc2u|~kVN&)}?6rxE)K~yicdkMDChA;_Ls88%a75~}33cUqm
zwQ-_|7*7bXeOg2w)uNC;g^}hD1*1jv92A`LgCZ}t
zHs4!?2`bZwm~WNv7*l(
zTMIE`8k*iVh^3QnM!leQFj?|Ydr2Il6T>sUCY%ch;b2=U9|w&hl2RdvrJbY0pg>4%
z;ZIy5jJ2VbDp1U10QK1QfnsZI{;9(Yl8Gq_m3}j?q7;|fZOb*`YcE`dSGHC`?q~&i
z4@e!*URlV@$3r*2RF1%vuK;AQ&s%wE!I9qrP!C#^)dX>3dqoTC=e%mJgkxI69-MQ^
zFVHlhv#9)7UCNb$Fg`&ZTF_PnfqE5Ykr3)aZYzut*BSYJtr|444{;0+3&;Zjj8j6x
zJ#~dMdkDP|BtiZJ!tTpqg<~lg}wGdbm)cTgx6N(Z1AG)qkfY|3-jotyT6av8H`Yv2@<|Z6g
z+iR}k)I0!Bt1-2rRE3m~hL>Ep7-_nJ~UZra8*fD99D}
zygKv>)i3#$p0dZk-{nCg|D)LHp`H83;>+t6f^r7#L8TC5Js2wwqgru)bf{y>9hV|E
z6d#aVl30&IY6Wg;?kVMRe(uN=fLi+eS59*G7o&}~N8y-+R$P4SI!vhbc2wt9KE(F;
zZ-#-IuH~zN6y-RI8u8_Hqchw#)~K
zysSFikB=PwAm-F>fg@y5WuqE%#p+P0GGTs~IPkyZL9eNdK`}=~mfphhnphki_9zRZ
zxcf-!pCt4a^e6Xr#@vQw+)zZF`UZd|
z0Nwku&C}pG8z6BK$v}DC@va(^8pNVm58&wf7s8N-S#>2;^qXpU)DDh1+z7C@dcmfG
zHVxuLQHW8N(F8@fCosY=8(3wC33P#1