-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
refactor(router-core): skip beforeLoad/loader store updates if these options aren't provided #4920
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
base: main
Are you sure you want to change the base?
Conversation
|
Command | Status | Duration | Result |
---|---|---|---|
nx affected --targets=test:eslint,test:unit,tes... |
❌ Failed | 5m 45s | View ↗ |
nx run-many --target=build --exclude=examples/*... |
✅ Succeeded | 40s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-08-11 17:36:51
UTC
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-ssr-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-plugin
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-ssr-query-core
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-plugin
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-server-functions-client
@tanstack/start-server-functions-fetcher
@tanstack/start-server-functions-server
@tanstack/start-storage-context
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
Following #4916, this PR keeps reducing the number of store updates (
__store.setState
throughupdateMatch
).route.options.beforeLoad()
call, and relatedupdateMatch
calls before and after, ifbeforeLoad
is not specifiedroute.options.loader()
call, and relatedupdateMatch
calls before and after, ifloader
is not specifiedroute.options.head()
,route.options.scripts()
, androute.options.headers()
calls, and relatedupdateMatch
call after, if these options are not specifiedAdditionally,
head
,scripts
andheaders
are now called in parallel. They don't depend on one another, and so there is no reason to delay their execution by calling them serially.The
store-updates-during-navigation
test tracking the number of executions of auseRouterState > select
method during a navigation goes from 19 calls without this PR, to 14 calls with this PR.Should be a partial improvement of #4359