feat(jarl-atoms): 927 — enumRouteAtom binds a path segment from a fixed set of values - #111
Open
randomdevpete wants to merge 2 commits into
Open
Conversation
…ed set of values Ticket: 927
… the unchecked name casts Ticket: 927
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.
Adds
enumRouteAtom, a route primitive that binds one path segment to a value drawn from a fixed set, typed as the union of that set rather than asstring. Adopts it on the docs site's/docsand/apiroutes.enumRouteAtom, not the ticket's workingoneOfRouteAtom.enumis the ecosystem's word for a value drawn from a fixed set of strings (JSON Schema/OpenAPIenum,z.enum), and it keeps the segment constructors named for the segment kind: static, param, numeric, enum. "one of" names a choice between whole alternatives, which is exactly what PR feat(jarl-atoms)!: 420 — unionRouteAtom, and notAtom taking one route plus options #110'sunionRouteAtomdoes — two near-synonyms in one export list invite reaching for the wrong one. One commit to rename if OWNER prefers the original.unionRouteAtom, not overlapping. A union of static routes binds no values (RouteValuesof a static route is{}), so it can be neither switched on nor navigated by value. Neither subsumes the other./docsand/apiadoption drops two uncheckedascasts and turns an unknown guide name from a 200-with-a-not-found-body into a real 404.The ticket's second "Done when" — simplifying ticket 678's demo — is not doable on this base, because
SwitchRoutingApp.tsxlives only onorigin/task-678-very-simple-logic-switch-routing-demo, a separate stack offmaster. Whichever lands second collapses that demo'sparamRouteAtom+transformRouteAtom+isSwitchRoutingPageinto oneenumRouteAtomcall — a five-line deletion.