Skip to content

Commit

Permalink
fix: move to react-start (#3573)
Browse files Browse the repository at this point in the history
  • Loading branch information
schiller-manuel authored Feb 26, 2025
1 parent ab9c7f5 commit 71acc58
Show file tree
Hide file tree
Showing 127 changed files with 245 additions and 245 deletions.
8 changes: 4 additions & 4 deletions docs/router/framework/react/guide/ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ Non-Streaming server-side rendering is the classic process of rendering the mark

To implement non-streaming SSR with TanStack Router, you will need the following utilities:

- `StartServer` from `@tanstack/start/server`
- `StartServer` from `@tanstack/react-start/server`
- e.g. `<StartServer router={router} />`
- Rendering this component in your server entry will render your application and also automatically handle application-level hydration/dehydration and implement the `Wrap` component option on `Router`
- `StartClient` from `@tanstack/start`
- `StartClient` from `@tanstack/react-start`
- e.g. `<StartClient router={router} />`
- Rendering this component in your client entry will render your application and also automatically implement the `Wrap` component option on `Router`

Expand Down Expand Up @@ -142,7 +142,7 @@ Here is a complete example of a server entry file that uses all of the concepts
import * as React from 'react'
import ReactDOMServer from 'react-dom/server'
import { createMemoryHistory } from '@tanstack/react-router'
import { StartServer } from '@tanstack/start/server'
import { StartServer } from '@tanstack/react-start/server'
import { createRouter } from './router'

export async function render(url, response) {
Expand Down Expand Up @@ -179,7 +179,7 @@ On the client, things are much simpler.
import * as React from 'react'
import ReactDOM from 'react-dom/client'

import { StartClient } from '@tanstack/start'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'

const router = createRouter()
Expand Down
10 changes: 5 additions & 5 deletions docs/router/framework/react/guide/tanstack-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Then configure TanStack Start's `app.config.ts` file:

```typescript
// app.config.ts
import { defineConfig } from '@tanstack/start/config'
import { defineConfig } from '@tanstack/react-start/config'

export default defineConfig({})
```
Expand Down Expand Up @@ -159,8 +159,8 @@ information to our server entry point:
import {
createStartHandler,
defaultStreamHandler,
} from '@tanstack/start/server'
import { getRouterManifest } from '@tanstack/start/router-manifest'
} from '@tanstack/react-start/server'
import { getRouterManifest } from '@tanstack/react-start/router-manifest'

import { createRouter } from './router'

Expand All @@ -180,7 +180,7 @@ router information to our client entry point:
```tsx
// app/client.tsx
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/start'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'

const router = createRouter({
Expand Down Expand Up @@ -251,7 +251,7 @@ Now that we have the basic templating setup, we can write our first route. This
// app/routes/index.tsx
import * as fs from 'fs'
import { createFileRoute, useRouter } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/start'
import { createServerFn } from '@tanstack/react-start'

const filePath = 'count.txt'

Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/basic/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from '@tanstack/react-start/config'
import { defineConfig } from '@tanstack/start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/basic/app/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
createStartAPIHandler,
defaultAPIFileRouteHandler,
} from '@tanstack/react-start/api'
} from '@tanstack/start/api'

export default createStartAPIHandler(defaultAPIFileRouteHandler)
2 changes: 1 addition & 1 deletion e2e/react-start/basic/app/client.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="vinxi/types/client" />
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/react-start'
import { StartClient } from '@tanstack/start'
import { createRouter } from './router'

const router = createRouter()
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/basic/app/components/RedirectOnClick.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useServerFn } from '@tanstack/react-start'
import { useServerFn } from '@tanstack/start'
import { throwRedirect } from './throwRedirect'

interface RedirectOnClickProps {
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/basic/app/components/throwRedirect.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { redirect } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
import { createServerFn } from '@tanstack/start'

export const throwRedirect = createServerFn()
.validator(
Expand Down
4 changes: 2 additions & 2 deletions e2e/react-start/basic/app/routes/api.users.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { json } from '@tanstack/react-start'
import { createAPIFileRoute } from '@tanstack/react-start/api'
import { json } from '@tanstack/start'
import { createAPIFileRoute } from '@tanstack/start/api'
import axios from 'redaxios'

import type { User } from '~/utils/users'
Expand Down
4 changes: 2 additions & 2 deletions e2e/react-start/basic/app/routes/api/users.$id.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { json } from '@tanstack/react-start'
import { createAPIFileRoute } from '@tanstack/react-start/api'
import { json } from '@tanstack/start'
import { createAPIFileRoute } from '@tanstack/start/api'
import axios from 'redaxios'

import type { User } from '~/utils/users'
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/basic/app/routes/deferred.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Await, createFileRoute } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
import { createServerFn } from '@tanstack/start'
import { Suspense, useState } from 'react'

const personServerFn = createServerFn({ method: 'GET' })
Expand Down
4 changes: 2 additions & 2 deletions e2e/react-start/basic/app/ssr.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
createStartHandler,
defaultStreamHandler,
} from '@tanstack/react-start/server'
import { getRouterManifest } from '@tanstack/react-start/router-manifest'
} from '@tanstack/start/server'
import { getRouterManifest } from '@tanstack/start/router-manifest'

import { createRouter } from './router'

Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/basic/app/utils/posts.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { notFound } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/react-start'
import { createServerFn } from '@tanstack/start'
import axios from 'redaxios'

export type PostType = {
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@tanstack/react-router": "workspace:^",
"@tanstack/router-devtools": "workspace:^",
"@tanstack/react-start": "workspace:^",
"@tanstack/start": "workspace:^",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/basic-ssr-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@tanstack/react-router": "^1.111.11",
"@tanstack/router-devtools": "^1.111.11",
"@tanstack/router-plugin": "^1.111.11",
"@tanstack/start": "^1.111.11",
"@tanstack/react-start": "^1.111.11",
"get-port": "^7.1.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
4 changes: 2 additions & 2 deletions examples/react/basic-ssr-file-based/src/entry-client.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { hydrateRoot } from 'react-dom/client'

import { StartClient } from '@tanstack/start'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'

const router = createRouter()

hydrateRoot(document!, <StartClient router={router} />)
hydrateRoot(document, <StartClient router={router} />)
2 changes: 1 addition & 1 deletion examples/react/basic-ssr-file-based/src/entry-server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { pipeline } from 'node:stream/promises'
import {
createRequestHandler,
defaultStreamHandler,
} from '@tanstack/start/server'
} from '@tanstack/react-start/server'
import { createRouter } from './router'
import type express from 'express'
import './fetch-polyfill'
Expand Down
2 changes: 1 addition & 1 deletion examples/react/basic-ssr-streaming-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@tanstack/react-router": "^1.111.11",
"@tanstack/router-devtools": "^1.111.11",
"@tanstack/router-plugin": "^1.111.11",
"@tanstack/start": "^1.111.11",
"@tanstack/react-start": "^1.111.11",
"get-port": "^7.1.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { hydrateRoot } from 'react-dom/client'

import { StartClient } from '@tanstack/start'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'

const router = createRouter()

hydrateRoot(document!, <StartClient router={router} />)
hydrateRoot(document, <StartClient router={router} />)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
createRequestHandler,
defaultStreamHandler,
} from '@tanstack/start/server'
} from '@tanstack/react-start/server'
import { createRouter } from './router'
import type express from 'express'

Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-bare/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from '@tanstack/start/config'
import { defineConfig } from '@tanstack/react-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'
import tailwindcss from '@tailwindcss/vite'

Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-bare/app/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
createStartAPIHandler,
defaultAPIFileRouteHandler,
} from '@tanstack/start/api'
} from '@tanstack/react-start/api'

export default createStartAPIHandler(defaultAPIFileRouteHandler)
2 changes: 1 addition & 1 deletion examples/react/start-bare/app/client.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="vinxi/types/client" />
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/start'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'

const router = createRouter()
Expand Down
4 changes: 2 additions & 2 deletions examples/react/start-bare/app/ssr.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
createStartHandler,
defaultStreamHandler,
} from '@tanstack/start/server'
import { getRouterManifest } from '@tanstack/start/router-manifest'
} from '@tanstack/react-start/server'
import { getRouterManifest } from '@tanstack/react-start/router-manifest'

import { createRouter } from './router'

Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-bare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@tanstack/react-router": "^1.111.11",
"@tanstack/router-devtools": "^1.111.11",
"@tanstack/start": "^1.111.11",
"@tanstack/react-start": "^1.111.11",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"vinxi": "0.5.3",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-basic-auth/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from '@tanstack/start/config'
import { defineConfig } from '@tanstack/react-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
Expand Down
4 changes: 2 additions & 2 deletions examples/react/start-basic-auth/app/client.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="vinxi/types/client" />
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/start'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'

const router = createRouter()

hydrateRoot(document!, <StartClient router={router} />)
hydrateRoot(document, <StartClient router={router} />)
2 changes: 1 addition & 1 deletion examples/react/start-basic-auth/app/components/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useRouter } from '@tanstack/react-router'
import { useServerFn } from '@tanstack/start'
import { useServerFn } from '@tanstack/react-start'
import { useMutation } from '../hooks/useMutation'
import { loginFn } from '../routes/_authed'
import { Auth } from './Auth'
Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-basic-auth/app/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
createRootRoute,
} from '@tanstack/react-router'
import { TanStackRouterDevtools } from '@tanstack/router-devtools'
import { createServerFn } from '@tanstack/start'
import { createServerFn } from '@tanstack/react-start'
import * as React from 'react'
import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary.js'
import { NotFound } from '~/components/NotFound.js'
Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-basic-auth/app/routes/_authed.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/start'
import { createServerFn } from '@tanstack/react-start'
import { hashPassword, prismaClient } from '~/utils/prisma'
import { Login } from '~/components/Login'
import { useAppSession } from '~/utils/session'
Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-basic-auth/app/routes/logout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/start'
import { createServerFn } from '@tanstack/react-start'
import { useAppSession } from '~/utils/session'

const logoutFn = createServerFn().handler(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-basic-auth/app/routes/signup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { createServerFn, useServerFn } from '@tanstack/start'
import { createServerFn, useServerFn } from '@tanstack/react-start'
import { hashPassword, prismaClient } from '~/utils/prisma'
import { useMutation } from '~/hooks/useMutation'
import { Auth } from '~/components/Auth'
Expand Down
4 changes: 2 additions & 2 deletions examples/react/start-basic-auth/app/ssr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import {
createStartHandler,
defaultStreamHandler,
} from '@tanstack/start/server'
import { getRouterManifest } from '@tanstack/start/router-manifest'
} from '@tanstack/react-start/server'
import { getRouterManifest } from '@tanstack/react-start/router-manifest'

import { createRouter } from './router'

Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-basic-auth/app/utils/posts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { notFound } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/start'
import { createServerFn } from '@tanstack/react-start'
import axios from 'redaxios'

export type PostType = {
Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-basic-auth/app/utils/session.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// app/services/session.server.ts
import { useSession } from '@tanstack/start/server'
import { useSession } from '@tanstack/react-start/server'
import type { User } from '@prisma/client'

type SessionUser = {
Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-basic-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@prisma/client": "5.22.0",
"@tanstack/react-router": "^1.111.11",
"@tanstack/router-devtools": "^1.111.11",
"@tanstack/start": "^1.111.11",
"@tanstack/react-start": "^1.111.11",
"prisma": "^5.22.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-basic-react-query/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from '@tanstack/start/config'
import { defineConfig } from '@tanstack/react-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion examples/react/start-basic-react-query/app/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
createStartAPIHandler,
defaultAPIFileRouteHandler,
} from '@tanstack/start/api'
} from '@tanstack/react-start/api'

export default createStartAPIHandler(defaultAPIFileRouteHandler)
4 changes: 2 additions & 2 deletions examples/react/start-basic-react-query/app/client.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="vinxi/types/client" />
import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/start'
import { StartClient } from '@tanstack/react-start'
import { createRouter } from './router'

const router = createRouter()

hydrateRoot(document!, <StartClient router={router} />)
hydrateRoot(document, <StartClient router={router} />)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { json } from '@tanstack/start'
import { createAPIFileRoute } from '@tanstack/start/api'
import { json } from '@tanstack/react-start'
import { createAPIFileRoute } from '@tanstack/react-start/api'
import axios from 'redaxios'
import type { User } from '../utils/users'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { json } from '@tanstack/start'
import { createAPIFileRoute } from '@tanstack/start/api'
import { json } from '@tanstack/react-start'
import { createAPIFileRoute } from '@tanstack/react-start/api'
import axios from 'redaxios'
import type { User } from '../../utils/users'

Expand Down
4 changes: 2 additions & 2 deletions examples/react/start-basic-react-query/app/ssr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import {
createStartHandler,
defaultStreamHandler,
} from '@tanstack/start/server'
import { getRouterManifest } from '@tanstack/start/router-manifest'
} from '@tanstack/react-start/server'
import { getRouterManifest } from '@tanstack/react-start/router-manifest'

import { createRouter } from './router'

Expand Down
Loading

0 comments on commit 71acc58

Please sign in to comment.