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

109 commits

Author SHA1 Message Date
Flo
45c4ad8d62
fix(router-core): lane match loader rewrite (#7805)
* fix: lane match loader rewrite

---------

Co-authored-by: Manuel Schiller <6340397+schiller-manuel@users.noreply.github.com>
2026-08-04 20:28:11 +02:00
Manuel Schiller
49f6863245
fix(router-plugin): preserve HMR state for lowercase split components (#7855) 2026-07-19 12:09:25 +02:00
Manuel Schiller
837897f073
fix(router-plugin): preserve generated route state for aliased HMR imports (#7560)
* fix(router-plugin): preserve generated route state for aliased HMR imports

fixes #4303

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-06 10:34:02 +02:00
Ulrich Stark
bb99f66a47
refactor: remove unnecessary any assertions (#7542) 2026-06-04 22:12:45 +02:00
Flo
9f6258f23e
chore: update zod to v4.4.3 (#7441)
* chore: update zod to v4.4.3

* fix(start): preserve route path defaults

* fix(examples): resolve zod 4 build failures
2026-05-20 08:41:45 +02:00
Manuel Schiller
5fa9e555f3
feat: deferred hydration (#7362)
* feat: deferred hydration

* fix

* tests

* solid tests

* Changes before error encountered

Agent-Logs-Url: https://github.com/TanStack/router/sessions/5263c469-75c2-4470-bd4c-86f9b43964f4

Co-authored-by: schiller-manuel <6340397+schiller-manuel@users.noreply.github.com>

* chore: address hydration review follow-ups

Agent-Logs-Url: https://github.com/TanStack/router/sessions/16e27113-ff01-4de8-aded-b9be9f6dd4ff

Co-authored-by: schiller-manuel <6340397+schiller-manuel@users.noreply.github.com>

* fix(start-client-core): correct import order in hydrateStart.ts

Co-authored-by: schiller-manuel <schiller-manuel@users.noreply.github.com>

* chore: remove tracked nx self-healing artifacts

Agent-Logs-Url: https://github.com/TanStack/router/sessions/95750760-1348-437c-8f73-cc45e899003a

Co-authored-by: schiller-manuel <6340397+schiller-manuel@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: schiller-manuel <6340397+schiller-manuel@users.noreply.github.com>
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: schiller-manuel <schiller-manuel@users.noreply.github.com>
2026-05-19 18:43:00 +02:00
Manuel Schiller
b60eb36e59
fix: fix route mismatch warnings and HMR route indexes (#7422)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-17 13:35:04 +02:00
Manuel Schiller
8146db7e54
fix(router-plugin): detect typed root route context for HMR (#7420) 2026-05-17 00:42:32 +02:00
Manuel Schiller
056337ef02
fix: fix plain TypeScript parser handling (#7342) 2026-05-05 01:57:21 +02:00
Manuel Schiller
96818b8ba5
fix(router-plugin): isolate route metadata per plugin instance (#7313) 2026-05-01 21:03:21 +02:00
Birk Skyum
b0024d6310
Revert "fix(solid-router): enable route component HMR for Solid"
This reverts commit b86b061253.
2026-04-27 21:18:08 +02:00
Birk Skyum
b86b061253
fix(solid-router): enable route component HMR for Solid 2026-04-27 20:47:27 +02:00
Manuel Schiller
1e371b60f1
fix: do not import 'react-refresh/runtime' (#7255)
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-04-25 01:45:22 +02:00
Manuel Schiller
4d864eebbd
inline css (#7253) 2026-04-25 01:20:36 +02:00
Manuel Schiller
91a708989d
rsbuild plugin (#7228)
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
Co-authored-by: Keven Arroyo <dake.3601@gmail.com>
2026-04-24 03:26:03 +02:00
Manuel Schiller
105d05691a
fix(router-generator): harden route file transform rewrites (#7167) 2026-04-13 02:20:50 +02:00
Flo
6355bb75f7
refactor: shorten internal router store names (#7152) 2026-04-11 13:21:43 +02:00
Flo
459057cd2d
refactor: switch router stores to atom get/set API (#7150) 2026-04-11 12:41:57 +02:00
Manuel Schiller
f920527e8d
efp (#7144)
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
2026-04-11 01:43:05 +02:00
Manuel Schiller
f8351a8d7a
fix: initialize import.meta.hot.data before storing stable split componts (#7074)
* fix: initialize import.meta.hot.data before storing stable split components

fixes #7073

* fix: initialize import.meta.hot.data before storing stable split components

fixes #7073 [Self-Healing CI Rerun]

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-03-30 18:08:52 +02:00
Manuel Schiller
d7445e048d
fix: better react HMR (#7005)
* fix: better react HMR

* layout and fixes

* fix

* stabilize test

* stabilize test
2026-03-21 18:06:31 +01:00
Manuel Schiller
9351e99796
fix: Fix React Fast Refresh state preservation for auto code-split ro… (#7000) 2026-03-21 01:27:50 +01:00
Flo
054523900b
refactor: signal based reactivity (#6704) 2026-03-20 10:33:28 +01:00
Birk Skyum
838b0eb9a8
build: update to vite-config 0.5.x (rolldown) (#6926) 2026-03-15 23:39:00 +01: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
Manuel Schiller
711f3b858e
feat: import protection (#6688) 2026-02-18 01:16:30 +01: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
Manuel Schiller
30dc11e50a
fix: autoCodeSplitting` with destructured export (#6656)
fixes #4787
2026-02-14 02:26:03 +01:00
Manuel Schiller
77b18bbdae
fix: strip type exports upon DCE (#6582) 2026-02-03 00:48:33 +01:00
Manuel Schiller
8e938c44d4
fix: detect plugin order mismatch (#6411) 2026-01-18 11:41:04 +01:00
Sean Cassiere
70248f219d
fix(router-plugin): normalize file paths for Windows compatibility with rspack/webpack (#6333)
The route generator stores file paths with forward slashes
but rspack and webpack on Windows pass native paths with
backslashes to transform handlers.

This caused TSR_ROUTES_BY_ID_MAP lookups to fail, preventing
autoCodeSplitting from working on Windows with rspack.The
route generator stores file paths with forward slashes, but
rspack and webpack on Windows pass native paths with backslashes to
transform handlers.

This caused TSR_ROUTES_BY_ID_MAP lookups to fail, preventing
autoCodeSplitting from working on Windows with rspack.
2026-01-09 20:13:07 +13:00
Sean Cassiere
78f221c279
fix(router-plugin): do not process.exit after code-splitting for webpack and rspack (#6324) 2026-01-07 23:50:54 +13:00
Flo
7b4dcee399
refactor(router-core): index routes have index nodes in the segment tree (#6171) 2025-12-21 16:32:19 +01:00
Birk Skyum
3d6aa41f58
Vue router (#5997) 2025-12-06 19:41:15 +01:00
Nico Lynzaad
2ae37028a0
fix(router-plugin): do not overwrite resolved generator config with unprocessed inline config (#5963)
* do not overwrite resolved config with unprocessed inline input

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-25 20:08:37 +02:00
Flo
f39eb9b832
refactor(router-core): Process routeTree into segment tree instead of flatRoutes [WIP] (#5722) 2025-11-15 13:45:02 +01:00
Manuel Schiller
913430d701
fix: HMR: only invalidate router if match is existing and not cached (#5713) 2025-11-01 00:15:36 +01:00
Manuel Schiller
93d19ad11f
fix: route HMR handling (#5710) 2025-10-31 20:38:17 +01:00
Manuel Schiller
6f744c2089
fix: enable dead code elimination in split-route to remove unused imports (#5711) 2025-10-31 20:37:51 +01:00
Manuel Schiller
5022a60d2e
fix: only transform files in codesplitter if changes were made (#5460) 2025-10-13 01:32:01 +02:00
Manuel Schiller
e4d5671ba9
fix: various fixes (#5215)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-24 21:42:56 +02:00
Manuel Schiller
32faee22da
feat: Start RC (#5189)
Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com>
Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
Co-authored-by: chorobin <chrishorobin@hotmail.com>
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
Co-authored-by: Nico Lynzaad <44094871+nlynzaad@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: hokkyss <hokkyss2@gmail.com>
Co-authored-by: Philippe Serhal <philippe.serhal@gmail.com>
Co-authored-by: Jack Herrington <jherr@pobox.com>
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
2025-09-23 11:34:54 -06:00
Sean Cassiere
96bde26a90
fix(router-plugin): show warning for non-splittable items (#5145) 2025-09-13 12:47:02 +12:00
Manuel Schiller
b8ef497d90
fix: do not rename functions / variables when code splitting (#4960)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-15 17:13:26 +02:00
Manuel Schiller
b3e8e4aaf7
fix: initialize generator in esbuild plugin (#4949) 2025-08-14 01:00:41 +02:00
jihoon
638a902ee6
fix(router-plugin): add support for boolean and null literals in code splitter (#4915)
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
2025-08-13 13:01:57 +12:00
Manuel Schiller
1b319d0485
fix: default to addHmr in dev if not set (#4689) 2025-07-18 00:12:11 +02:00
Sean Cassiere
aa1fb5d553
fix(router-plugin): composed plugin to consider options from json config (#4654) 2025-07-15 14:18:02 +12:00
Wei Tang Lin
84228d51dd
fix(router-plugin): code-splitting to handle explicit undefined (#4564)
Co-authored-by: weitang.lin <weitang.lin@mujin.co.jp>
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
2025-07-07 15:35:55 +12:00
Manuel Schiller
d728d69900
feat: ssr setting per route (#4565)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-05 14:35:14 +02:00