Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preload type fix (naive type change) #3526

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ducin
Copy link
Contributor

@ducin ducin commented Feb 22, 2025

This PR is meant to bring the preload options to reflect the possible values listed in both defaultPreload (below) and the docs (https://tanstack.com/router/v1/docs/framework/react/guide/preloading#supported-preloading-strategies).

Currently the preload in createFileRoute allows only to pass boolean which seems wrong (see above):

UpdatableRouteOptions:

preload?: boolean

vs

RouterOptions:

  defaultPreload?: false | 'intent' | 'viewport' | 'render'

state of this PR

due to flaky e2e tests I'm unable to get them running. I've got one e2e server functions test (nx run tanstack-start-e2e-server-functions:test:e2e, unrelated to the change) failing on 30s timeout: https://nx.app/runs/0YaAbzz0il

I need help here.

@ducin
Copy link
Contributor Author

ducin commented Feb 22, 2025

Hopefully this gets unblocked after #3528 gets merged by @schiller-manuel

@schiller-manuel
Copy link
Contributor

we are currently moving stuff into router-core since we now not only have the react impl but also the solid one (more to come...)

so i am a bit hesitant to merge this. if we merge this, we would also need to apply the same change to the solid one.

@ducin ducin force-pushed the route-preload-type-fix branch from 0b55eaa to 92038aa Compare February 22, 2025 22:41
Copy link

nx-cloud bot commented Feb 22, 2025

View your CI Pipeline Execution ↗ for commit 92038aa.

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

☁️ Nx Cloud last updated this comment at 2025-02-22 22:48:19 UTC

@ducin
Copy link
Contributor Author

ducin commented Feb 22, 2025

@schiller-manuel how about doing it in the router-core: is it doable now or when (what is the status of the refactor?

BTW I guess the change does make sense, right?

Copy link

pkg-pr-new bot commented Feb 22, 2025

Open in Stackblitz

More templates

@tanstack/arktype-adapter

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

@tanstack/create-router

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

@tanstack/create-start

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

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/react-cross-context

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

@tanstack/react-router

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

@tanstack/router-cli

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

@tanstack/react-router-with-query

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-cross-context

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

@tanstack/solid-router

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

@tanstack/start

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

@tanstack/start-api-routes

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

@tanstack/start-client

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

@tanstack/start-config

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

@tanstack/start-plugin

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

@tanstack/start-router-manifest

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

@tanstack/start-server

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

@tanstack/start-server-functions-client

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

@tanstack/start-server-functions-fetcher

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

@tanstack/start-server-functions-handler

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

@tanstack/start-server-functions-server

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

@tanstack/start-server-functions-ssr

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 92038aa

@schiller-manuel
Copy link
Contributor

the change makes sense. we should however probably have only a single type that we reference for both the default and the route level prop.
the refactor is ongoing, @chorobin is on it. cannot give you an ETA but we are hoping to have it soon since the duplication right now will not work out.

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.

2 participants