0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
Commit graph

711 commits

Author SHA1 Message Date
Brenley Dueck
2332fb26f9
chore: upgrade Solid to v2 beta.7 (#7210) 2026-04-20 03:40:39 +02:00
Birk Skyum
14d39cea3e
chore: merge main to solid v2 (#7105) 2026-04-05 20:56:19 +02:00
Brenley Dueck
72323492af
chore: sync main branch with store refactor (#7001) 2026-03-23 08:34:20 +01:00
Birk Skyum
9ece9ccc56
Merge remote-tracking branch 'origin/main' into solid-router-v2-pre 2026-03-19 02:50:06 +01:00
Birk Skyum
b03c955a84
update vite-plugin-solid to 3.0.0-next.3 2026-03-19 02:41:28 +01:00
github-actions[bot]
86ea33c476 ci: changeset release 2026-03-18 17:13:16 +00:00
github-actions[bot]
8f54d112b9 ci: changeset release 2026-03-16 23:09:00 +00:00
Tanner Linsley
940151cbed
feat: add @tanstack/intent AI agent skills for Router and Start (#6866)
* feat: add @tanstack/intent AI agent skills for Router and Start

Add SKILL.md files across 11 packages to help AI coding agents generate
correct TanStack Router and Start code. Skills cover common patterns,
API usage, and failure modes that agents frequently get wrong.

Packages with skills:
- router-core (10 skills): core concepts, search/path params, navigation,
  data loading, auth/guards, code splitting, not-found/errors, type safety, SSR
- react-router (3): React bindings, Router+Query composition, migration from React Router
- start-client-core (6): Start setup, server functions, middleware,
  execution model, server routes, deployment
- react-start (2): React Start bindings, migration from Next.js
- virtual-file-routes (1): programmatic route tree building
- router-plugin (1): bundler plugin configuration
- start-server-core (1): server-side runtime
- solid-router (1): Solid bindings
- vue-router (1): Vue bindings
- solid-start (1): Solid Start bindings
- vue-start (1): Vue Start bindings

Each package includes bin/intent.js shim, _artifacts/ metadata, and
@tanstack/intent devDependency.

* fix: address PR review comments on skill files

- Fix incorrect createTanstackRouter → createRouter in router-query examples
- Fix missing React type imports (ComponentPropsWithoutRef, FormEvent)
- Fix hardcoded localhost:3000 in SSR example, use req headers instead
- Fix session.update/clear to use await with data payload
- Fix start-setup → start-core slug mismatch in domain_map + skill_spec
- Make start-client-core skill_tree self-contained (remove react-start refs)
- Add framework-agnostic comments to execution-model and middleware skills
- Make virtual-file-routes vite example framework-agnostic
- Fix solid-router domain_map: Link is primary, createLink for wrappers
- Fix vue-router domain_map: scope Ref unwrapping to script, not templates
- Fix vue-router SKILL.md: tsx → vue fence language for template snippets
- Fix virtual-file-routes domain_map failure mode wording
- Fix MD028 blockquote blank lines across 11 files
- Fix MD040 missing fence languages across 4 files
- Update pnpm-lock.yaml

* fix: address review feedback and audit all 28 skills against source

- Address all 9 Sheraff review comments (ensureQueryData, auth patterns,
  open redirect, useLocation migration, reusable components, zodValidator)
- Address all 11 actionable CodeRabbit comments (naming collisions,
  framework-agnostic comments, missing imports, bin/intent.js error handling)
- Full source-verified audit of all 28 skills across 7 re-audited packages
- Fix solid-start: add HydrationScript, move HeadContent to body, use
  shellComponent pattern
- Fix solid-router: useLoaderDeps returns Accessor<T>, ScrollRestoration
  deprecated, add missing hooks/components
- Fix vue-router: useLinkProps returns LinkHTMLAttributes, useLoaderDeps
  returns Ref<T>, fix split-file convention
- Fix start-server-core: correct file path, server fn prefix, getValidatedQuery
  API, add createServerFn imports to all examples
- Fix router-core skills: preloadStaleTime wording, loader route param,
  error retry pattern, search-params adapter scoping
- All 28 skills pass @tanstack/intent validate

* chore: add changeset for intent skills feature
2026-03-16 16:54:37 -06:00
Birk Skyum
d9e6c3179a
Merge remote-tracking branch 'origin/main' into solid-router-v2-pre 2026-03-16 00:22:34 +01:00
Birk Skyum
1376d0ffc1
Merge remote-tracking branch 'origin/main' into solid-router-v2-pre 2026-03-16 00:15:07 +01:00
github-actions[bot]
268bff22e5 ci: changeset release 2026-03-15 23:14:51 +00:00
github-actions[bot]
a0a6aa8b8a ci: changeset release 2026-03-15 22:42:25 +00:00
Birk Skyum
838b0eb9a8
build: update to vite-config 0.5.x (rolldown) (#6926) 2026-03-15 23:39:00 +01:00
github-actions[bot]
91d10855e8 ci: changeset release 2026-03-15 15:30:04 +00:00
Birk Skyum
ef9b241f3c
build: update to @tanstack/vite-config v0.4.3 (#6923)
* move to vite-config 0.4.3

* changeset

* fix typo in the changeset

* patch vite-config to use module: 100

* Update patch file

* Fix lockfile

---------

Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
2026-03-16 02:27:24 +11:00
github-actions[bot]
ec7e8c5f6a ci: changeset release 2026-03-14 07:51:21 +00:00
github-actions[bot]
79cd4d5afa ci: changeset release 2026-03-13 20:27:11 +00:00
Manuel Schiller
6069eba643
fix: hoist inline component definitions for proper React HMR (#6919)
* fix: hoist inline component definitions for proper React HMR

this reverts #6197 and implements a proper fix

fixes #6339

* add changeset
2026-03-13 21:24:40 +01:00
Brenley Dueck
033ea00a20 Merge branch 'main' into solid-v2 2026-03-12 06:05:28 -05:00
Birk Skyum
ec4b803c9a
reset router-devtools-core 2026-03-11 01:07:54 +01:00
Tanner Linsley
7706e3f540 release: v1.166.7 2026-03-10 19:25:59 +00:00
Tanner Linsley
964cae0224 release: v1.166.6 2026-03-09 22:26:01 +00:00
Tanner Linsley
6438c03b2f release: v1.166.4 2026-03-09 19:17:52 +00:00
Tanner Linsley
88fcbec986 release: v1.166.3 2026-03-08 13:32:59 +00:00
Tanner Linsley
861f319bbe release: v1.166.2 2026-03-04 20:37:33 +00:00
Tanner Linsley
15fe30d41d release: v1.164.0 2026-03-01 02:32:52 +00:00
Tanner Linsley
5362746356 release: v1.163.5 2026-03-01 01:35:21 +00:00
Tanner Linsley
de66f0e0a0 release: v1.163.3 2026-02-27 22:13:46 +00:00
Tanner Linsley
c4027b6a79 release: v1.163.2 2026-02-25 08:26:16 +00:00
Tanner Linsley
30fdeab01b release: v1.162.9 2026-02-24 12:50:58 +00:00
Tanner Linsley
ea31c50be9 release: v1.162.8 2026-02-23 22:16:33 +00:00
Tanner Linsley
c137bbc249 release: v1.162.6 2026-02-23 16:37:33 +00:00
Tanner Linsley
54e69075c3 release: v1.162.5 2026-02-23 16:14:51 +00:00
Tanner Linsley
eefcb5f9a6 release: v1.162.4 2026-02-22 22:51:07 +00:00
Tanner Linsley
a562eb496b release: v1.162.2 2026-02-22 08:42:04 +00:00
Tanner Linsley
3710720cd9 release: v1.162.1 2026-02-21 21:59:16 +00:00
Tanner Linsley
5fcf33e871 release: v1.161.4 2026-02-21 11:18:59 +00:00
Birk Skyum
4def459cb6
testing(vite-ecosystem-ci): add vite as direct dev depencency (#6709) 2026-02-20 01:58:27 +01:00
Tanner Linsley
5a8fc3e682 release: v1.161.3 2026-02-20 00:01:06 +00:00
Tanner Linsley
6dfef62add release: v1.161.1 2026-02-18 08:58:14 +00:00
Tanner Linsley
d5e5fbea6b release: v1.161.0 2026-02-18 00:19:12 +00:00
Manuel Schiller
711f3b858e
feat: import protection (#6688) 2026-02-18 01:16:30 +01:00
Tanner Linsley
08a2d090be release: v1.160.2 2026-02-16 19:28:33 +00:00
Tanner Linsley
c7bf332590 release: v1.160.1 2026-02-16 18:12:43 +00:00
Tanner Linsley
02d88bf876 release: v1.160.0 2026-02-15 07:06:53 +00:00
Tanner Linsley
c5d328adfd release: v1.159.14 2026-02-15 01:46:10 +00:00
Manuel Schiller
27d0867ff8
add internal docs for code splitting (#6661)
* add internal docs for code splitting

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-14 21:44:43 +01:00
Kyle Mathews
988a9d6788
test: add invariant and property tests for code-splitter shared bindings (#6662)
* test: add invariant, property, and exhaustive tests for code-splitter shared bindings

Add 76 new tests across three layers for the shared virtual module
code-splitting logic introduced in #6659:

Layer 1 - Algebraic property tests on helper functions:
- expandTransitively: idempotence, monotonicity, cycle handling
- buildDependencyGraph: subset invariants
- removeBindingsDependingOnRoute: direct/transitive removal
- expandDestructuredDeclarations: idempotence, sibling expansion
- collectLocalBindingsFromStatement: all declaration types

Layer 2 - Invariant tests on computeSharedBindings:
- Route is never in the shared set
- Results are always real local bindings (never imports)
- Destructured siblings cohesion
- Transitive dependency inclusion
- Route-dependent binding exclusion
- Determinism across repeated calls

Layer 3 - Small-scope exhaustive tests:
- Single binding × 3 declaration kinds × 4 property patterns × 2 groupings
- Two bindings × 4 cross-group reference patterns × 2 groupings
- Transitive dependency chains (linear, 3-deep, diamond)
- Meta-invariant conformance across all shared-* fixture files

Testing approach inspired by:
https://gist.github.com/KyleAMathews/64bcea53a57f600cc3b73bc366d9ac4d

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* ci: apply automated fixes

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-14 18:41:23 +01:00
Tanner Linsley
ffec9c987d release: v1.159.12 2026-02-14 12:12:57 +00:00
Manuel Schiller
523972e0df
fix: shared virtual module for code-split routes (#6659)
* fix: shared virtual module for code-split routes

When a route file has module-level bindings (variables, functions, classes) referenced by **both** split and non-split route properties, the bindings are duplicated — initialized independently in the reference file and in each virtual split file. This breaks singletons, causes double side effects, and wastes bundle size.

```tsx
const collection = { name: 'todos', preload: async () => {} }
export const Route = createFileRoute('/todos')({
  loader: async () => {
    await collection.preload()
  }, // stays in reference
  component: () => <div>{collection.name}</div>, // split to virtual
})
```
In this example, `collection` is initialized in **both** the reference file (because `loader` references it) and the `?tsr-split=component` virtual file (because the component references it). Two separate instances exist at runtime.

To solve this issue, this PR introduces a third virtual module `route.tsx?tsr-shared=1` that contains shared bindings. Both the reference and virtual files import from it.

When `sharedBindings` is empty (the common case — component-only helpers, loader-only code), no shared module exists and the system works exactly as today.

The reference transform runs first and will emit a static import of `?tsr-shared=1` **only when needed**. Since split chunks are only discovered via the reference file's emitted `import('...?tsr-split=...')`, the bundler will always process/evaluate the reference module first. Result: the shared module is evaluated once and then reused by any later-loaded split chunk.
2026-02-14 13:10:54 +01:00