Changelog
@ogygia/router
Every release of @ogygia/router, newest first.
- Latest
- 0.16.0
- Versions
- 6
0.16.0 minor
Dependency updates only @ogygia/router
0.14.0 minor
Minor Changes
@ogygia/router,@ogygia/flags: Breaking:anonymousVisitor()returns{ vid, anonymous: true }and never fillssub, which stays a signed-in user's id (somount()never signs a cookie value onward as one). Flags hash onsub, elsevid(an anonymous visitor keeps its bucket), theog-vidcookie reaches a source as{ vid, anonymous: true }, and the defaultopenfeature()/ofrep()context sendsvidastargetingKeywhen there is nosub. Code that readc.visitor.subfor anonymous visitors readsc.visitor.vid; exposure events from them arrive without asub.@ogygia/router: Breaking: when route patterns overlap, a path now resolves to the route SvelteKit would pick for the same files (an[[optional]]that is not last counts for nothing, so/[[lang]]/docsranks as/docs;/bbeats/b/[[page]]; ties go by route id, never table order), andCompiledPatternno longer has ascorefield.- These methods are now typed as function properties, so passing one on by itself (
const { handle } = router) type-checks underunbound-method; none of them usedthis. A method type was bivariant in its parameters and a function property is checked strictly, so code that assigned a narrower function to one of them may now need its parameter types widened. The changed types:ogygiaTransport.Region.encode/.decodeand the ref entry'sencode/decode(@ogygia/core),CapabilitySigner.sign/.verify(@ogygia/core),Router.handle(@ogygia/router),Signer.sign/.verifyandStaging.discard(@ogygia/machine).
Patch Changes
- -
@ogygia/compiler: new package, ogygia's compiler and its Vite plugin:@ogygia/compiler(the compiler),@ogygia/compiler/vite(ogygia(),definePlugin) and@ogygia/compiler/ids. It uses core only through@ogygia/core/contract; core never depends on it. -@ogygia/core: breaking: the@ogygia/core/vite,@ogygia/core/internal/compilerand@ogygia/core/internal/compiler-idsimport paths are gone. Import fromogygia/vite(or@ogygia/compiler/vite),@ogygia/compilerand@ogygia/compiler/idsinstead; the names are the same. -@ogygia/core: the types of theogygia:*virtual modules and the build's switches are named in core (@ogygia/core/contract), so core's own types no longer reach into the compiler. -ogygia:ogygia/vite,ogygia/internal/compilerandogygia/internal/compiler-idsre-export@ogygia/compiler; apps change nothing. -@ogygia/barrels,@ogygia/cli,@ogygia/content,@ogygia/devtools,@ogygia/federation,@ogygia/flags,@ogygia/postrender,@ogygia/router: they takedefinePluginand the compiler from@ogygia/compiler, a new peer dependency (ogygiabrings it). href(),api()andentries()write a route's URL as Kit does: a[...rest]value keeps its slashes (each segment encoded, no more%2F), and an empty[[optional]]or[...rest]segment is dropped (/a/b, not/a//b). A rest value with an empty piece (a leading, trailing or doubled/) or a./..piece throws, and so does a param that fills a segment other than the last one empty, so a filled URL never names another origin or another route.- The head's end is found as the browser reads it: an
app.htmlthat writes</HEAD>gets ogygia's head injections, and a</head>inside a head script's text (a JSON-LD string) no longer takes them into the script. The body's end is found in any case. - A streamed page whose head closes as
</head >(space or newline before>) gets its late boot, and a comment naming</head>before the page no longer takes it. api(),href()andentries()throw on a param of.or..that fills a whole path segment, instead of building a URL that names another route (/users/[id]/deletewithid: '..'asked/delete).@ogygia/router: a route segment with several params ([a]-[b]-[c]) matches in time in line with the path, and splits as SvelteKit's lazy params do (/x-y-zon[a]-[b]givesa: 'x',b: 'y-z';/p-q-x-ron[a]-x-[b]givesa: 'p-q',b: 'r'). Paths longer than 8192 characters match no route.- A route load that fails runs once per request: the error page no longer runs it again to find the failed layout (its side effects ran twice, and a flaky load that passed the second time put the error page in the wrong layout). A later call to the same load in that request gets the same failure.
c.json()andc.text()keep the headers they are given as aHeadersobject or as pairs, and aContent-Typeyou pass (in any case) replaces the default instead of joining it.@ogygia/router: the trailing-slash redirect (slash: 'never' | 'always') always points at a path on this origin: itsLocationstarts with exactly one/and holds no\.- A form POST naming an action the page does not have (
?/deleteon a page with onlydefault) now answers 404, as in Kit. It ran the default action instead.
Dependencies: @ogygia/core@0.14.0, @ogygia/compiler@0.14.0, @ogygia/machine@0.14.0
0.13.0 minor
Patch Changes
- A streamed page drains its late regions until nothing new registers: a late region that resolves to a region holding another promise region streams that one down the same response too, instead of leaving an empty slot nothing fills (#199).
api()rejects when a successful answer's JSON body does not parse, instead of resolvingundefined.- A streamed page whose visitor leaves stops: its generator and every late-region source end, and nothing more renders (#284).
- A streamed page's source whose cleanup throws as the visitor leaves now prints
request_cleanup_failedwith the error, instead of nothing. - Packages declare
sideEffects(only their.cssfiles run on import), so bundlers drop the modules an app never uses.
Dependencies: @ogygia/core@0.13.0, @ogygia/machine@0.13.0
0.12.0 minor
Dependency updates only @ogygia/router
0.11.0 minor
Dependency updates only @ogygia/router