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

94 commits

Author SHA1 Message Date
Sean Cassiere
8ebf6a7fab
chore(examples): move from "layout" to "pathlessLayout" (#3600) 2025-02-28 16:17:26 +13:00
Tanner Linsley
74f933aa58 examples: <ScrollRestoration/> => scrollRestoration: true 2025-01-30 15:44:57 -07:00
Nicolas Beaussart
624e8b0246
chore(e2e,examples): downgrade to tailwindcss 3 (#3249)
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
2025-01-27 13:28:27 +13:00
Sean Cassiere
96e9e1a7aa
chore(e2e,examples): tailwindcss v4 (#3235) 2025-01-26 17:50:21 +13:00
Sean Cassiere
4ae6ca9d6b
feat(start): move scripts,links, and meta to the head (#2571)
This minor is non-breaking for Router users, since it's undocumented to the public API, but **is breaking** for Start alpha users. 

This changes the options signature for meta from this:
```tsx
createRoute({
  meta: () => [
    ...
  ],
  links: () => [
    ...
  ],
})
```

to this:

```tsx
createRoute({
  head: () => ({
    meta: [
      ...
    ],
    links: [
      ...
    ],
  })
})
```
2024-11-17 15:19:18 -07:00
Manuel Schiller
d328172d10 chore: no braces for strings in JSX 2024-09-12 17:42:12 +02:00
renovate[bot]
a1438ee99c
chore(deps): update all non-major dependencies (#2051)
* chore(deps): update all non-major dependencies

* Fix typescript-eslint rules

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
2024-07-29 19:30:05 +10:00
Sean Cassiere
3f6ffa5a21
test(examples): validation of layout route functionality by running e2e testing on the basic examples (#2042)
* chore: unify the layout ui across all the basic examples

* chore: more unification

* test(examples): e2e validation of layout routes
2024-07-28 00:12:15 +12:00
Sean Cassiere
66c9dcd349
test(examples): add e2e testing to ensure the basic examples work across releases (#1990)
* test(examples): add e2e to basic

* test(examples): add e2e to basic-file-based

* test(examples): add e2e to basic-react-query

* test(examples): add e2e to basic-react-query-file-based

* chore(examples): delete the test-results folder and content

* chore(examples): update gitignores
2024-07-19 16:09:11 +12:00
Sean Cassiere
cd85ca1de1
chore: cleanup styles and eslint errors in the spa examples (#1971)
* style(examples): kitchen sink examples

* style(examples): more kitchen sink examples

* style(examples): basic examples

* style(examples): authenticated routes example

* style(examples): authentication routes example

* style(examples): scroll restoration

* style(examples): navigation blocking

* style(examples): defered data example

* style(examples): location masking example

* style(examples): quickstart examples
2024-07-17 02:28:39 +12:00
Tanner Linsley
fd692cf77d
feat: New Serialization Paradigm (#1824)
* checkpoint

* fix: config

* checkpoint

* testing fixes (#1679)

* examples: init trellaux

* feat: Better serialization/streaming, RSC proof of concept

* fixup server-handler

* fix: update deps and lock

* fix: remove rscFrom

* fix: remove useLoaderDataTransform

* fix: min react version

* chore: lockfile

* style: prettier fail

* chore: swap expect-error for ignore

* chore(react-router): try coercing the types

* chore: put this back in

* fix: some tests

* remove conditions

* fix tests

* update lockfile

* fix: refactor dehydrated data

* Update docs

* fix: remove unused deferred logic

* fix port

* nevermind

* fix: remove rebase garbage

* disable playwright for a hot minute

* oops, actually disable it now

* fix: prettier formatting

* fix: do not ignore app.config files

---------

Co-authored-by: Nikhil Saraf <nsaraf98@gmail.com>
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
2024-06-28 09:45:01 -06:00
Lachlan Collins
431031182b
chore: Migrate to ESLint flat config (#1846)
* chore: Migrate to ESLint flat config

* Add knip.json
2024-06-28 11:59:39 +10:00
Tanner Linsley
cb80816603 fix(start): config for RSCs... almost 2024-05-18 21:06:34 -06:00
Sean Cassiere
74ca8a293e
chore: fix eslint errors being thrown on the basic example (#1383) 2024-03-28 16:28:38 +13:00
Ryan Staniforth
8aee08b530
fix: Type error when passing props to Link via destructured LinkProps. (#1316)
* fix: Type error when passing props to Link via destructed LinkOptions.

* Swap LinkOptions for LinkProps.

* Rename variable.
2024-03-15 12:20:07 +01:00
Ryan Staniforth
af2b7dcbcc
fix: Fix Link children type when passing a function. (#1307) 2024-03-14 12:36:28 -06:00
Sean Cassiere
020edb5be7
examples: correct usage of the createLazyRoute function (#1230) 2024-02-27 19:31:41 +01:00
Tanner Linsley
1fb4082c07 feat: createLazyRoute 2024-01-24 20:41:50 -07:00
Tanner Linsley
fcc278ffc8 feat: New code-splitting patterns + deprecations
- Deprecated class constructor APIs in favor of new `create[Class]` functions
- Added new code-splitting paradigm that produces less code, preloads potentially faster and plays nicely with SSR and file-based routing
- Updated all examples to use new code splitting patterns and new suggested APIs
2024-01-24 13:01:48 -07:00
Tanner Linsley
912fae7e67 examples: some styles 2023-12-23 15:33:16 -07:00
Tanner Linsley
f108b5986f examples 2023-12-18 17:30:48 -07:00
Tanner Linsley
3206f0481b fix: swr + remove shouldReload, activeOptions?.exact for search params 2023-12-18 17:28:12 -07:00
Tanner Linsley
5ed8e42185 fix: preloading and potentially fix devtools context 2023-12-15 13:01:39 -07:00
Tanner Linsley
84eec0e4ca examples: update 2023-12-11 15:39:59 -07:00
Tanner Linsley
5423710170 fix: navigation blocking 2023-12-08 23:27:28 -07:00
Tanner Linsley
36d774bc36 fix: do not recreate history on fast refresh 2023-12-04 09:24:15 -07:00
Tanner Linsley
703fbcf4d4 examples: fix react-query 2023-12-01 09:35:59 -07:00
Tanner Linsley
76f411cfad fix: default to always reloading 2023-11-30 16:48:54 -07:00
Tanner Linsley
883f608906 fix: errorComponent opt-out / bubbling 2023-11-30 15:00:43 -07:00
Tanner Linsley
cae467a7ab feat: shouldRevalidate dependencies 2023-11-30 14:23:19 -07:00
Tanner Linsley
e0ebb9d02d feat: shouldReload 2023-11-30 13:53:27 -07:00
Tanner Linsley
8fab8b4175 feat: loader + ephemeral loaderData
Breaking Changes:

- `load` has been renamed back (I know...) to `loader`. Don't kill me. This again stays true to the nature of its functionality.
- `loader` can once again return data, but it is stored ephemerally on the route match and re-loaded on every navigation.
- If you choose to store data in `loaderData` from the `loader` function, you'll likely want to employ some level of caching to ensure you're only fetching data when necessary and resolving as early as possible if you have any meaningful cached data to display to the user. TanStack Query is a great tool to do this.
2023-11-29 01:16:52 -07:00
Tanner Linsley
66ec994600 fix: Rename route and router meta back to route and router context
- Route meta and router meta have been renamed back to context. Bikeshed!
- The RouterContext class has been removed in favor of a new `rootRouteWithContext` factory function e.g. rootRouteWithContext<YourRouterContext>()(config)
2023-11-07 13:45:15 -07:00
Tanner Linsley
4a792144eb feat: Big refactor to React only
There are many breaking changes in this release:
- The Router class no longer has many of the methods it had.
- Most of these methods have been moved to the new routerContext, which is served via the useRouter() hook
- React state is being used for all state management, which should set the stage for better transition/suspense support
- Router Context and route context has been renamed to Router Meta and Route Meta
- Loaders are gone. You can still force a route to wait for an async function via `beforeLoad`, which is serial or `load` which is parallel.
- There's a lot of other changes, but I'm too tired to think straight.
2023-11-05 01:38:08 -06:00
Tanner Linsley
5fdf465ecf feat: loaderContext
Breaking Changes:
- `search` and `hash` are no longer directly available in route loaders
- The route `key` option has been removed

New:
- Added a new optional route option `loaderContext`. It's a function that receives `search` and `hash` and expects you to return any serializable data from them that you require in your loader. This stable-serialized value is used to uniquely identify route matches coming from this route configuration and acts as a dependency tracker for when loaders should rerun, etc.
2023-09-28 13:22:22 -06:00
Tanner Linsley
ae621c93ea feat: route masking 2023-09-11 10:07:10 -06:00
Tanner Linsley
715d56f132 Update main.tsx 2023-09-04 15:35:02 -06:00
Tanner Linsley
a78555a0bd fix: do not allow arrays through qss
Fixes #711
2023-09-04 15:31:30 -06:00
Tanner Linsley
2f92981970 fix: preloading bug 2023-09-01 14:25:09 -06:00
Tanner Linsley
9995e8975e fix: expose onEnter, onTransition, onLeave route options. 2023-09-01 12:13:23 -06:00
Tanner Linsley
4767648c15 fix: framework agnostic packages 2023-08-08 18:34:31 -06:00
Tanner Linsley
79eb2ff027 feat: bring back route loaders, caching, etc 2023-08-07 15:22:49 -06:00
Tanner Linsley
3ab35065d1 fix: loader state isLoading and isFetching 2023-07-27 22:08:52 -06:00
Tanner Linsley
9bfd4f8ca1 fix: big refactor 2023-07-27 20:44:08 -06:00
Tanner Linsley
2e820eecf3 fix: (de)hydration changes 2023-07-21 23:14:09 -06:00
Tanner Linsley
572caa56a0 fix: add route.to for navigation
Fixes #630
2023-07-10 12:20:39 -06:00
Tanner Linsley
9a4bb4306d fix: wildcard matchIDs
Fixes #626
2023-07-08 10:41:06 -06:00
Tanner Linsley
1c2d94e97f fix: more accurate from/to types, component useParams prop
Fixes: #536 #627
2023-07-08 10:13:25 -06:00
Tanner Linsley
12b263ab64 checkpoint 2023-04-18 13:38:20 -06:00
Tanner Linsley
3581aec569 checkpoint 2023-02-20 09:41:43 -07:00