@ogygia/router

AllMajorMinorPatch Show pre-releases
0.14.0 minor

@ogygia/router

Minor Changes

  • #715 9604456 Thanks @PuruVJ! - @ogygia/router, @ogygia/flags: Breaking: anonymousVisitor() returns { vid, anonymous: true } and never fills sub, which stays a signed-in user's id (so mount() never signs a cookie value onward as one). Flags hash on sub, else vid (an anonymous visitor keeps its bucket), the og-vid cookie reaches a source as { vid, anonymous: true }, and the default openfeature() / ofrep() context sends vid as targetingKey when there is no sub. Code that read c.visitor.sub for anonymous visitors reads c.visitor.vid; exposure events from them arrive without a sub.
  • #1143 c9dc308 Thanks @PuruVJ! - @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]]/docs ranks as /docs; /b beats /b/[[page]]; ties go by route id, never table order), and CompiledPattern no longer has a score field.
  • #1842 b6b930e Thanks @PuruVJ! - These methods are now typed as function properties, so passing one on by itself (const { handle } = router) type-checks under unbound-method; none of them used this. 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 / .decode and the ref entry's encode / decode (@ogygia/core), CapabilitySigner.sign / .verify (@ogygia/core), Router.handle (@ogygia/router), Signer.sign / .verify and Staging.discard (@ogygia/machine).

Patch Changes

  • #533 49ff074 Thanks @PuruVJ! - - @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/compiler and @ogygia/core/internal/compiler-ids import paths are gone. Import from ogygia/vite (or @ogygia/compiler/vite), @ogygia/compiler and @ogygia/compiler/ids instead; the names are the same. - @ogygia/core: the types of the ogygia:* 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/compiler and ogygia/internal/compiler-ids re-export @ogygia/compiler; apps change nothing. - @ogygia/barrels, @ogygia/cli, @ogygia/content, @ogygia/devtools, @ogygia/federation, @ogygia/flags, @ogygia/postrender, @ogygia/router: they take definePlugin and the compiler from @ogygia/compiler, a new peer dependency (ogygia brings it).
  • #1142 2ea1252 Thanks @PuruVJ! - href(), api() and entries() 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.
  • #1457 620d27e Thanks @PuruVJ! - The head's end is found as the browser reads it: an app.html that 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.
  • #878 08fd293 Thanks @PuruVJ! - 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.
  • #1100 4dfe7a7 Thanks @PuruVJ! - api(), href() and entries() throw on a param of . or .. that fills a whole path segment, instead of building a URL that names another route (/users/[id]/delete with id: '..' asked /delete).
  • #700 ff753ff Thanks @PuruVJ! - @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-z on [a]-[b] gives a: 'x', b: 'y-z'; /p-q-x-r on [a]-x-[b] gives a: 'p-q', b: 'r'). Paths longer than 8192 characters match no route.
  • #1186 033654a Thanks @PuruVJ! - 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.
  • #1760 770cbb4 Thanks @PuruVJ! - c.json() and c.text() keep the headers they are given as a Headers object or as pairs, and a Content-Type you pass (in any case) replaces the default instead of joining it.
  • #701 a0a50ed Thanks @PuruVJ! - @ogygia/router: the trailing-slash redirect (slash: 'never' | 'always') always points at a path on this origin: its Location starts with exactly one / and holds no \.
  • #1227 69bd68d Thanks @PuruVJ! - A form POST naming an action the page does not have (?/delete on a page with only default) now answers 404, as in Kit. It ran the default action instead.

Updated dependencies: @ogygia/[email protected], @ogygia/[email protected], @ogygia/[email protected]

0.13.0 minor

@ogygia/router

Patch Changes

  • #226 019b77e Thanks @PuruVJ! - 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).
  • #321 17e009a Thanks @PuruVJ! - api() rejects when a successful answer's JSON body does not parse, instead of resolving undefined.
  • #306 8b33368 Thanks @PuruVJ! - A streamed page whose visitor leaves stops: its generator and every late-region source end, and nothing more renders (#284).
  • #321 17e009a Thanks @PuruVJ! - A streamed page's source whose cleanup throws as the visitor leaves now prints request_cleanup_failed with the error, instead of nothing.
  • #184 1767110 Thanks @PuruVJ! - Packages declare sideEffects (only their .css files run on import), so bundlers drop the modules an app never uses.

Updated dependencies: @ogygia/[email protected], @ogygia/[email protected]

0.12.0 minor

@ogygia/router

Updated dependencies: @ogygia/[email protected]

0.11.0 minor

@ogygia/router

Updated dependencies: @ogygia/[email protected]

0.0.0 minor

@ogygia/router