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

6,597 commits

Author SHA1 Message Date
Sean Cassiere
a9874aad26
fix(router-plugin): add the rspack/rsbuild handler for file-based routing (#1794)
* feat: setup the starter for an rspack integration

* refactor(router-plugin): compose the plugins toghether

* feat(router-plugin): initial export for rspack

* docs(examples): add the quickstart-file-based pages in

* feat(router-plugin): generator should generate the route-tree on startup

* feat(examples): use the route-tree

* feat(router-plugin): router-generator working

* feat(router-plugin): rspack support only for the generator

* refactor(router-plugin): make the rspack exports a bit cleaner

* chore(router-plugin): jsdocs for the vite plugin

* docs(router-plugin): update with references and mentions to rspack/rsbuild

* style(router-plugin): eslint import ordering 😭
2024-06-21 11:51:08 +12:00
Tanner Linsley
6aa18f28d7 release: v1.39.8 v1.39.8 2024-06-20 22:19:43 +00:00
Christopher Horobin
7cbaf728c7
perf(react-router): remove TRouterContext for each route, lazily infer parent for merging and remove TParentRoute from options (#1780)
* perf(react-router): remove router context from every route apart from the root

From my understanding, TRouterContext is only relevant to the RootRoute and is not relevant to each route

* perf: remove TParentRoute from file route options, infer lazily from parent and fix merging of context in beforeLoad/loader

* tests: add type tests for root route merging of context and buildLocation

* tests: add more tests and cleanup
2024-06-21 00:16:47 +02:00
Manuel Schiller
e24cd7616b
ci: Enable nx cloud again (#1800) 2024-06-21 00:05:52 +02:00
Tanner Linsley
8a2b364440 release: v1.39.7 v1.39.7 2024-06-20 21:57:58 +00:00
Manuel Schiller
8149575074
fix: linking with from prop and a param containing slash (#1799)
* Add test case for linking with from prop and a param containing slash

* Remove .only from test

* fix: encode pathname in match

* refactor: move encoded params to interpolatePath

---------

Co-authored-by: Jakob Norlin <jakob.stahl91@gmail.com>
Co-authored-by: chorobin <chrishorobin@hotmail.com>
2024-06-20 23:55:02 +02:00
Manuel Schiller
a095cd59fb
ci: test matrix uses released TS 5.5 version 2024-06-20 23:45:35 +02:00
Tanner Linsley
ea31fc4eeb release: v1.39.6 v1.39.6 2024-06-20 21:39:09 +00:00
Anton Zinovyev
477bc99ea3
fix: proper basename removal handling (#1787)
fixes #1779
2024-06-20 23:36:13 +02:00
Sean Cassiere
ee48ae2aa1
docs: update the documentation on the @tanstack/router-plugin package (#1793)
* docs: update the file-based routing guide

* docs: update the quick-start guide

* docs: update the migrate from react-location guide

* docs: more updates to the migration from react-location guide

* docs: update the code-splitting guide

* docs: update the routing concepts guide

* docs: broken link on the code-splitting guide
2024-06-20 11:24:28 +12:00
Manuel Schiller
e088dde55c
ci: disable NX cloud for now 2024-06-20 00:01:34 +02:00
Tanner Linsley
b575985937 release: v1.39.5 v1.39.5 2024-06-19 11:09:20 +00:00
Sean Cassiere
149dbf8801
refactor(router-plugin): base should only export the individual unplugin factories and not the PURE compilations (#1789)
* refactor(router-plugin): vite default export

* refactor(router-plugin): only export the factories

* style(router-plugin): eslint...
2024-06-19 23:07:23 +12:00
Sean Cassiere
13a0cc0631
docs: update the custom search param serialization guide (#1759)
* docs: update the custom search param serialization guide

* docs: move the image a bit further down

* docs: remove the image
2024-06-19 21:32:57 +12:00
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