Repository navigation
Conversation
This branch has not been deployed
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.
What changed
Scope filesystem-route middleware, layout, error, and route segments to the mount path while compiling commands. This prevents multiple
fsRoutes()mounts from sharing the same root segment and ensures each mounted route keeps its own middleware chain.Add a regression test covering three mounts of the same route tree at
/,/a/foo, and/b/foo.Why
Without the mount prefix, each
_middleware.tscommand is attached to the same segment. A request to the root ran the middleware once per mount. Prefixing only the middleware segment would make mounted routes lose their middleware, so route segment lookup uses the same mounted path as well.Validation
/,/a/foo, and/b/fooeach run the middleware once.npx deno test -A packages/fresh/src/probe_3908_test.tsx packages/fresh/src/fs_routes_test.tsx: 57 passed, 1 ignored.deno fmt --check packages/fresh/src/commands.ts packages/fresh/src/fs_routes_test.tsx: passed.deno lint packages/fresh/src/commands.ts packages/fresh/src/fs_routes_test.tsx: passed.deno check --allow-import packages/fresh/src/commands.ts packages/fresh/src/fs_routes_test.tsx: passed.deno task okreaches the formatting gate but is blocked by pre-existing formatting drift inwww/static/prism.cssandwww/static/docsearch.css; neither file is part of this change.Fixes #3908