Skip to content

Commit 1acc8ea

Browse files
authored
test: add cross-framework client navigation benchmarks (#6800)
1 parent c40bf25 commit 1acc8ea

74 files changed

Lines changed: 1015 additions & 37 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/bundle-size.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ jobs:
3535
uses: tanstack/config/.github/setup@main
3636

3737
- name: Measure Bundle Size
38-
run: pnpm nx run tanstack-router-e2e-bundle-size:build --outputStyle=stream --skipRemoteCache
38+
run: pnpm nx run @benchmarks/bundle-size:build --outputStyle=stream --skipRemoteCache
3939

4040
- name: Capture Benchmark Outputs
4141
id: capture
4242
run: |
4343
{
44-
echo "current_json_b64=$(base64 -w 0 < e2e/bundle-size/results/current.json)"
44+
echo "current_json_b64=$(base64 -w 0 < benchmarks/bundle-size/results/current.json)"
4545
} >> "$GITHUB_OUTPUT"
4646
4747
comment-pr:
@@ -63,27 +63,27 @@ jobs:
6363
env:
6464
CURRENT_JSON_B64: ${{ needs.benchmark-pr.outputs.current_json_b64 }}
6565
run: |
66-
mkdir -p e2e/bundle-size/results
67-
node -e "const fs=require('node:fs'); fs.writeFileSync('e2e/bundle-size/results/current.json', Buffer.from(process.env.CURRENT_JSON_B64 || '', 'base64'))"
66+
mkdir -p benchmarks/bundle-size/results
67+
node -e "const fs=require('node:fs'); fs.writeFileSync('benchmarks/bundle-size/results/current.json', Buffer.from(process.env.CURRENT_JSON_B64 || '', 'base64'))"
6868
6969
- name: Read Historical Data (if available)
7070
run: |
71-
mkdir -p e2e/bundle-size/results
71+
mkdir -p benchmarks/bundle-size/results
7272
if git fetch --depth=1 origin gh-pages; then
73-
if git show origin/gh-pages:benchmarks/bundle-size/data.js > e2e/bundle-size/results/history-data.js 2>/dev/null; then
73+
if git show origin/gh-pages:benchmarks/bundle-size/data.js > benchmarks/bundle-size/results/history-data.js 2>/dev/null; then
7474
echo "Loaded bundle-size history from gh-pages."
7575
else
76-
rm -f e2e/bundle-size/results/history-data.js
76+
rm -f benchmarks/bundle-size/results/history-data.js
7777
echo "No bundle-size history found on gh-pages yet."
7878
fi
7979
fi
8080
8181
- name: Build PR Report
8282
run: |
8383
node scripts/benchmarks/bundle-size/pr-report.mjs \
84-
--current e2e/bundle-size/results/current.json \
85-
--history e2e/bundle-size/results/history-data.js \
86-
--output e2e/bundle-size/results/pr-comment.md \
84+
--current benchmarks/bundle-size/results/current.json \
85+
--history benchmarks/bundle-size/results/history-data.js \
86+
--output benchmarks/bundle-size/results/pr-comment.md \
8787
--base-sha "${{ github.event.pull_request.base.sha }}" \
8888
--dashboard-url "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/benchmarks/bundle-size/"
8989
@@ -93,7 +93,7 @@ jobs:
9393
run: |
9494
node scripts/benchmarks/common/upsert-pr-comment.mjs \
9595
--pr "${{ github.event.pull_request.number }}" \
96-
--body-file e2e/bundle-size/results/pr-comment.md
96+
--body-file benchmarks/bundle-size/results/pr-comment.md
9797
9898
benchmark-main:
9999
name: Publish Bundle Size History
@@ -111,14 +111,14 @@ jobs:
111111
uses: tanstack/config/.github/setup@main
112112

113113
- name: Measure Bundle Size
114-
run: pnpm nx run tanstack-router-e2e-bundle-size:build --outputStyle=stream --skipRemoteCache
114+
run: pnpm nx run @benchmarks/bundle-size:build --outputStyle=stream --skipRemoteCache
115115

116116
- name: Publish Benchmark Dashboard
117117
uses: benchmark-action/github-action-benchmark@4bdcce38c94cec68da58d012ac24b7b1155efe8b # v1.20.7
118118
with:
119119
tool: customSmallerIsBetter
120120
name: Bundle Size (gzip)
121-
output-file-path: e2e/bundle-size/results/benchmark-action.json
121+
output-file-path: benchmarks/bundle-size/results/benchmark-action.json
122122
github-token: ${{ secrets.GITHUB_TOKEN }}
123123
auto-push: true
124124
gh-pages-branch: gh-pages
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Setup taken from https://codspeed.io/docs/benchmarks/nodejs/vitest
2+
name: Client Nav Benchmarks
3+
4+
on:
5+
push:
6+
branches:
7+
- 'main'
8+
pull_request:
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read # required for actions/checkout
13+
id-token: write # required for OIDC authentication with CodSpeed
14+
15+
env:
16+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
17+
SERVER_PRESET: 'node-server'
18+
19+
jobs:
20+
client-nav-benchmarks:
21+
name: Run Client Nav Benchmarks
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v6.0.1
26+
27+
- name: Setup Tools
28+
uses: tanstack/config/.github/setup@main
29+
30+
- name: Run CodSpeed benchmark for React
31+
continue-on-error: true
32+
uses: CodSpeedHQ/action@v4
33+
with:
34+
mode: simulation
35+
run: WITH_INSTRUMENTATION=1 pnpm nx run @benchmarks/client-nav:test:perf:react
36+
37+
- name: Run CodSpeed benchmark for Solid
38+
continue-on-error: true
39+
uses: CodSpeedHQ/action@v4
40+
with:
41+
mode: simulation
42+
run: WITH_INSTRUMENTATION=1 pnpm nx run @benchmarks/client-nav:test:perf:solid
43+
44+
- name: Run CodSpeed benchmark for Vue
45+
continue-on-error: true
46+
uses: CodSpeedHQ/action@v4
47+
with:
48+
mode: simulation
49+
run: WITH_INSTRUMENTATION=1 pnpm nx run @benchmarks/client-nav:test:perf:vue
Lines changed: 3 additions & 3 deletions
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "tanstack-router-e2e-bundle-size",
2+
"name": "@benchmarks/bundle-size",
33
"private": true,
44
"type": "module",
55
"scripts": {
@@ -14,16 +14,16 @@
1414
"react": "^19.0.0",
1515
"react-dom": "^19.0.0",
1616
"solid-js": "^1.9.10",
17-
"vue": "^3.5.25"
17+
"vue": "^3.5.16"
1818
},
1919
"devDependencies": {
2020
"@tanstack/router-plugin": "workspace:^",
2121
"@types/react": "^19.0.8",
2222
"@types/react-dom": "^19.0.3",
2323
"@vitejs/plugin-react": "^4.3.4",
24-
"@vitejs/plugin-vue": "^6.0.1",
24+
"@vitejs/plugin-vue": "^5.2.3",
2525
"@vitejs/plugin-vue-jsx": "^4.1.2",
26-
"typescript": "^5.9.3",
26+
"typescript": "^5.7.2",
2727
"vite": "^7.3.1",
2828
"vite-plugin-solid": "^2.11.10"
2929
}

e2e/bundle-size/scenarios/react-router-full/index.html renamed to benchmarks/bundle-size/scenarios/react-router-full/index.html

File renamed without changes.

e2e/bundle-size/scenarios/react-router-full/src/main.tsx renamed to benchmarks/bundle-size/scenarios/react-router-full/src/main.tsx

File renamed without changes.

e2e/bundle-size/scenarios/react-router-full/src/routes/__root.tsx renamed to benchmarks/bundle-size/scenarios/react-router-full/src/routes/__root.tsx

File renamed without changes.

e2e/bundle-size/scenarios/react-router-full/src/routes/index.tsx renamed to benchmarks/bundle-size/scenarios/react-router-full/src/routes/index.tsx

File renamed without changes.

0 commit comments

Comments
 (0)