Skip to content

Commit 15187c5

Browse files
authored
chore: devinxi start example (#1584)
* chore: devinxi start example * feat: update to latest start version * fix: return raw response
1 parent a013a73 commit 15187c5

File tree

16 files changed

+3947
-4230
lines changed

16 files changed

+3947
-4230
lines changed

examples/react/tanstack-start/.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ yarn.lock
77
.env
88
.vercel
99
.output
10-
.vinxi
1110

1211
/build/
1312
/api/
1413
/server/build
1514
/public/build
16-
.vinxi
1715
# Sentry Config File
1816
.env.sentry-build-plugin
1917
/test-results/
2018
/playwright-report/
2119
/blob-report/
2220
/playwright/.cache/
21+
.tanstack

examples/react/tanstack-start/app.config.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

examples/react/tanstack-start/app/client.tsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/react/tanstack-start/app/ssr.tsx

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/react/tanstack-start/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@
44
"sideEffects": false,
55
"type": "module",
66
"scripts": {
7-
"dev": "vinxi dev",
8-
"_build": "vinxi build",
9-
"start": "vinxi start"
7+
"dev": "vite dev",
8+
"_build": "vite build && tsc --noEmit",
9+
"start": "node .output/server/index.mjs"
1010
},
1111
"dependencies": {
1212
"@tanstack/react-form": "^1.17.0",
13-
"@tanstack/react-router": "^1.121.16",
14-
"@tanstack/react-start": "^1.121.16",
13+
"@tanstack/react-router": "^1.130.10",
14+
"@tanstack/react-start": "^1.130.10",
1515
"@tanstack/react-store": "^0.7.3",
1616
"react": "^19.0.0",
17-
"react-dom": "^19.0.0",
18-
"vinxi": "^0.5.7"
17+
"react-dom": "^19.0.0"
1918
},
2019
"devDependencies": {
2120
"@types/node": "^24.1.0",

examples/react/tanstack-start/app/routeTree.gen.ts renamed to examples/react/tanstack-start/src/routeTree.gen.ts

Lines changed: 18 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,48 +8,25 @@
88
// You should NOT make any changes in this file as it will be overwritten.
99
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
1010

11-
// Import Routes
11+
import { Route as rootRouteImport } from './routes/__root'
12+
import { Route as IndexRouteImport } from './routes/index'
1213

13-
import { Route as rootRoute } from './routes/__root'
14-
import { Route as IndexImport } from './routes/index'
15-
16-
// Create/Update Routes
17-
18-
const IndexRoute = IndexImport.update({
14+
const IndexRoute = IndexRouteImport.update({
1915
id: '/',
2016
path: '/',
21-
getParentRoute: () => rootRoute,
17+
getParentRoute: () => rootRouteImport,
2218
} as any)
2319

24-
// Populate the FileRoutesByPath interface
25-
26-
declare module '@tanstack/react-router' {
27-
interface FileRoutesByPath {
28-
'/': {
29-
id: '/'
30-
path: '/'
31-
fullPath: '/'
32-
preLoaderRoute: typeof IndexImport
33-
parentRoute: typeof rootRoute
34-
}
35-
}
36-
}
37-
38-
// Create and export the route tree
39-
4020
export interface FileRoutesByFullPath {
4121
'/': typeof IndexRoute
4222
}
43-
4423
export interface FileRoutesByTo {
4524
'/': typeof IndexRoute
4625
}
47-
4826
export interface FileRoutesById {
49-
__root__: typeof rootRoute
27+
__root__: typeof rootRouteImport
5028
'/': typeof IndexRoute
5129
}
52-
5330
export interface FileRouteTypes {
5431
fileRoutesByFullPath: FileRoutesByFullPath
5532
fullPaths: '/'
@@ -58,31 +35,25 @@ export interface FileRouteTypes {
5835
id: '__root__' | '/'
5936
fileRoutesById: FileRoutesById
6037
}
61-
6238
export interface RootRouteChildren {
6339
IndexRoute: typeof IndexRoute
6440
}
6541

42+
declare module '@tanstack/react-router' {
43+
interface FileRoutesByPath {
44+
'/': {
45+
id: '/'
46+
path: '/'
47+
fullPath: '/'
48+
preLoaderRoute: typeof IndexRouteImport
49+
parentRoute: typeof rootRouteImport
50+
}
51+
}
52+
}
53+
6654
const rootRouteChildren: RootRouteChildren = {
6755
IndexRoute: IndexRoute,
6856
}
69-
70-
export const routeTree = rootRoute
57+
export const routeTree = rootRouteImport
7158
._addFileChildren(rootRouteChildren)
7259
._addFileTypes<FileRouteTypes>()
73-
74-
/* ROUTE_MANIFEST_START
75-
{
76-
"routes": {
77-
"__root__": {
78-
"filePath": "__root.tsx",
79-
"children": [
80-
"/"
81-
]
82-
},
83-
"/": {
84-
"filePath": "index.tsx"
85-
}
86-
}
87-
}
88-
ROUTE_MANIFEST_END */

examples/react/tanstack-start/app/routes/__root.tsx renamed to examples/react/tanstack-start/src/routes/__root.tsx

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
import {
2-
HeadContent,
3-
Outlet,
4-
Scripts,
5-
createRootRoute,
6-
} from '@tanstack/react-router'
7-
8-
import type { ReactNode } from 'react'
1+
import { HeadContent, Scripts, createRootRoute } from '@tanstack/react-router'
92

103
export const Route = createRootRoute({
114
head: () => ({
@@ -22,18 +15,10 @@ export const Route = createRootRoute({
2215
},
2316
],
2417
}),
25-
component: RootComponent,
18+
shellComponent: RootDocument,
2619
})
2720

28-
function RootComponent() {
29-
return (
30-
<RootDocument>
31-
<Outlet />
32-
</RootDocument>
33-
)
34-
}
35-
36-
function RootDocument({ children }: Readonly<{ children: ReactNode }>) {
21+
function RootDocument({ children }: { children: React.ReactNode }) {
3722
return (
3823
<html>
3924
<head>

examples/react/tanstack-start/app/routes/index.tsx renamed to examples/react/tanstack-start/src/routes/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { createFileRoute } from '@tanstack/react-router'
22
import { mergeForm, useForm, useTransform } from '@tanstack/react-form'
33
import { useStore } from '@tanstack/react-store'
4-
import { getFormDataFromServer, handleForm } from '~/utils/form'
5-
import { formOpts } from '~/utils/form-isomorphic'
4+
import { getFormDataFromServer, handleForm } from 'src/utils/form'
5+
import { formOpts } from 'src/utils/form-isomorphic'
66

77
export const Route = createFileRoute('/')({
88
component: Home,

0 commit comments

Comments
 (0)