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

6,620 commits

Author SHA1 Message Date
Sean Cassiere
92c6c2b1ff
docs: add documentation on the experimental.enableCodeSplitting feature (#1761)
* docs: add the content to the guide

* docs: add a link to the guide
2024-06-17 21:39:55 +12:00
SeanCassiere
e908be4076
docs: moving the actual file-based routing specific stuff not related to code-splitting to the right file 2024-06-17 20:58:28 +12:00
Lachlan Collins
6238d04784
ci: Update workspace dependencies (#1757)
* ci: Update workspace dependencies

* Try Nx v18
2024-06-17 13:51:32 +10:00
Tanner Linsley
77fff3491e release: v1.38.1 v1.38.1 2024-06-15 08:38:59 +00:00
Manuel Schiller
3b9a6feb43
fix(react-router): redirect with relative path (#1746)
* fix: redirect with relative path

* tests(react-router): add test for redirect with `from` and fix existing test

* tests: add beforeLoad test with redirect with `from`

* tests: remove leading slashes

---------

Co-authored-by: chorobin <chrishorobin@hotmail.com>
2024-06-15 10:35:57 +02:00
Christopher Horobin
d017403252
fix: match route location when pending has not been set (#1747) 2024-06-15 10:35:30 +02:00
Eliav2
a64513860b
docs: typo in the navigation blocking guide (#1754) 2024-06-15 10:43:31 +12:00
Sean Cassiere
0928776d6f
docs: update the project README to be react-only (#1750) 2024-06-14 23:20:08 +12:00
Tanner Linsley
4e048f5769 release: v1.38.0 v1.38.0 2024-06-14 11:14:29 +00:00
Kenta Iwasaki
cc02b23515
feat(router-vite-plugin): wrap "use server" over callexprs/identifiers for createServerFn (#1714)
Wrap identifiers/call expressions that are passed as the 2nd parameter
to createServerFn with a function expression whose body is prepended
with the "use server" directive.

This allows for functions that are passed to createServerFn to be
wrapped with other functions that server as middleware.

router-vite-plugin/tests/test-files/createServerFn.tsx has a Zod
middleware function example which has the "use server" directive
properly prepended.
2024-06-14 23:12:04 +12:00
Daniel Guldberg Aaes
30ae443f14
docs: fix some mistakes in the example of the SSR guide (#1748)
The current docs has a conflicts with a local declaration of 'createRouter'. and the import for the routeTree.gen is missing a ./
2024-06-14 22:07:29 +12:00
Manuel Schiller
53476d21ab
ci: add typescript 5.5 to the test matrix (#1727)
* add TS 5.5 to test matrix

* chore: upgrade to @tanstack/config@0.7.10

* Fix lockfile

---------

Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
2024-06-13 22:02:49 +10:00
Lachlan Collins
5f4de860af
chore: Update @tanstack/config (#1742)
* chore: Update @tanstack/config

* Dedupe
2024-06-13 21:56:03 +10:00
Tanner Linsley
bcd7299010 release: v1.37.0 v1.37.0 2024-06-12 23:28:50 +00:00
Manuel Schiller
cf437c0955
feat(router-generator): automatically convert from lazy to non-lazy file route (and vice versa) upon file rename (#1736) 2024-06-13 01:27:31 +02:00
Tanner Linsley
d04ddc04d8 release: v1.36.3 v1.36.3 2024-06-12 22:48:06 +00:00
Sean Cassiere
950561a71c
fix(react-router): route-context being available and loaders being called after a redirection (#1713)
* test(react-router): adjust the test names to accomodate the on-navigate stuff

* test(react-router): breaking route context

* test(react-router): test cases for redirects breaking

* test(react-router): use a bit more sleep

* test(react-router): a bit clearer on whats being tested

* test(react-router): check the `window.location.pathname` in the tests

* fix(react-router): a single test is now working, dont know what that means

* test: make sure StrictMode is ON

* test(react-router): this is no longer needed since we are doing this in routeContext.test.tsx

* test(react-router): confirm StrictMode on

* test(react-router): adjust the test names to accomodate the on-navigate stuff

* test(react-router): breaking route context

* test(react-router): test cases for redirects breaking

* test(react-router): use a bit more sleep

* test(react-router): a bit clearer on whats being tested

* test(react-router): check the `window.location.pathname` in the tests

* fix(react-router): a single test is now working, dont know what that means

* test: make sure StrictMode is ON

* test(react-router): this is no longer needed since we are doing this in routeContext.test.tsx

* test(react-router): confirm StrictMode on

* test: wrap fireEvent calls in `act`

* chore: readability

* fix: i dont know why, but this fixes the tests

* test: turn these back on

* fix: lets not change too much

* fix: bit closer to what it was before

* chore: not over updating

reducing the updates like @freshgiammi PR

* test(react-router): route context breaking for layout routes

* test(react-router): cases testing route context in layout routes for `beforeLoad`, `loader`, and `useRouteContext`

* chore: use the useRouteContext hook from the route definition

* chore: mistake in the test

* test: wrap the render calls in `act`

* test: wrap createRouter in `act`

* test: remove magic sleeps

* test: nested routes

* test: loaders

* test: failing tests for the loaders

* test: react strictmode for loaders

* test: dont use `waitFor` rather wait for elements in the DOM

* test: more async-work delayed checking of route context

* test: add an invalidate call after

* fix: remove the recursive `this.load()` call

The patch implemented by @freshgiammi in #1662

Co-Authored-By: Gianmarco Rengucci <16855748+freshgiammi@users.noreply.github.com>

* refactor: restore the `checkLatest()` call here

* test: remove these tests for routeContext in redirects

---------

Co-authored-by: Gianmarco Rengucci <16855748+freshgiammi@users.noreply.github.com>
2024-06-13 10:45:10 +12:00
Tanner Linsley
71464894a3 release: v1.36.2 v1.36.2 2024-06-12 20:38:56 +00:00
Christopher Horobin
f20781204f
fix: use resolved location when router is pending, otherwise latest location (#1734) 2024-06-12 22:36:28 +02:00
Tanner Linsley
df4f69cd53 release: v1.36.1 v1.36.1 2024-06-12 18:55:57 +00:00
Christopher Horobin
d6b593c423
perf(react-router): only Omit in Assign when there are overlapping keys (#1735)
* perf(react-router): improve performance of assign

* chore: update large file example with merging and naming context
2024-06-12 20:54:02 +02:00
Manuel Schiller
be3a410e46
docs: replace Meta with Static Data 2024-06-11 22:04:10 +02:00
Tanner Linsley
c05e6f3455 release: v1.36.0 v1.36.0 2024-06-11 05:54:36 +00:00
reihwald
a1fb6417b8
feat(router-devtools): add shadowDOMTarget option to TanStackRouterDevtools and TanStackRouterDevtoolsPanel (#1709) (#1720)
* feat: add shadowDOMTarget option to TanStackRouterDevtools and TanStackRouterDevtoolsPanel (#1709)

* feat: add documentation for shadowDOMTarget (#1709)

---------

Co-authored-by: Liam Reihwald <liam.reihwald@worldline.com>
2024-06-11 17:52:08 +12:00
Tanner Linsley
ff8b875a3e release: v1.35.6 v1.35.6 2024-06-10 20:30:52 +00:00
Christopher Horobin
0ae10190a1
fix(react-router): take from into account when navigating with params or layouts (#1721)
* fix: route masking, preload and index routes for `from` invariant checkout

- routesByPath doesn't include branches, they are deduped with index routes
  therefor I am using flatRoutes
- preload redirects should not include from automatically as it should be explicit
- declarative route masking should be pass from because from for route masking does
  not assert a location

* tests: add tests for search params

* fix: allow trailing slashes by using matchpathname and use _fromLocation for preloading and beforeLoad
2024-06-10 22:28:03 +02:00
Tanner Linsley
8d78e48d84 release: v1.35.5 v1.35.5 2024-06-10 20:23:21 +00:00
Christopher Horobin
ad9ed51395
perf(react-router): remove root search schema type and unused type parameters from route options (#1729)
* perf(react-router): remove root search schema to reduce checking needed in merging search params
2024-06-10 22:21:44 +02:00
Tanner Linsley
75326f05ea release: v1.35.4 v1.35.4 2024-06-08 19:59:56 +00:00
Manuel Schiller
1aa85acc79
fix(router-generator): correctly generate route tree for nested route groups (#1726)
fixes #1725
2024-06-08 21:58:06 +02:00
Golamrabbi Azad
6979e62d03
docs: spelling mistake in the filename of the _authenticated layout route in the authenticated routes guide (#1723) 2024-06-08 19:30:09 +12:00
Dima Hinev
871ba64a91
docs: spelling mistakes on the route-masking guide (#1717)
removed the the from page
2024-06-08 12:54:35 +12:00
Tanner Linsley
4a2bb0412d release: v1.35.3 v1.35.3 2024-06-06 09:52:19 +00:00
Dominik Dorfmeister
e82984b9fc
fix: Revert "fix: from was being ignored when the pathname included params or a pathless route (#1703)" (#1716)
This reverts commit 56a3100e7d.

# Conflicts:
#	packages/react-router/tests/link.test.tsx
2024-06-06 11:50:22 +02:00
Tanner Linsley
3bd1cdfaca release: v1.35.2 v1.35.2 2024-06-06 08:49:08 +00:00
Dominik Dorfmeister
d7395adb4d
fix: ensure that trailingSlashes don't break path matching (#1711)
* fix: ensure that trailingSlashes don't break path matching

* chore: this wasn't on purpose

* fix: make `removeTrailingSlash` account for basepath

* test: tests for basepath

* refactor: consolidate how we handle basepath replacing

* test: matrix tests with different basepaths for utils

* refactor: revert basereplace
2024-06-06 10:47:31 +02:00
Sean Cassiere
9bb0148cef
test(react-router): check the availability of the route context after a redirect on the first load (#1710)
* test(react-router): check in component-land about redirects

* test(react-router): do the same for the beforeLoad and loader spots

* chore: whoops

* test: make sure the pathnames are checked
2024-06-06 02:25:31 +12:00
Sean Cassiere
07a6fdeb96
test(react-router): check the route context at beforeLoad, loader, and component (#1708)
* test(react-router): initial tests for checking the route context

* chore: some comments so I know where I'm at

* test(react-router): make sure that context modification works

* chore: remove the element ids to simplify things

* chore: use simple naming for this stuff

* test(react-router): making sur the mock fn is only called once
2024-06-06 01:34:16 +12:00
Tanner Linsley
295a5c3595 release: v1.35.1 v1.35.1 2024-06-04 19:07:32 +00:00
Christopher Horobin
56a3100e7d
fix: from was being ignored when the pathname included params or a pathless route (#1703)
* fix: `from` was being ignored when the pathname included params or a pathless route

* tests: change description of test to match current location

* fix: apply changes to useNavigate and redirect, also add more tests

* chore: inline looseRoutesByPath
2024-06-04 20:57:08 +02:00
Tanner Linsley
cde4ca98af release: v1.35.0 v1.35.0 2024-06-04 18:45:05 +00:00
Christopher Horobin
b79690b2af
feat: merge unions for search and params for Link when from and to are loose (#1696)
* feat: merge unions for `search` and `params` `Link` is not strict

* chore: remove union to intersection
2024-06-04 20:43:36 +02:00
Tanner Linsley
341af21952 release: v1.34.9 v1.34.9 2024-06-01 06:08:45 +00:00
Manuel Schiller
050d89fa8a
fix: correctly resolve path in useMatchRoute if layout route is used (#1690) 2024-06-01 08:07:21 +02:00
Manuel Schiller
d2eec98542
fix: use Record<string, unknown> as default type for TSearchSchemaInput (#1684) 2024-05-31 18:05:33 +02:00
Aditya Pandey
cf64ed3481
Fix Playwright E2E CI step (#1678)
* Run server within Github CI

* Give unique package name

* Set proper shas for affected packages

* Move start server command to playwright config

* Remove test:e2e

* Move up replay installation, remove `test:e2e` script

* Add e2e targets

* Empty commit

* Empty commit

* Hardcode public version of REPLAY_API_KEY secret
2024-05-30 20:42:42 -06:00
Tanner Linsley
9e4b1db679 examples: init trellaux
# Conflicts:
#	pnpm-lock.yaml
2024-05-30 12:32:41 -06:00
Leonardo Montini
85f5e7be1b
docs: mention how to disable the plugin in tests (#1682)
* docs: mention how to disable the plugin in tests

* docs: improve phrasing
2024-05-30 20:07:30 +02:00
Tanner Linsley
634da2ba76 release: v1.34.8 v1.34.8 2024-05-30 17:18:39 +00:00
Manuel Schiller
6a44da8d68
fix: do not assign path to virtual routes for route groups (#1683)
fixes #1681
2024-05-30 19:17:15 +02:00