Repository navigation
docs(routing): document boot errors for overlapping constraints (core #127) - #24
Merged
Merged
Conversation
… #127) Core now refuses to boot two kinds of sibling routes. In the first, two constrained params accept a common segment, so only declaration order would choose between them. In the second, a plain param sits next to a constraint that accepts every segment, so the plain route can never be reached. The routing guide gets a section on both errors, with their messages and the witness they print. The section also covers: - the constrained fallback (/u/:id(\d+) + /u/:slug), which still boots; - why .* does not count as every segment; - WebSocket's declaration-order precedence; - mesh teapots. The mesh guide links to it from "One teapot per route". Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
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.
Companion to core issue #127 (FPRD-001b, CARD-13). Core now fails
createAppon two kinds of sibling routes. These pages say what the errors mean and what to do about them.Changes
guides/routing.md: new section, "Overlapping constraints fail at boot".both match '0' (GET /u/0)). Equivalent spellings (\d+and[0-9]+) count. A later segment that tells the routes apart keeps them bootable.[^]*). Explains why.*is not that:.does not match line terminators, so/algo/%0Astill reaches the plain route./u/:id(\d+)+/u/:slugstill boots./u/42goes to:idand/u/bobgoes to:slug.@Streamis checked as both HTTP and WS.guides/mesh.md: in "One teapot per route", a short paragraph links to the new section and shows the mesh form of the ambiguous error.Checks
npm audit --audit-level=moderate: 0 vulnerabilities, and no open Dependabot alerts, checked before branching.npm run build: 27 pages built. The new heading anchor#overlapping-constraints-fail-at-bootis present in the built HTML, and the mesh guide links to it.The error messages quoted on these pages match the core implementation word for word. Only the declaration names (
Users.byIdand similar) are illustrative.