-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
add react-start-query-integration bundlesize benchmark scenario #8153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { QueryClient } from '@tanstack/react-query' | ||
| import { createRouter } from '@tanstack/react-router' | ||
| import { setupRouterSsrQueryIntegration } from '@tanstack/react-router-ssr-query' | ||
| import { routeTree } from './routeTree.gen' | ||
|
|
||
| export function getRouter() { | ||
| const queryClient = new QueryClient() | ||
| const router = createRouter({ | ||
| routeTree, | ||
| context: { queryClient }, | ||
| scrollRestoration: true, | ||
| }) | ||
|
|
||
| setupRouterSsrQueryIntegration({ router, queryClient }) | ||
|
|
||
| return router | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { | ||
| HeadContent, | ||
| Outlet, | ||
| Scripts, | ||
| createRootRoute, | ||
| } from '@tanstack/react-router' | ||
|
|
||
| export const Route = createRootRoute({ | ||
| component: RootComponent, | ||
| }) | ||
|
|
||
| function RootComponent() { | ||
| return ( | ||
| <html> | ||
| <head> | ||
| <HeadContent /> | ||
| </head> | ||
| <body> | ||
| <Outlet /> | ||
| <Scripts /> | ||
| </body> | ||
| </html> | ||
| ) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { createFileRoute } from '@tanstack/react-router' | ||
|
|
||
| export const Route = createFileRoute('/')({ | ||
| component: IndexComponent, | ||
| }) | ||
|
|
||
| function IndexComponent() { | ||
| return <div>hello world</div> | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { defineConfig } from 'vite' | ||
| import viteReact from '@vitejs/plugin-react' | ||
| import { tanstackStart } from '@tanstack/react-start/plugin/vite' | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [tanstackStart(), viteReact()], | ||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ | |
| "react": "catalog:", | ||
| "react-dom": "catalog:", | ||
| "@tanstack/react-router": "workspace:*", | ||
| "@tanstack/react-query": ">=5.90.0", | ||
| "@tanstack/react-query": ">=5.102.0", | ||
| "vite": "*", | ||
| "@tanstack/vite-config": "catalog:", | ||
| "vitest": "catalog:", | ||
|
|
@@ -87,8 +87,8 @@ | |
| "peerDependencies": { | ||
| "react": ">=18.0.0 || >=19.0.0", | ||
| "react-dom": ">=18.0.0 || >=19.0.0", | ||
| "@tanstack/query-core": ">=5.90.0", | ||
| "@tanstack/query-core": ">=5.102.0", | ||
| "@tanstack/react-router": ">=1.127.0", | ||
| "@tanstack/react-query": ">=5.90.0" | ||
| "@tanstack/react-query": ">=5.102.0" | ||
|
Comment on lines
+90
to
+92
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
while IFS= read -r file; do
rg -n -C 2 '"`@tanstack/`(query-core|react-query|solid-query|vue-query)"' "$file" || true
done < <(fd -t f 'package\.json$')
lockfile="$(fd -t f 'pnpm-lock\.yaml$' | head -n 1 || true)"
if [ -n "$lockfile" ]; then
rg -n -C 2 '(`@tanstack/`(query-core|react-query|solid-query|vue-query)|5\.90\.0|5\.102\.0)' "$lockfile" || true
fiRepository: TanStack/router Length of output: 205 🏁 Script executed: set -euo pipefail
printf '%s\n' '--- package manifests ---'
git ls-files '*package.json' | while IFS= read -r file; do
if rg -q '"`@tanstack/`(query-core|react-query|solid-query|vue-query)"' "$file"; then
printf '\n[%s]\n' "$file"
rg -n -C 2 '"`@tanstack/`(query-core|react-query|solid-query|vue-query)"' "$file"
fi
done
printf '%s\n' '--- lockfiles ---'
git ls-files '*pnpm-lock.yaml' '*package-lock.json' '*yarn.lock' | while IFS= read -r file; do
printf '\n[%s]\n' "$file"
rg -n -C 2 '(`@tanstack/`(query-core|react-query|solid-query|vue-query)|5\.90\.0|5\.102\.0)' "$file" || true
doneRepository: TanStack/router Length of output: 50371 🏁 Script executed: set -euo pipefail
file='packages/react-router-ssr-query/package.json'
printf '%s\n' '--- target manifest ---'
cat -n "$file" | sed -n '60,105p'
printf '%s\n' '--- workspace configuration ---'
for file in pnpm-workspace.yaml package.json .github/workflows/*.yml .github/workflows/*.yaml; do
if [ -f "$file" ]; then
printf '\n[%s]\n' "$file"
cat -n "$file" | sed -n '1,220p'
fi
doneRepository: TanStack/router Length of output: 36107 🏁 Script executed: set -euo pipefail
printf '%s\n' '--- exact consumer constraints ---'
git ls-files '*package.json' | while IFS= read -r file; do
rg -n '"`@tanstack/`(query-core|react-query)"' "$file" && printf 'file=%s\n' "$file"
done
printf '%s\n' '--- lockfile package entries ---'
for file in $(git ls-files '*pnpm-lock.yaml'); do
printf '\n[%s]\n' "$file"
awk '
/(^|[^0-9])5\.(90\.0|102\.0)([^0-9]|$)/ || /@tanstack\/(query-core|react-query)/ {
start=NR-2; if (start<1) start=1
for (i=start; i<=NR+2; i++) wanted[i]=1
}
{ lines[NR]=$0 }
END {
for (i=1; i<=NR;i++) if (wanted[i]) print i ":" lines[i]
}
' "$file"
doneRepository: TanStack/router Length of output: 3898 Synchronize TanStack Query consumer constraints. Workspace manifests still specify 🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use
workspace:*for internal dependencies.The changed internal dependency entries on Lines 41-46 use
workspace:^. The repository guideline requiresworkspace:*. Change these entries to the required notation.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Coding guidelines