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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/react/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
"@tanstack/react-devtools": "^0.6.1",
"@tanstack/react-query": "^5.83.0",
"@tanstack/react-query-devtools": "^5.83.0",
"@tanstack/react-router": "^1.130.2",
"@tanstack/react-router-devtools": "^1.130.2",
"@tanstack/react-router": "^1.131.2",
"@tanstack/react-router-devtools": "^1.131.2",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"zod": "^4.0.14"
},
"devDependencies": {
"@tanstack/devtools-ui": "0.3.4",
"@tanstack/devtools-vite": "0.2.11",
"@types/react": "^19.1.2",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "^4.5.2",
"vite": "^7.0.6",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/custom-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"react-dom": "^19.1.0"
},
"devDependencies": {
"@types/react": "^19.1.2",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "^4.5.2",
"vite": "^7.0.6"
Expand Down
20 changes: 20 additions & 0 deletions examples/react/drizzle/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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/

count.txt
4 changes: 4 additions & 0 deletions examples/react/drizzle/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/build
**/public
pnpm-lock.yaml
routeTree.gen.ts
72 changes: 72 additions & 0 deletions examples/react/drizzle/README.md
Original file line number Diff line number Diff line change
@@ -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!
11 changes: 11 additions & 0 deletions examples/react/drizzle/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'drizzle-kit'

export default defineConfig({
out: './drizzle',
dialect: 'postgresql',
dbCredentials: {
url: process.env.DATABASE_URL!,
},
strict: true,
verbose: true,
})
29 changes: 29 additions & 0 deletions examples/react/drizzle/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "tanstack-start-example-counter",
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"dev": "drizzle-kit studio & vite dev",
"start": "vite start"
},
"dependencies": {
"@tanstack/react-devtools": "^0.6.1",
"@tanstack/react-router": "^1.131.2",
"@tanstack/react-router-devtools": "^1.131.2",
"@tanstack/react-start": "^1.131.2",
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@tanstack/devtools-vite": "0.2.11",
"@types/node": "^22.15.2",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.2",
"drizzle-kit": "^0.31.4",
"drizzle-orm": "^0.44.4",
"pg": "^8.16.3",
"typescript": "5.8.3",
"vite": "^7.0.6"
}
}
59 changes: 59 additions & 0 deletions examples/react/drizzle/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* 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 { Route as rootRouteImport } from './routes/__root'
import { Route as IndexRouteImport } from './routes/index'

const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => rootRouteImport,
} as any)

export interface FileRoutesByFullPath {
'/': typeof IndexRoute
}
export interface FileRoutesByTo {
'/': typeof IndexRoute
}
export interface FileRoutesById {
__root__: typeof rootRouteImport
'/': typeof IndexRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/'
fileRoutesByTo: FileRoutesByTo
to: '/'
id: '__root__' | '/'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
}

declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/': {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
}
}

const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
}
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>()
17 changes: 17 additions & 0 deletions examples/react/drizzle/src/router.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { createRouter as createTanStackRouter } from '@tanstack/react-router'
import { routeTree } from './routeTree.gen'

export function createRouter() {
const router = createTanStackRouter({
routeTree,
scrollRestoration: true,
})

return router
}

declare module '@tanstack/react-router' {
interface Register {
router: ReturnType<typeof createRouter>
}
}
47 changes: 47 additions & 0 deletions examples/react/drizzle/src/routes/__root.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import * as React from 'react'
import {
HeadContent,
Outlet,
Scripts,
createRootRoute,
} from '@tanstack/react-router'

export const Route = createRootRoute({
head: () => ({
meta: [
{
charSet: 'utf-8',
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1',
},
{
title: 'TanStack Start Starter',
},
],
}),
component: RootComponent,
})

function RootComponent() {
return (
<RootDocument>
<Outlet />
</RootDocument>
)
}

function RootDocument({ children }: { children: React.ReactNode }) {
return (
<html>
<head>
<HeadContent />
</head>
<body style={{ margin: 0, padding: 0, height: '100vh' }}>
{children}
<Scripts />
</body>
</html>
)
}
39 changes: 39 additions & 0 deletions examples/react/drizzle/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { createFileRoute } from '@tanstack/react-router'
import { TanStackDevtools } from '@tanstack/react-devtools'
import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools'

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

function Home() {
return (
<div style={{ display: 'flex', flexDirection: 'column', height: '100vh' }}>
<h1 style={{ textAlign: 'center', width: '100%' }}>
Welcome to the Drizzle + TanStack Start example!
</h1>
<TanStackDevtools
plugins={[
{
name: 'TanStack Router',
render: () => <TanStackRouterDevtoolsPanel />,
},
{
name: 'Drizzle Studio',
render: () => (
<iframe
src="https://local.drizzle.studio"
style={{
flexGrow: 1,
width: '100%',
height: '100%',
border: 0,
}}
/>
),
},
]}
/>
</div>
)
}
22 changes: 22 additions & 0 deletions examples/react/drizzle/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"include": ["**/*.ts", "**/*.tsx"],
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"module": "ESNext",
"moduleResolution": "Bundler",
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"isolatedModules": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"target": "ES2022",
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
},
"noEmit": true
}
}
10 changes: 10 additions & 0 deletions examples/react/drizzle/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import { defineConfig } from 'vite'
import { devtools } from '@tanstack/devtools-vite'

export default defineConfig({
server: {
port: 3000,
},
plugins: [devtools() as any, tanstackStart()],
})
6 changes: 3 additions & 3 deletions examples/react/https/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
"@tanstack/react-devtools": "^0.6.1",
"@tanstack/react-query": "^5.83.0",
"@tanstack/react-query-devtools": "^5.83.0",
"@tanstack/react-router": "^1.130.2",
"@tanstack/react-router-devtools": "^1.130.2",
"@tanstack/react-router": "^1.131.2",
"@tanstack/react-router-devtools": "^1.131.2",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"zod": "^4.0.14"
},
"devDependencies": {
"@tanstack/devtools-ui": "0.3.4",
"@tanstack/devtools-vite": "0.2.11",
"@types/react": "^19.1.2",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "^4.5.2",
"vite": "^7.0.6",
Expand Down
Loading
Loading