Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
283 commits
Select commit Hold shift + click to select a range
af0cd98
Revert "fix: do not pre-decodeURI before passing to createMemoryHisto…
schiller-manuel Aug 8, 2025
2ad7079
run e2e test via srvx
schiller-manuel Aug 8, 2025
beafcbd
adapt custom server entry to fetch API interface
schiller-manuel Aug 8, 2025
fa7a554
don't reexport invariant/warning
schiller-manuel Aug 8, 2025
9c7ce78
fix lint
schiller-manuel Aug 8, 2025
adaf70f
add missing dep
schiller-manuel Aug 8, 2025
7084afd
bump vitest
schiller-manuel Aug 8, 2025
f5a99c0
fix lockfile
schiller-manuel Aug 8, 2025
93afcca
add wait for networkidle
nlynzaad Aug 9, 2025
5cb5779
update e2e-tests
nlynzaad Aug 9, 2025
c817100
ci: apply automated fixes
autofix-ci[bot] Aug 9, 2025
f436579
Merge remote-tracking branch 'origin/main' into HEAD
schiller-manuel Aug 9, 2025
ee22571
export ResponseHeaderName and RequestHeaderName
nlynzaad Aug 9, 2025
df1e08b
update test to use new Header type exports
nlynzaad Aug 9, 2025
28c7ce9
ci: apply automated fixes
autofix-ci[bot] Aug 9, 2025
29b8b0c
docs
schiller-manuel Aug 9, 2025
e71485a
fix solid test
schiller-manuel Aug 9, 2025
79a96a8
fix response handling
schiller-manuel Aug 9, 2025
febedde
fix packages
schiller-manuel Aug 9, 2025
cc4c4bd
remove externals
schiller-manuel Aug 11, 2025
4398f04
fix snapshots
schiller-manuel Aug 11, 2025
9b783bd
rename getWebRequest to getRequest
schiller-manuel Aug 11, 2025
bf51a52
fix packages
schiller-manuel Aug 11, 2025
73499fb
fix e2e test
schiller-manuel Aug 11, 2025
4695e16
fix e2e test
schiller-manuel Aug 11, 2025
c0f6a35
remove unused exports
schiller-manuel Aug 11, 2025
871aa82
fix example
schiller-manuel Aug 11, 2025
cd112e0
update clerk usage
schiller-manuel Aug 11, 2025
ae4c98f
response status / statusText handling for server functions
schiller-manuel Aug 11, 2025
afd0ec3
respect base path for client entry script
schiller-manuel Aug 11, 2025
6f923a0
fix lint
schiller-manuel Aug 12, 2025
162edce
allow to explicitly configure whether to install dev server middleware
schiller-manuel Aug 12, 2025
d5b4c3b
remove unused dep
schiller-manuel Aug 12, 2025
e77e817
use custom server in e2e examples
schiller-manuel Aug 12, 2025
dce7270
ignore type error
schiller-manuel Aug 12, 2025
82f309b
release: v1.121.0-alpha.28
tannerlinsley Aug 12, 2025
4266be9
release: v1.132.0-alpha.0
tannerlinsley Aug 12, 2025
11e6af2
fix optimizeDeps
schiller-manuel Aug 13, 2025
1c2977c
release: v1.132.0-alpha.1
tannerlinsley Aug 13, 2025
bcfe15e
Merge remote-tracking branch 'origin/main' into HEAD
schiller-manuel Aug 16, 2025
39fc80d
release: v1.132.0-alpha.2
tannerlinsley Aug 16, 2025
0383286
Merge remote-tracking branch 'origin/main' into HEAD
schiller-manuel Aug 16, 2025
b8af575
enhance relative navigation from determination
nlynzaad Aug 17, 2025
c53266f
update react-router tests
nlynzaad Aug 17, 2025
9e1b1dd
some more test refining
nlynzaad Aug 17, 2025
55ba9af
code cleanup
nlynzaad Aug 17, 2025
ba524f1
test cleanup
nlynzaad Aug 17, 2025
745107c
replicate changes to Solid
nlynzaad Aug 17, 2025
b4d41f8
update docs
nlynzaad Aug 17, 2025
44ad37c
ci: apply automated fixes
autofix-ci[bot] Aug 17, 2025
d5701da
Merge branch 'main' into relative-routing-to-current-location
nlynzaad Aug 17, 2025
e0b8814
resolve merge issue
nlynzaad Aug 17, 2025
0c9b67a
apply code rabbit suggestions
nlynzaad Aug 17, 2025
983b7ce
Merge branch 'main' into relative-routing-to-current-location
nlynzaad Aug 17, 2025
723540c
ci: apply automated fixes
autofix-ci[bot] Aug 17, 2025
944af34
apply code rabbit doc suggestion
nlynzaad Aug 17, 2025
f5c5559
apply code rabbit doc suggestion
nlynzaad Aug 17, 2025
8fec1d3
don't check whether $_TSR global is undefined
schiller-manuel Aug 17, 2025
0ae150e
reactivity and code cleanup
nlynzaad Aug 17, 2025
ad7eea5
ci: apply automated fixes
autofix-ci[bot] Aug 17, 2025
a75e191
custom transformers
schiller-manuel Aug 17, 2025
f82aaab
example usage
schiller-manuel Aug 17, 2025
43c01fb
rename
schiller-manuel Aug 18, 2025
e459efd
don't duplicate test fixture in e2e tests
schiller-manuel Aug 18, 2025
6959929
use env var for server fn base
schiller-manuel Aug 18, 2025
1158731
add e2e test
schiller-manuel Aug 18, 2025
9bb12fc
clean up example
schiller-manuel Aug 18, 2025
29df9cb
move client server function handling into start-client-core
schiller-manuel Aug 18, 2025
8f41f21
cleanup tests
nlynzaad Aug 18, 2025
de884b8
consolidate from logic
nlynzaad Aug 19, 2025
d3391ea
Merge branch 'main' into relative-routing-to-current-location
nlynzaad Aug 19, 2025
8feb3c0
revert change to SolidJS useNavigate
nlynzaad Aug 19, 2025
452f876
ci: apply automated fixes
autofix-ci[bot] Aug 19, 2025
41481f7
Merge branch 'main' into relative-routing-to-current-location
nlynzaad Aug 19, 2025
ab6f27b
rersolve inconsistency between solid and react implementation
nlynzaad Aug 19, 2025
3d93911
ci: apply automated fixes
autofix-ci[bot] Aug 19, 2025
87d51b9
formatting
nlynzaad Aug 19, 2025
29dfcf9
refactor based on coderabbit recommendations
nlynzaad Aug 19, 2025
9c46060
ci: apply automated fixes
autofix-ci[bot] Aug 19, 2025
3e66462
resolve test failure
nlynzaad Aug 19, 2025
0bcb4d2
re-export createClientRpc
schiller-manuel Aug 20, 2025
4d205d7
move createServerRpc into start-server-core
schiller-manuel Aug 20, 2025
4f4d34d
use seroval for serverfunctions
schiller-manuel Aug 20, 2025
1ab8d26
Merge remote-tracking branch 'origin/main' into HEAD
schiller-manuel Aug 20, 2025
004b328
whitelist expected errors
schiller-manuel Aug 20, 2025
7f0cc20
Merge remote-tracking branch 'origin/custom-transformers' into HEAD
schiller-manuel Aug 20, 2025
6524f53
release: v1.132.0-alpha.3
tannerlinsley Aug 20, 2025
adf7fe5
add symbol to identify server functions
schiller-manuel Aug 20, 2025
eb62ff6
only stream server function response if necessary
schiller-manuel Aug 20, 2025
453e7cd
ci: apply automated fixes
autofix-ci[bot] Aug 20, 2025
769490a
custom error serialization in server functions
schiller-manuel Aug 21, 2025
c3258bf
fix: scroll restoration on the server
schiller-manuel Aug 21, 2025
6978066
use correct fallback key
schiller-manuel Aug 21, 2025
22ad997
fix ScriptOnce to cleanup after itself
schiller-manuel Aug 21, 2025
117aac7
move start-compiler plugin into separate folder
schiller-manuel Aug 21, 2025
735b303
formatter & lint
schiller-manuel Aug 21, 2025
a1f37a8
allow dynamic scrollRestoration config
schiller-manuel Aug 21, 2025
805b1d3
fix tests
schiller-manuel Aug 22, 2025
517ab4a
release: v1.132.0-alpha.4
tannerlinsley Aug 22, 2025
191e442
fix: use separate output directories for client and server (#5000)
jamesopstad Aug 22, 2025
5451683
release: v1.132.0-alpha.5
tannerlinsley Aug 22, 2025
7503cd1
fix: change plugin config (#5012)
schiller-manuel Aug 22, 2025
dd2d3ca
release: v1.132.0-alpha.6
tannerlinsley Aug 22, 2025
02276b1
refactor: start compiler (#5014)
schiller-manuel Aug 23, 2025
9383fd9
release: v1.132.0-alpha.7
tannerlinsley Aug 23, 2025
9a4efc6
"serialization rulez"
chorobin Aug 24, 2025
b54d056
"serialization rulez" second attempt
chorobin Aug 24, 2025
e77f446
"serialization rulez"??
chorobin Aug 24, 2025
a23e6c9
"serialization rulez" beforeLoad
chorobin Aug 24, 2025
508ee37
Merge branch 'main' into relative-routing-to-current-location
nlynzaad Aug 26, 2025
7c40453
Revert "Revert "fix: do not pre-decodeURI before passing to createMem…
tannerlinsley Aug 26, 2025
d56aa42
Merge branch 'relative-routing-to-current-location' into alpha
nlynzaad Aug 26, 2025
c145e39
serialization pls
chorobin Aug 27, 2025
568c485
tests and linting
chorobin Aug 27, 2025
3a581a2
fix adapters
chorobin Aug 27, 2025
3bedacd
add adapter default
chorobin Aug 27, 2025
8b67f2f
fix default adapters
chorobin Aug 28, 2025
581f1e5
tests and examples fixed
chorobin Aug 28, 2025
6ae12bf
allow reponse/formdata
chorobin Aug 28, 2025
881ca83
allow reponse/formdata reverted
chorobin Aug 28, 2025
b7b68b9
fix(router-generator): Add path check for custom generatedRouteTree f…
nlynzaad Aug 28, 2025
840d280
release: v1.132.0-alpha.8
tannerlinsley Aug 28, 2025
bbfab37
feat: serverfn abstraction (#5040)
schiller-manuel Aug 29, 2025
55c7be5
release: v1.132.0-alpha.9
tannerlinsley Aug 29, 2025
30ad7f6
feat: allow composability of server function factories and middleware…
schiller-manuel Aug 30, 2025
6658f75
release: v1.132.0-alpha.10
tannerlinsley Aug 30, 2025
47f897b
fix: make middleware types compatible (#5056)
schiller-manuel Aug 30, 2025
5f1a1c7
release: v1.132.0-alpha.11
tannerlinsley Aug 30, 2025
0b7db2f
fix: check return type of router.dehydrate w.r.t. serializability (#5…
schiller-manuel Aug 31, 2025
83962e5
release: v1.132.0-alpha.12
tannerlinsley Aug 31, 2025
2356eff
merge #5037 into alpha
nlynzaad Aug 31, 2025
483bd7d
fix: optimizeDeps (#5060)
schiller-manuel Aug 31, 2025
852b50f
release: v1.132.0-alpha.13
tannerlinsley Aug 31, 2025
a258fc6
add form data only when post
chorobin Aug 31, 2025
19dc631
fix: vite plugin (#5064)
schiller-manuel Sep 1, 2025
d6867b6
release: v1.132.0-alpha.14
tannerlinsley Sep 1, 2025
983ff87
feat: url rewrites (#5058)
schiller-manuel Sep 3, 2025
379ca0c
release: v1.132.0-alpha.15
tannerlinsley Sep 3, 2025
7bcc4c9
replicate #5081 to alpha
nlynzaad Sep 4, 2025
f356452
feat: Add `server-entry` export to `@tanstack/react-start` (#5083)
jamesopstad Sep 4, 2025
92c214c
release: v1.132.0-alpha.16
tannerlinsley Sep 4, 2025
e0b3231
fix: Simplify `resolve` and `optimizeDeps` configuration (#5079)
jamesopstad Sep 4, 2025
c1ac2ef
release: v1.132.0-alpha.17
tannerlinsley Sep 4, 2025
223570e
fix(react-router, solid-router) - useParams should only be concerned …
nlynzaad Sep 7, 2025
dcefdf5
fix: Move initial route generation into `configResolved` (#5110)
jamesopstad Sep 9, 2025
96dd101
release: v1.132.0-alpha.18
tannerlinsley Sep 9, 2025
bb91885
fix(router-core): parse _strictParams - alpha (#5121)
nlynzaad Sep 11, 2025
8588da0
release: v1.132.0-alpha.19
tannerlinsley Sep 11, 2025
ca3c0e7
test(e2e): add waitForURL to some tests
nlynzaad Sep 11, 2025
41ac0f2
fix(router-core): params.parse should run as minimally as possible - …
nlynzaad Sep 11, 2025
08ce501
release: v1.132.0-alpha.20
tannerlinsley Sep 11, 2025
69a7c1e
test(e2e): resolve missing waitForUrls
nlynzaad Sep 11, 2025
f82a9a4
fix(router-core): _strictParams and path defining characters - alpha …
nlynzaad Sep 11, 2025
21675ef
release: v1.132.0-alpha.21
tannerlinsley Sep 11, 2025
d9772ab
fix: do not try to load external modules when compiling server functi…
schiller-manuel Sep 12, 2025
0b40553
release: v1.132.0-alpha.22
tannerlinsley Sep 12, 2025
fdd00e9
feat: add experimental nitro-v2-vite-plugin (#5143)
schiller-manuel Sep 12, 2025
9525224
release: v1.132.0-alpha.23
tannerlinsley Sep 12, 2025
9e665f1
docs(router): Small typo (#5147)
hokkyss Sep 16, 2025
89b00ad
fix(router-core): Non-nested paths - alpha (#5170)
nlynzaad Sep 18, 2025
0c2fb02
release: v1.132.0-alpha.24
tannerlinsley Sep 18, 2025
474aa7f
docs: update Netlify docs for changes on `alpha` (#5172)
serhalp Sep 21, 2025
2161185
fix(router-core): Non nested paths - only strip trailing underscore o…
nlynzaad Sep 22, 2025
88d0121
release: v1.132.0-alpha.25
tannerlinsley Sep 22, 2025
accc619
init
tannerlinsley Sep 23, 2025
a082460
check
tannerlinsley Sep 23, 2025
d978711
check
tannerlinsley Sep 23, 2025
e64f5f9
check
tannerlinsley Sep 23, 2025
efc2a4e
fix: types
tannerlinsley Sep 23, 2025
d384dbd
refactor server route context
tannerlinsley Sep 23, 2025
014a60d
server routes: infer send context from methods
tannerlinsley Sep 23, 2025
49cc06f
kinda works
tannerlinsley Sep 23, 2025
846ce96
add e2e test for server context
schiller-manuel Sep 23, 2025
a2c8f40
default middleware to type `request`
schiller-manuel Sep 23, 2025
f1a92fa
pass in additional context into beforeLoad and loader
schiller-manuel Sep 23, 2025
d26d27a
remove compiler for createServerFileRoute
schiller-manuel Sep 23, 2025
f398826
relax node deletion config in router-plugin
schiller-manuel Sep 23, 2025
92ad794
runtime and generator for unified route tree
schiller-manuel Sep 23, 2025
1f9892f
fix server-context e2e
schiller-manuel Sep 23, 2025
d94a950
update docs
schiller-manuel Sep 23, 2025
8991601
fix warning
schiller-manuel Sep 23, 2025
5c6b644
fix e2e test
schiller-manuel Sep 23, 2025
4f63a75
comment out type test for now
schiller-manuel Sep 23, 2025
b7629ba
ci: apply automated fixes
autofix-ci[bot] Sep 23, 2025
89f3842
move to new server route syntax
schiller-manuel Sep 23, 2025
0f3d753
add dummy test so the absence of tests does not cause it to fail
schiller-manuel Sep 23, 2025
d16aa5a
ci: apply automated fixes
autofix-ci[bot] Sep 23, 2025
9847675
remove explicit 'request' type from `createMiddleware` usage
schiller-manuel Sep 23, 2025
35a4e83
ci: apply automated fixes
autofix-ci[bot] Sep 23, 2025
0e7a4cb
moved server route types to start-client-core
schiller-manuel Sep 23, 2025
876c499
createStart, global middleware runtime
schiller-manuel Sep 23, 2025
33788ee
nonce preparation
schiller-manuel Sep 23, 2025
32c5880
remove router from middleware types
schiller-manuel Sep 23, 2025
52e67cd
expose getRouterInstance
schiller-manuel Sep 23, 2025
6e2a302
fix serialization adapters handling
schiller-manuel Sep 23, 2025
ac0451d
fix e2e test
schiller-manuel Sep 23, 2025
e510125
move from router.tsx to start.tsx
schiller-manuel Sep 23, 2025
268d7dd
formatting
schiller-manuel Sep 23, 2025
ce653c9
run generator
schiller-manuel Sep 23, 2025
3e06b15
fix lint
schiller-manuel Sep 23, 2025
48f0da4
Only allow serializationAdapters and defaultSsr via createRouterConfig()
tannerlinsley Sep 23, 2025
97d1b9e
type fix
tannerlinsley Sep 23, 2025
8d2b61f
fix type registration
schiller-manuel Sep 23, 2025
8e0a176
broken
schiller-manuel Sep 23, 2025
eb12a17
separate client and server stuff
schiller-manuel Sep 23, 2025
03beb73
fix request context types
schiller-manuel Sep 23, 2025
05db302
ScriptOnce uses nonce
schiller-manuel Sep 23, 2025
680b940
resolve files relative to srcDirectory
schiller-manuel Sep 23, 2025
d0f7ed7
formatting
schiller-manuel Sep 23, 2025
556b05c
use same virtual module on the server for start entry
schiller-manuel Sep 23, 2025
967a439
ci: apply automated fixes
autofix-ci[bot] Sep 23, 2025
de0f96b
Add server request context types to middleware server context
tannerlinsley Sep 23, 2025
b64caa2
checkpoint
tannerlinsley Sep 23, 2025
febd520
Punted on global middleware types and cleaned up start-basic example
tannerlinsley Sep 23, 2025
3d644ca
checkpoint
tannerlinsley Sep 23, 2025
fe24dc1
chore: update server-routes docs
jherr Sep 23, 2025
57d182a
chore: fix creatHandlers documentation
jherr Sep 23, 2025
d93d527
checkpoint
tannerlinsley Sep 23, 2025
3e9f324
checkpoint
tannerlinsley Sep 23, 2025
0821097
So close
tannerlinsley Sep 23, 2025
39c343b
checkpoint
tannerlinsley Sep 23, 2025
0812156
checkpoint
tannerlinsley Sep 23, 2025
71c5203
reenable type tests
tannerlinsley Sep 23, 2025
5071aac
handler context working
tannerlinsley Sep 23, 2025
4606661
checkpoint
tannerlinsley Sep 23, 2025
0e1dd5a
checkpoint
tannerlinsley Sep 23, 2025
7d77bb4
checkpoint
tannerlinsley Sep 23, 2025
db38550
serverfn compiler handles createMiddlewareq
schiller-manuel Sep 23, 2025
f1dd771
fix load hook, correct plugin order
schiller-manuel Sep 23, 2025
88b76e8
formatting
schiller-manuel Sep 23, 2025
40f7e92
nonce API
schiller-manuel Sep 23, 2025
28a03b2
split up into router and start entry
schiller-manuel Sep 23, 2025
a90491d
rename entry file
schiller-manuel Sep 23, 2025
516c8f5
fix e2e test
schiller-manuel Sep 23, 2025
943546b
chore: get more e2e tests passing (#5187)
brenelz Sep 23, 2025
9ebd653
Rename validator to inputValidator
tannerlinsley Sep 23, 2025
1fce3e7
fix solid imports
schiller-manuel Sep 23, 2025
fac4608
fix solid server-entry
schiller-manuel Sep 23, 2025
31edc9f
export createClientRpc for solid client as well
schiller-manuel Sep 23, 2025
ec52ca7
correctly handle target (react vs solid) in start config
schiller-manuel Sep 23, 2025
540614f
make config optionally lazy in router plugins
schiller-manuel Sep 23, 2025
b723a05
only apply autoImport plugin when verboseFileRoutes === false
schiller-manuel Sep 23, 2025
f888beb
add getGlobalStartContext
schiller-manuel Sep 23, 2025
a58ee10
fix entries, temporarily disable some projects
schiller-manuel Sep 23, 2025
75c52d3
fix type exports
schiller-manuel Sep 23, 2025
349e407
disable failing solid e2e test
schiller-manuel Sep 23, 2025
5e6c4d0
Merge remote-tracking branch 'origin/main' into attempt-merge
schiller-manuel Sep 23, 2025
9f4b6e5
fix
schiller-manuel Sep 23, 2025
3efbf6a
Merge branch 'RC' into main
schiller-manuel Sep 23, 2025
3a5465a
fix merge conflict in test
schiller-manuel Sep 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
171 changes: 171 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# AGENTS.md

## Project overview

TanStack Router is a type-safe router with built-in caching and URL state management for React and Solid applications. This monorepo contains two main products:

- **TanStack Router** - Core routing library with type-safe navigation, search params, and path params
- **TanStack Start** - Full-stack framework built on top of TanStack Router

## Setup commands

- Install deps: `pnpm install`
- Setup e2e testing: `pnpm exec playwright install`
- Build packages: `pnpm build` (affected) or `pnpm build:all` (force all)
- Start dev server: `pnpm dev`
- Run tests: `pnpm test`

## Code style

- TypeScript strict mode with extensive type safety
- Framework-agnostic core logic separated from React/Solid bindings
- Type-safe routing with search params and path params
- Use workspace protocol for internal dependencies (`workspace:*`)

## Dev environment tips

- This is a pnpm workspace monorepo with packages organized by functionality
- Nx provides caching, affected testing, targeting, and parallel execution for efficiency
- Use `npx nx show projects` to list all available packages
- Target specific packages: `npx nx run @tanstack/react-router:test:unit`
- Target multiple packages: `npx nx run-many --target=test:eslint --projects=@tanstack/history,@tanstack/router-core`
- Run affected tests only: `npx nx affected --target=test:unit`
- Exclude patterns: `npx nx run-many --target=test:unit --exclude="examples/**,e2e/**"`
- Navigate to examples and run `pnpm dev` to test changes: `cd examples/react/basic && pnpm dev`
- **Granular Vitest testing within packages:**
- Navigate first: `cd packages/react-router`
- Specific files: `npx vitest run tests/link.test.tsx tests/Scripts.test.tsx`
- Test patterns: `npx vitest run tests/ClientOnly.test.tsx -t "should render fallback"`
- Name patterns: `npx vitest run -t "navigation"` (all tests with "navigation" in name)
- Exclude patterns: `npx vitest run --exclude="**/*link*" tests/`
- List tests: `npx vitest list tests/link.test.tsx` or `npx vitest list` (all)
- Through nx: `npx nx run @tanstack/react-router:test:unit -- tests/ClientOnly.test.tsx`
- **Available test targets per package:** `test:unit`, `test:types`, `test:eslint`, `test:build`, `test:perf`, `build`
- **Testing strategy:** Package level (nx) → File level (vitest) → Test level (-t flag) → Pattern level (exclude)

## Testing instructions

- **Critical**: Always run unit and type tests during development - do not proceed if they fail
- **Test types:** `pnpm test:unit`, `pnpm test:types`, `pnpm test:eslint`, `pnpm test:e2e`, `pnpm test:build`
- **Full CI suite:** `pnpm test:ci`
- **Fix formatting:** `pnpm prettier:write`
- **Efficient targeted testing workflow:**
1. **Affected only:** `npx nx affected --target=test:unit` (compares to main branch)
2. **Specific packages:** `npx nx run @tanstack/react-router:test:unit`
3. **Specific files:** `cd packages/react-router && npx vitest run tests/link.test.tsx`
4. **Specific patterns:** `npx vitest run tests/link.test.tsx -t "preloading"`
- **Pro tips:**
- Use `npx vitest list` to explore available tests before running
- Use `-t "pattern"` to focus on specific functionality during development
- Use `--exclude` patterns to skip unrelated tests
- Combine nx package targeting with vitest file targeting for maximum precision
- **Example workflow:** `npx nx run @tanstack/react-router:test:unit` → `cd packages/react-router && npx vitest run tests/link.test.tsx` → `npx vitest run tests/link.test.tsx -t "preloading"`

## PR instructions

- Always run `pnpm test:eslint`, `pnpm test:types`, and `pnpm test:unit` before committing
- Test changes in relevant example apps: `cd examples/react/basic && pnpm dev`
- Update corresponding documentation in `docs/` directory when adding features
- Add or update tests for any code changes
- Use internal docs links relative to `docs/` folder (e.g., `./guide/data-loading`)

## Package structure

**Core packages:**

- `packages/router-core/` - Framework-agnostic core router logic
- `packages/react-router/`, `packages/solid-router/` - React/Solid bindings and components
- `packages/history/` - Browser history management

**Tooling:**

- `packages/router-cli/` - CLI tools for code generation
- `packages/router-generator/` - Route generation utilities
- `packages/router-plugin/` - Universal bundler plugins (Vite, Webpack, ESBuild, Rspack)
- `packages/virtual-file-routes/` - Virtual file routing system

**Developer experience:**

- `packages/router-devtools/`, `packages/*-router-devtools/` - Development tools
- `packages/eslint-plugin-router/` - ESLint rules for router

**Validation adapters:**

- `packages/zod-adapter/`, `packages/valibot-adapter/`, `packages/arktype-adapter/`

**Start framework:**

- `packages/*-start/`, `packages/start-*/` - Full-stack framework packages

**Examples & testing:**

- `examples/react/`, `examples/solid/` - Example applications (test changes here)
- `e2e/` - End-to-end tests (requires Playwright)
- `docs/router/`, `docs/start/` - Documentation with React/Solid subdirectories

**Dependencies:** Uses workspace protocol (`workspace:*`) - core → framework → start packages

## Common development tasks

**Adding new routes:**

- Use file-based routing in `src/routes/` directories
- Or use code-based routing with route definitions
- Run route generation with CLI tools

**Testing changes:**

- Build packages: `pnpm build` or `pnpm dev` (watch mode)
- Run example apps to test functionality
- Use devtools for debugging router state

**Documentation updates:**

- Update relevant docs in `docs/` directory
- Ensure examples reflect documentation changes
- Test documentation links and references
- Use relative links to `docs/` folder format

## Framework-specific notes

**React:**

- Uses React Router components and hooks
- Supports React Server Components (RSC)
- Examples include React Query integration
- Package: `@tanstack/react-router`

**Solid:**

- Uses Solid Router components and primitives
- Supports Solid Start for full-stack applications
- Examples include Solid Query integration
- Package: `@tanstack/solid-router`

## Environment requirements

- **Node.js** - Required for development
- **pnpm** - Package manager (required for workspace features)
- **Playwright** - Required for e2e tests (`pnpm exec playwright install`)

## Key architecture patterns

- **Type Safety**: Extensive TypeScript for type-safe routing
- **Framework Agnostic**: Core logic separated from framework bindings
- **Plugin Architecture**: Universal bundler plugins using unplugin
- **File-based Routing**: Support for both code-based and file-based routing
- **Search Params**: First-class support for type-safe search parameters

## Development workflow

1. **Setup**: `pnpm install` and `pnpm exec playwright install`
2. **Build**: `pnpm build:all` or `pnpm dev` for watch mode
3. **Test**: Make changes and run relevant tests (use nx for targeted testing)
4. **Examples**: Navigate to examples and run `pnpm dev` to test changes
5. **Quality**: Run `pnpm test:eslint`, `pnpm test:types`, `pnpm test:unit` before committing

## References

- **Documentation**: https://tanstack.com/router
- **GitHub**: https://github.com/TanStack/router
- **Discord Community**: https://discord.com/invite/WrRKjPJ
Loading
Loading