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

6,533 commits

Author SHA1 Message Date
Tanner Linsley
e01087ec55 release: v1.39.4 v1.39.4 2024-06-19 08:06:48 +00:00
Sean Cassiere
05d1a1d4c6
refactor(router-vite-plugin): proxy for re-exporting from @tanstack/router-plugin/vite (#1785)
* chore: this route-tree has not been generated

* chore: remove tests

* refactor(router-plugin): export configSchema

* refactor(start): use the exports from router-plugin

* refactor(router-vite-plugin): just a proxy doing exports

* fix(router-plugin): do not perform code-splitting unless perms are given
2024-06-19 20:04:57 +12:00
Sean Cassiere
38b748878a
build: remove nx cloud temporarily (#1786) 2024-06-19 20:02:03 +12:00
Turner
c100f369ff
deprecate(react-router): mark navigate as deprecated in the BeforeLoadFn type definition (#1767)
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
2024-06-19 18:31:56 +12:00
Tanner Linsley
8d13e7eeee release: v1.39.3 v1.39.3 2024-06-19 05:55:54 +00:00
Sean Cassiere
e5d8b815db
fix(router-plugin): inline-config should be optional (#1783)
* fix(router-plugin): package.json fields causing issues during imports

* fix: make the inlineConfig optional

* chore: trigger ci

* chore: try ci again

* chore: add a better readme

* test: just something to trigger CI honestly
2024-06-19 17:53:55 +12:00
Tanner Linsley
459a6d4e79 release: v1.39.2 v1.39.2 2024-06-19 03:45:03 +00:00
Sean Cassiere
40043475cf
refactor: setup the @tanstack/router-plugin package using "unplugin" (#1778)
* feat: scaffold the new `@tanstack/router-plugin` package

* chore: include in the overrides

* feat: more scaffolding

* test: just a random test that'll be removed later

* build: hopefully fixes build

* style: import order

* chore: peer deps for router-plugin

* feat: setup the generator

* refactor: combined needs to be done for the individual plugin

* chore: copy all the babel stuff over from router-vite-plugin

* feat: copy the babel plugin setup from router-plugin

* feat: enfore pre

* refactor: turn the error into its own custom one

* style: eslint

* style: more eslint

* chore: update the readme
2024-06-19 15:43:31 +12:00
Tanner Linsley
12531fd08e release: v1.39.1 v1.39.1 2024-06-18 06:26:18 +00:00
Sean Cassiere
9017fe0c9c
refactor(router-vite-plugin): remove the start logic from @tanstack/router-vite-plugin and update @tanstack/start with the new imports (#1771)
* refactor: remove start logic

* refactor: use `@tanstack/start-vite-plugin` in `@tanstack/start`

* chore: trigger ci

* chore: remove this

* try that again

* ...

* maybe

* interrupt

* chore: remove this
2024-06-18 18:24:50 +12:00
Sean Cassiere
9412432785
build: upgrade nx to 19.3.0 (#1773)
* upgrade to 19.3.0

* remove deprecated field
2024-06-18 18:17:33 +12:00
Tanner Linsley
90b09a0330 release: v1.39.0 v1.39.0 2024-06-18 02:21:26 +00:00
Sean Cassiere
1f35bcbfa8
feat(start-vite-plugin): copy the TanStack Start specific plugin logic into its own standalone vite plugin (#1768)
* copy the router-vite-plugin into start-vite-plugin

* test: remove the tests we dont need

* export config-name from generator

* undo that last one

* reduce this down

* eliminate the router logic

* undo the touches to the generator and cli

* move this down here

* eslint

* chore: remove deps that are not needed

* test: test for createServerFn being renamed during the destructured import

* fix: handle destructured rename case

* test: handle star imports

* chore: push

* chore: remove this
2024-06-18 14:19:57 +12:00
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