-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: Make buildLocation aware of non-changing routes #4573
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
fix: Make buildLocation aware of non-changing routes #4573
Conversation
View your CI Pipeline Execution ↗ for commit 39b9606
☁️ Nx Cloud last updated this comment at |
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-with-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-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/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
…ects-to-base-path' into resolve-navigate({-to-.-})-redirects-to-base-path # Conflicts: # packages/router-core/src/router.ts
looks good! can you please add a test that changes path params like this |
great. I've added the test. will send through momentarily |
…ects-to-base-path' into resolve-navigate({-to-.-})-redirects-to-base-path # Conflicts: # packages/router-core/src/router.ts
an index route cannot have child routes really. although this might somehow work it's better to use a different structure. |
can you please use getByTestId instead of role /text based lookup? we write new tests based on this (and hopefully port the old ones eventually) |
done and done |
thanks a lot! |
@nlynzaad Thanks for looking into this! This code is still failing for me with the latest version Example: const shareRecipeId = useSearch({
from: "/$lang/_app",
select: (search) => search._shareRecipeId,
});
navigate({
to: ".",
search: (prev) => ({
...prev,
_shareRecipeId: undefined,
}),
resetScroll: false,
}); Instead of remaining on the same page, it navigates to Do you have any insights into why this is causing problems? If not, I can look into the test in the next few days. Thanks! |
@checkerschaf from the looks of it, it should be covered by the update. However it differs slightly to the previous in the it rerouted to "/" in your case it's back to "/$lang" and might have small detail that was missed. Please can you open a new issue with a reproducible example or test. |
This is an attempt to resolve #4526 by making buildLocation aware of the fact that even though there is a "to" path the route is not always changing. This is specifically the case with to="." navigations.
This also adds a test largely based on the test provided by amargielewski
fixes #4526