Skip to content

Conversation

chorobin
Copy link
Contributor

Migrates many types over but there is still a lot to do D:

Copy link

nx-cloud bot commented Feb 23, 2025

View your CI Pipeline Execution ↗ for commit 86e9ae7.

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 4m 57s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 21s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-23 22:09:24 UTC

Copy link

pkg-pr-new bot commented Feb 23, 2025

Open in Stackblitz

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@3538

@tanstack/create-router

npm i https://pkg.pr.new/@tanstack/create-router@3538

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/@tanstack/directive-functions-plugin@3538

@tanstack/create-start

npm i https://pkg.pr.new/@tanstack/create-start@3538

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@3538

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@3538

@tanstack/react-cross-context

npm i https://pkg.pr.new/@tanstack/react-cross-context@3538

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@3538

@tanstack/react-router-with-query

npm i https://pkg.pr.new/@tanstack/react-router-with-query@3538

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@3538

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@3538

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@3538

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@3538

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@3538

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@3538

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@3538

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/@tanstack/server-functions-plugin@3538

@tanstack/solid-cross-context

npm i https://pkg.pr.new/@tanstack/solid-cross-context@3538

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@3538

@tanstack/start

npm i https://pkg.pr.new/@tanstack/start@3538

@tanstack/start-api-routes

npm i https://pkg.pr.new/@tanstack/start-api-routes@3538

@tanstack/start-client

npm i https://pkg.pr.new/@tanstack/start-client@3538

@tanstack/start-config

npm i https://pkg.pr.new/@tanstack/start-config@3538

@tanstack/start-plugin

npm i https://pkg.pr.new/@tanstack/start-plugin@3538

@tanstack/start-router-manifest

npm i https://pkg.pr.new/@tanstack/start-router-manifest@3538

@tanstack/start-server

npm i https://pkg.pr.new/@tanstack/start-server@3538

@tanstack/start-server-functions-client

npm i https://pkg.pr.new/@tanstack/start-server-functions-client@3538

@tanstack/start-server-functions-fetcher

npm i https://pkg.pr.new/@tanstack/start-server-functions-fetcher@3538

@tanstack/start-server-functions-handler

npm i https://pkg.pr.new/@tanstack/start-server-functions-handler@3538

@tanstack/start-server-functions-server

npm i https://pkg.pr.new/@tanstack/start-server-functions-server@3538

@tanstack/start-server-functions-ssr

npm i https://pkg.pr.new/@tanstack/start-server-functions-ssr@3538

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@3538

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@3538

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@3538

commit: 86e9ae7

@schiller-manuel schiller-manuel self-requested a review February 23, 2025 20:13
Constrain,
ConstrainLiteral,
RootRoute as CoreRootRoute,
Route as CoreRoute,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we follow this and prefix all of these imports from router-core with Core? or is the DX without adding this prefix fine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh this was just a way for me to alias the Route type in core but keep the current Route class in this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping to settle this in a later pr because I am still not sure how the runtime will end up in core. We might still need a class in react-router and core, I really do not know

@@ -17,7 +17,7 @@ const postRoute = createFileRoute('/_postLayout/posts/$postId_')()

const protectedRoute = createFileRoute('/(auth)/protected')()

declare module '../src/fileRoute' {
declare module '@tanstack/router-core' {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we move the type test to router-core as well?

Copy link
Contributor Author

@chorobin chorobin Feb 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can in another pr. atm I don't want to change them too much because I want to rely on them to check I haven't broken anything

Copy link
Contributor

@schiller-manuel schiller-manuel Feb 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no worries, just trying to understand where you are heading
i just hope we can limit duplication to the absolut minimum, and this also includes tests

@chorobin chorobin merged commit 72b505c into main Feb 23, 2025
7 checks passed
@chorobin chorobin deleted the types-migrate-to-core branch February 23, 2025 22:18
@SimenB
Copy link
Contributor

SimenB commented Feb 24, 2025

Presumably this change is the reason for this error?

node_modules/@tanstack/react-router/dist/esm/fileRoute.d.ts:45:120 - error TS2344: Type 'RouteById<RootRoute<undefined, { queryClient: QueryClient; }, AnyContext, AnyContext, {}, undefined, RootRouteChildren, FileRouteTypes>, TId>' does not satisfy the constraint 'AnyRoute'.
  Type 'RootRoute<undefined, { queryClient: QueryClient; }, AnyContext, AnyContext, {}, undefined, unknown, unknown> | Route<RootRoute<undefined, { queryClient: QueryClient; }, ... 5 more ..., unknown>, ... 12 more ..., unknown> | Route<...> | Route<...> | Route<...> | Route<...>' is not assignable to type 'Route<any, any, any, any, any, any, any, any, any, any, any, any, any, any>'.
    Type 'RootRoute<undefined, { queryClient: QueryClient; }, AnyContext, AnyContext, {}, undefined, unknown, unknown>' is not assignable to type 'Route<any, any, any, any, any, any, any, any, any, any, any, any, any, any>'.
      The types returned by 'update(...)' are incompatible between these types.
        Type 'RootRoute<undefined, { queryClient: QueryClient; }, AnyContext, AnyContext, {}, undefined, unknown, unknown>' is not assignable to type 'RouteById<RootRoute<undefined, { queryClient: QueryClient; }, AnyContext, AnyContext, {}, undefined, RootRouteChildren, FileRouteTypes>, TId>'.

45 export declare function createLazyRoute<TId extends RouteIds<RegisteredRouter['routeTree']>, TRoute extends AnyRoute = RouteById<RegisteredRouter['routeTree'], TId>>(id: TId): (opts: LazyRouteOptions) => LazyRoute<TRoute>;
                                                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We do

createRootRouteWithContext<{ queryClient: QueryClient }>()(
  {
    component: Root,
    wrapInSuspense: true,
  },
);

removing the context generic "fixes" the problem.

Keeping @tanstack/react-router at 1.109.2 works, even if @tanstack/router-* is at 1.111.3

@schiller-manuel
Copy link
Contributor

@SimenB can you please open a new GitHub issue and attach a minimal example? our tests and examples did not hit that issue so we need to have a look at what you are doing differently

@SimenB
Copy link
Contributor

SimenB commented Feb 24, 2025

The basic example fails if you remove skipLibCheck: true: https://tanstack.com/router/v1/docs/framework/react/examples/basic-react-query

image

@SimenB
Copy link
Contributor

SimenB commented Feb 25, 2025

Seems to be fixed in 1.111.7 👍

@birkskyum birkskyum mentioned this pull request Feb 25, 2025
10 tasks
schiller-manuel pushed a commit that referenced this pull request Mar 1, 2025
This PR introduce support for Solid to be used with TanStack Start.

There are several ongoing refactors that can influence the timing of
when it's most feasible to merge this.

### Status (build and run e2e/solid-start/basic)
- [X] SSR
- [x] API Routes
- [x] Server Functions
- [x] HMR
- [x] Streaming (/stream route)
- [X] Timely hydration

### Ongoing refactors

Refactor to make router packages (aka. client-only features) more
agnostic:
- #3552
- #3540
- #3538
- #3171

Refactor to make start packages (aka. server features) more agnostic:
- #3546 
- #3563 
- #3565 

### Upstream changes to solid-router
- #3592
- #3591
- #3589
- #3616 

### Passing E2E test suites
- [x]  basic
- [x]  website
- [x] scroll-restoration
- [x] server-functions

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
Co-authored-by: Iha Shin <me@xiniha.dev>
Co-authored-by: Brenley Dueck <brenley@crowdbotics.com>
leesb971204 pushed a commit to leesb971204/router that referenced this pull request Apr 16, 2025
…lid-router to router-core (TanStack#3538)

Migrates many types over but there is still a lot to do D:

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
leesb971204 pushed a commit to leesb971204/router that referenced this pull request Apr 16, 2025
This PR introduce support for Solid to be used with TanStack Start.

There are several ongoing refactors that can influence the timing of
when it's most feasible to merge this.

### Status (build and run e2e/solid-start/basic)
- [X] SSR
- [x] API Routes
- [x] Server Functions
- [x] HMR
- [x] Streaming (/stream route)
- [X] Timely hydration

### Ongoing refactors

Refactor to make router packages (aka. client-only features) more
agnostic:
- TanStack#3552
- TanStack#3540
- TanStack#3538
- TanStack#3171

Refactor to make start packages (aka. server features) more agnostic:
- TanStack#3546 
- TanStack#3563 
- TanStack#3565 

### Upstream changes to solid-router
- TanStack#3592
- TanStack#3591
- TanStack#3589
- TanStack#3616 

### Passing E2E test suites
- [x]  basic
- [x]  website
- [x] scroll-restoration
- [x] server-functions

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
Co-authored-by: Iha Shin <me@xiniha.dev>
Co-authored-by: Brenley Dueck <brenley@crowdbotics.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants