Skip to content

Commit

Permalink
Merge branch 'main' into codesplitting-retain-default-exports
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanCassiere committed Sep 15, 2024
2 parents a50bb7a + b604f07 commit cf3d8d1
Show file tree
Hide file tree
Showing 59 changed files with 2,061 additions and 2,762 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Tools
uses: tanstack/config/.github/setup@main
- name: Get base and head commits for `nx affected`
uses: nrwl/nx-set-shas@v4.0.6
uses: nrwl/nx-set-shas@v4.1.0
with:
main-branch-name: main
- name: Run Checks
Expand Down
11 changes: 7 additions & 4 deletions docs/framework/react/start/server-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,11 @@ Server functions can throw a `redirect` error to redirect the user to a differen
- During SSR, redirects are handled by sending a 302 response to the client with the new location
- On the client, redirects are handled by the router automatically from within a route lifecycle or a component that uses the `useServerFn` hook. If you call a server function from anywhere else, redirects will not be handled automatically.

To throw a redirect, you can use the `redirect` function exported from the `@tanstack/start` package:
To throw a redirect, you can use the `redirect` function exported from the `@tanstack/react-router` package:

```tsx
import { createServerFn, redirect } from '@tanstack/start'
import { redirect } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/start'

export const doStuff = createServerFn('GET', async () => {
// Redirect the user to the home page
Expand All @@ -365,7 +366,8 @@ Redirects can utilize all of the same options as `router.navigate`, `useNavigate
Redirects can also set the status code of the response by passing a `status` option:

```tsx
import { createServerFn, redirect } from '@tanstack/start'
import { redirect } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/start'

export const doStuff = createServerFn('GET', async () => {
// Redirect the user to the home page with a 301 status code
Expand All @@ -383,7 +385,8 @@ export const doStuff = createServerFn('GET', async () => {
You can also set custom headers on a redirect by passing a `headers` option:

```tsx
import { createServerFn, redirect } from '@tanstack/start'
import { redirect } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/start'

export const doStuff = createServerFn('GET', async () => {
// Redirect the user to the home page with a custom header
Expand Down
8 changes: 4 additions & 4 deletions examples/react/authenticated-routes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"start": "vite"
},
"dependencies": {
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/router-plugin": "^1.57.13",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"@tanstack/router-plugin": "^1.57.15",
"immer": "^10.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -22,6 +22,6 @@
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.3.5"
"vite": "^5.4.5"
}
}
8 changes: 4 additions & 4 deletions examples/react/basic-default-search-params/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"start": "vite"
},
"dependencies": {
"@tanstack/react-query": "^5.51.21",
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/react-query": "^5.56.2",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"redaxios": "^0.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -21,6 +21,6 @@
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.3.5"
"vite": "^5.4.5"
}
}
8 changes: 4 additions & 4 deletions examples/react/basic-file-based-codesplitting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"start": "vite"
},
"dependencies": {
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/router-plugin": "^1.57.13",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"@tanstack/router-plugin": "^1.57.15",
"immer": "^10.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -22,6 +22,6 @@
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.3.5"
"vite": "^5.4.5"
}
}
10 changes: 5 additions & 5 deletions examples/react/basic-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
"test:e2e": "playwright test --project=chromium"
},
"dependencies": {
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/router-plugin": "^1.57.13",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"@tanstack/router-plugin": "^1.57.15",
"immer": "^10.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redaxios": "^0.5.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@playwright/test": "^1.46.1",
"@playwright/test": "^1.47.1",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.3.5"
"vite": "^5.4.5"
}
}
14 changes: 7 additions & 7 deletions examples/react/basic-react-query-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
"test:e2e": "playwright test --project=chromium"
},
"dependencies": {
"@tanstack/react-query": "^5.51.21",
"@tanstack/react-query-devtools": "^5.51.21",
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/router-plugin": "^1.57.13",
"@tanstack/react-query": "^5.56.2",
"@tanstack/react-query-devtools": "^5.56.2",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"@tanstack/router-plugin": "^1.57.15",
"immer": "^10.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redaxios": "^0.5.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@playwright/test": "^1.46.1",
"@playwright/test": "^1.47.1",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.3.5"
"vite": "^5.4.5"
}
}
12 changes: 6 additions & 6 deletions examples/react/basic-react-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
"test:e2e": "playwright test --project=chromium"
},
"dependencies": {
"@tanstack/react-query": "^5.51.21",
"@tanstack/react-query-devtools": "^5.51.21",
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/react-query": "^5.56.2",
"@tanstack/react-query-devtools": "^5.56.2",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redaxios": "^0.5.1"
},
"devDependencies": {
"@playwright/test": "^1.46.1",
"@playwright/test": "^1.47.1",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.3.5"
"vite": "^5.4.5"
}
}
18 changes: 9 additions & 9 deletions examples/react/basic-ssr-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@
"debug": "node --inspect-brk server"
},
"dependencies": {
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/router-plugin": "^1.57.13",
"@tanstack/start": "^1.57.13",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"@tanstack/router-plugin": "^1.57.15",
"@tanstack/start": "^1.57.15",
"get-port": "^7.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redaxios": "^0.5.1"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/generator": "^7.25.0",
"@babel/generator": "^7.25.6",
"@rollup/plugin-babel": "^6.0.4",
"@types/express": "^4.17.21",
"@vitejs/plugin-react": "^4.3.1",
"compression": "^1.7.4",
"express": "^4.19.2",
"isbot": "^5.1.14",
"express": "^4.21.0",
"isbot": "^5.1.17",
"node-fetch": "^3.3.2",
"serve-static": "^1.15.0",
"vite": "^5.3.5",
"serve-static": "^1.16.2",
"vite": "^5.4.5",
"vite-plugin-babel": "^1.2.0"
}
}
18 changes: 9 additions & 9 deletions examples/react/basic-ssr-streaming-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"debug": "node --inspect-brk server"
},
"dependencies": {
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/router-plugin": "^1.57.13",
"@tanstack/start": "^1.57.13",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"@tanstack/router-plugin": "^1.57.15",
"@tanstack/start": "^1.57.15",
"get-port": "^7.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -23,16 +23,16 @@
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/generator": "^7.25.0",
"@babel/generator": "^7.25.6",
"@rollup/plugin-babel": "^6.0.4",
"@types/express": "^4.17.21",
"@vitejs/plugin-react": "^4.3.1",
"compression": "^1.7.4",
"express": "^4.19.2",
"isbot": "^5.1.14",
"express": "^4.21.0",
"isbot": "^5.1.17",
"node-fetch": "^3.3.2",
"serve-static": "^1.15.0",
"vite": "^5.3.5",
"serve-static": "^1.16.2",
"vite": "^5.4.5",
"vite-plugin-babel": "^1.2.0"
}
}
10 changes: 5 additions & 5 deletions examples/react/basic-virtual-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"test:e2e": "playwright test --project=chromium"
},
"dependencies": {
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/router-plugin": "^1.57.13",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"@tanstack/router-plugin": "^1.57.15",
"@tanstack/virtual-file-routes": "^1.56.0",
"immer": "^10.1.1",
"react": "^18.2.0",
Expand All @@ -21,10 +21,10 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@playwright/test": "^1.46.1",
"@playwright/test": "^1.47.1",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.3.5"
"vite": "^5.4.5"
}
}
10 changes: 5 additions & 5 deletions examples/react/basic-virtual-inside-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"start": "vite"
},
"dependencies": {
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/router-plugin": "^1.57.13",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"@tanstack/router-plugin": "^1.57.15",
"@tanstack/virtual-file-routes": "^1.56.0",
"immer": "^10.1.1",
"react": "^18.2.0",
Expand All @@ -20,10 +20,10 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@playwright/test": "^1.46.1",
"@playwright/test": "^1.47.1",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.3.5"
"vite": "^5.4.5"
}
}
8 changes: 4 additions & 4 deletions examples/react/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
"test:e2e": "playwright test --project=chromium"
},
"dependencies": {
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redaxios": "^0.5.1"
},
"devDependencies": {
"@playwright/test": "^1.46.1",
"@playwright/test": "^1.47.1",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.3.5"
"vite": "^5.4.5"
}
}
6 changes: 3 additions & 3 deletions examples/react/deferred-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"start": "vite"
},
"dependencies": {
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"redaxios": "^0.5.1",
"immer": "^10.1.1",
"react": "^18.2.0",
Expand All @@ -21,6 +21,6 @@
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.3.5"
"vite": "^5.4.5"
}
}
8 changes: 4 additions & 4 deletions examples/react/kitchen-sink-file-based/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"start": "vite"
},
"dependencies": {
"@tanstack/react-router": "^1.57.13",
"@tanstack/router-devtools": "^1.57.13",
"@tanstack/router-plugin": "^1.57.13",
"@tanstack/react-router": "^1.57.15",
"@tanstack/router-devtools": "^1.57.15",
"@tanstack/router-plugin": "^1.57.15",
"immer": "^10.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -22,6 +22,6 @@
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.3.5"
"vite": "^5.4.5"
}
}
Loading

0 comments on commit cf3d8d1

Please sign in to comment.