0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-18 19:34:24 +00:00
Commit graph

6,505 commits

Author SHA1 Message Date
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
Tanner Linsley
2c80cfe260 release: v1.34.7 v1.34.7 2024-05-29 19:56:34 +00:00
Leo Y. Li
f11cd07d6e
fix(react-router): only instantiate the confirmation promise when required in the useBlocker hook (#1669)
* fix: only instantiate the confirmation promise when required (useBlocker)

* fix: prettier
2024-05-29 21:53:57 +02:00
Tanner Linsley
aab0e40082 release: v1.34.6 v1.34.6 2024-05-29 19:29:44 +00:00
Christopher Horobin
ef77cccd58
fix(react-router): merge params, context, search and loaderData with strict: false (#1664)
* feat: merge context, params, search and loaderData when `strict` is false

- objects in context, params, search and loaderData will be merged into object with all properties optional.
- if objects contain conflicting properties they are resolved with unions
- if some unions contain primitives, tuples or arrays they are ignored and are a part of a union

* chore: use `undefined` instead of `{}` for default TLoaderData
2024-05-29 21:27:51 +02:00
Aditya Pandey
8239c01457
test: add playwright testing with CI to start-basic (#1673)
* Add playwright

* Add CI action

* Update lockfile with pnpm version 8.15.8

---------

Co-authored-by: Jason Laster <jason.laster.11@gmail.com>
2024-05-28 14:04:33 -06:00
Tanner Linsley
eeaaeebab0 release: v1.34.5 v1.34.5 2024-05-28 17:37:24 +00:00
Tanner Linsley
2b0135bc7e fix: add onBeforeNavigate event 2024-05-28 11:34:56 -06:00
Tanner Linsley
2f3b28c3a7 release: v1.34.4 v1.34.4 2024-05-27 12:51:20 +00:00
Dominik Dorfmeister
3c66fb545d
fix(router-devtools): make router a peerDependency of the devtools (#1671)
* fix: make router a peerDependency of the devtools

* fix: formatting
2024-05-27 14:49:51 +02:00
Tanner Linsley
04bcc3e19f release: v1.34.3 v1.34.3 2024-05-27 04:58:36 +00:00
Tanner Linsley
0be110012c fix: no more weird streaming APIs, just use suspense + streaming 2024-05-26 22:56:02 -06:00
Tanner Linsley
9102d45730 release: v1.34.2 v1.34.2 2024-05-26 21:26:55 +00:00
Tanner Linsley
317f1eb108 fix: SSR redirects 2024-05-26 15:24:25 -06:00
Tanner Linsley
75424dc004 release: v1.34.1 v1.34.1 2024-05-26 20:16:30 +00:00
Tanner Linsley
1d677df94a fix(start): abstract SSR event handling 2024-05-26 14:08:53 -06:00