Repository navigation
feat(isr): check revalidate paths against routes with typedRoutes - #740
Merged
Merged
Conversation
`revalidate({ paths })` now takes `RouteUrl[]`, so with
`routing.typedRoutes` on each path must match one of the app's routes.
With the flag off `RouteUrl` is `string`, so untyped apps see no change.
A path TypeScript cannot check needs `as RouteUrl`, which turns the
check off for that path.
The docs drop the `satisfies RouteUrl[]` workaround for `revalidate`.
`routing.prerender` keeps its existing guidance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cpojer
self-requested a review
November 7, 2026 09:57
cpojer
approved these changes
Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
revalidate({ paths })fromvoid/isrnow checks its paths against the app's routes whenrouting.typedRoutesis on, likeLink, the router methods, andc.rewrite().RevalidateOptions.pathsisRouteUrl[]instead ofstring[]. With the flag off,RouteUrlisstring, so untyped apps see no change.as RouteUrl. The cast turns the check off for that path.routing.prerenderis unchanged. It lives invoid.config.ts, which is outside the app's TypeScript project.Docs
guide/edge/revalidation.mdandreference/api/resources.md: drop thesatisfies RouteUrl[]workaround (from docs: annotate route paths and params in examples #728), say the paths are checked withrouting.typedRoutes, and explain theas RouteUrlescape hatch. The signature now showsRouteUrl[].guide/type-safety.md: addrevalidate({ paths })to "Checked URL strings" and theRouteUrlbullet, and split the "What Gets Checked" row sorevalidateandrouting.prerenderare listed separately.routing.prerenderkeeps itssatisfies RouteUrl[]guidance, now shown in avoid.config.tsexample. The existing cast paragraph now says the cast turns the check off.reference/config.md(routing.typedRoutes): listrevalidate({ paths })among the checked APIs.Tests
route-url-builder.test.ts(typed fixture, through both the generated and package declarations): known paths, a`/users/${id}`template literal, and aRouteUrlpass. An unknown path and a plainstring[]are@ts-expect-error.string[] as RouteUrl[]passes. I checked that the new@ts-expect-errorlines fail against the oldstring[]declaration.typed-navigation.typecheck.ts: with the flag off, a plainstring[]and an unknown path still pass.Verification: the focused test passes, as do
vp run check,vp run test, andvp test run(781 files, 16,156 tests).🤖 Generated with Claude Code