Changelog
@ogygia/federation
Every release of @ogygia/federation, newest first.
- Latest
- 0.16.0
- Versions
- 7
0.16.0 minor
Patch Changes
- A fragment's image links now load from the peer on the shell: a
/cdn-cgi/image/…link whose options hold commas stays one srcset candidate, and a/_vercel/image?url=…link (insrc,srcsetor a style'surl()) is pinned to the peer's origin. - A fragment's images load from the app that rendered it: every candidate of a
srcsetand of a preload'simagesrcsetis pinned to the peer's origin, as are paths under/__ogygia__/and image files (.avif,.webp,.png,.jpg,.gif,.svg) named bysrcorhref. Before, those pointed at the host page's server. - A fragment's CSS backgrounds load from the app that rendered it: an image a
styleattribute names withurl(…)(agetImage()background, say) is pinned to the peer's origin. Before, it pointed at the host page's server.
Dependencies: @ogygia/compiler@0.16.0, @ogygia/core@0.16.0, @ogygia/router@0.16.0, @ogygia/machine@0.16.0
0.15.1 patch
Dependency updates only @ogygia/federation
0.15.0 minor
Dependency updates only @ogygia/federation
0.14.0 minor
Minor Changes
@ogygia/federation: Breaking: an app checks the signed calls it receives against itsaudience, or the host of itsORIGINenvironment variable when it sets none, and never against theHostthe request names. With neither, every signed call gets a 401 andfederate()warnsfederation_audience_missing; setaudience(orORIGIN) on each app that peers call into.verify_signed_request()withoutaudiencefollows the same rule.- federation: a signed call also carries one capability token (
x-og-cap): method, path, body hash, claims and audience as length-prefixed fields, a nonce that checks once, signed with Ed25519; a receiver checks a call that has one by it alone, and still accepts a call with only the legacy headers (x-og-ts,x-og-n,x-og-sig) from a peer that has not upgraded yet - -
@ogygia/core,ogygia: breaking:SharedStateis no longer exported fromogygiaor@ogygia/core. Import it from@ogygia/federation/sharedinstead; it works the same. -@ogygia/federation:SharedState(state shared across separate builds on one page) is exported from@ogygia/federation/shared.
Patch Changes
- A peer's asset refs are pinned to its origin only in the attribute values of real tags: text on a peer page that looks like one (a code sample, a comment, script text) reaches the shell as the peer wrote it.
@ogygia/core: Tag and attribute names read from server HTML are lower-cased the way a browser does it, ASCII letters only, sodata-Äsrcanddata-äsrccount as two attributes.@ogygia/federation: A peer tag with two attributes whose names differ only past ASCII (data-Äsrc,data-äsrc) now has each value pinned in its own attribute. Before, the first value was written into the second.- A request body that breaks off mid-upload is a 400 on the profiler's login and on the federation routes (the exposed table, a thaw notice), not a thrown error and a 500.
- The region batch endpoint and federation's routes stop reading a request body once it passes their size cap, also when it is sent without a
content-length(before, such a body was read whole, then refused). - Durations are measured on the monotonic clock: the memory store's TTLs, a federation deploy check's retry wait, the profiler's recording window, deadlines and busy waits, the testing API's wait, and the perf CLI's waits. A wall-clock step no longer moves them.
- -
@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). @ogygia/federation: a shell's pages allow island code from every peer origin infederate({ peers }), replicas included, so peer islands still wake under core's code-origin check (#851).@ogygia/federation: an exposed route table is always asked on the app's own origin. A fragment request whosepathdoes not start with exactly one/answers 400, andsearchis always the query.@ogygia/federation: a deferred remote hole's signature now covers its peer, kind, target and search as separate fields (message version 2). A hole URL minted before the update is refused like any other bad signature; pages rendered after the update carry new ones.- A peer's redirect target is escaped into the "moved" card's link, so a quote in it no longer breaks the attribute.
- A peer page that is not found is now handled one way: it is a 404 wherever the shell still sets the status, and a slot that can't change its status keeps its fallback. A deferred page hole now answers 404 and keeps its fallback (it used to answer 200 and put the peer's not-found page in the region). A streamed
mount({ stream })now shows the "temporarily unavailable" card (it used to put the peer's not-found page inside the 200).mount()andmount.kit()still answer 404, as before. A peer page that moves with a status that is not a redirect (such as 304) is now refused as a bad answer (a 502,federation_peer_answer_invalid) instead of being passed on as a redirect. @ogygia/federation: a signed request'sx-og-sigis accepted only as the canonical base64 of its 64 bytes, so every copy of a signature counts as the same one.- A mounted peer page's title is escaped once: "Tom & Jerry" no longer shows as "Tom & Jerry" in the tab, search results or the error page.
- A federation request (
/og/frag,/og/thaw,/og/fragment/*) that reaches a server before anyfederate()ran there is now said once asfederation_unregistered, instead of a bare 404 with no word. - 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 deferred peer region whose peer fails (an error status, a cut or malformed body, or no answer) no longer answers its hole as an empty success: the hole answers 502, 503 or 504, so the region keeps its fallback and the browser asks again.
- A mounted peer page's head is read as a browser reads it: a title or stylesheet inside a comment is ignored, an unquoted
relcounts, and a meta whose quoted content holds>is carried whole instead of cut. @ogygia/core: Reading tags out of server HTML (the head dedupe, region CSS, hole answers, seed injection, stitching) costs 2 to 53% fewer steps: each tag is read once, a character at a time.@ogygia/federation: Lifting a peer page and pinning its asset refs costs about half the steps: one walk, each tag's attributes read once.- A peer answer that is not its JSON document no longer turns the shell's page into a 500: it is said as
federation_peer_answer_invalid, a static widget shows its boundary card, and a page read or a mutation is a 502. - A peer answer that is JSON but not its document's shape (
{}, a proxy's{"error":…}, a field of another type) is a failed hop like one that does not parse:federation_peer_answer_invalidis said, a static widget shows its boundary card and a page read is a 502 (before, aTypeErrormade the shell's page a 500). - A static widget whose peer answers an error status (4xx or 5xx) no longer turns the shell's page into a 500: it shows its boundary card, the answer is said as
federation_peer_answer_invalid, and a page read or a post passes the peer's own 503 or 504 through (any other error status is still a 502). - A peer region's endpoint is re-pointed through the shell however its tag is written (single quotes, no quotes, spaces around
=, upper case, after a value holding>), and text that only looks like an endpoint inside another value is left alone. - A mounted peer page no longer carries its
ogygia-*metas into the shell's head: the peer's router meta turned on the client router in a shell built withrouter: false, and overrode a shell's own view-transition setting. - A peer page mounted in a shell keeps the context its page set (
createContext's setter, ogygia'ssetContext): it reaches the peer's own islands, scoped to the mounted page. - A page read from a peer whose fetch a thaw or a mutation drops every time no longer fetches forever: after 16 tries it is a 504, said as the new warning
federation_peer_read_dropped. - A server island (or any region with its own endpoint) inside a peer's fragment now shows: the fragment pins its endpoints to its origin, and the shell serves each as a hole of its own that forwards to the peer, instead of asking its own endpoint and getting a 403.
@ogygia/federation: a peer that serves its island code from its own assets origin (a CDN) wakes on the shell: the shell's page allows the origin of each peer fragment's own runtime, taken only from that peer's answer (#856).- A static widget whose peer gives no answer at all (down, unreachable, or past its timeout) no longer turns the shell's page into a 500: it shows its boundary card, and the failure is said as the new warning
federation_peer_unreachable(also for a page read, a post and a deferred region, which answer 504). - A deferred peer region (and any plugin capability) names the key that signed it, as a region hole does: a server of another deployment (a rolling deploy without one shared OGYGIA_SECRET) refuses it as
foreign-key, with the advice that goes with it, instead of as a bad signature. - A plugin's signed hole (federation's
/og/frag) now pays the visitor's region rate budgets as a region hole does: the probe budget before the signature check, the render budget after. A federation hole can now answer 429 with Retry-After under load. @ogygia/federation: a thaw notice whoseid,hoportagsis not the notice's shape is refused with a 400, applies nothing and is passed on to no one (#988).
Dependencies: @ogygia/router@0.14.0, @ogygia/core@0.14.0, @ogygia/compiler@0.14.0, @ogygia/machine@0.14.0
0.13.0 minor
Patch Changes
- The deploy thaw is tried again when its first check fails (the store unreachable, or a peer that never took the notice), instead of being lost until the pages' TTL, and only the peers that missed it are sent it again, for a bounded number of tries (#198).
- After a thaw or a mutation, an old peer request ending no longer removes the newer one, so a read joins it instead of starting another upstream fetch (#210).
- Every ogygia error and warning has a code and a page at
ogygiajs.dev/e/<code>: dev prints the wording and the link, a production build prints the link alone ([ogygia] https://ogygiajs.dev/e/<code>?<args>), so the wording stays out of the client and server bundles. - A peer read that starts while a mutation to that peer is out is no longer kept once the mutation ends, so the poster's next read never gets the page from before their own post (#331).
- A thaw drops only the peer documents it names: a fetch already out for another fragment is kept when it lands, and a caller whose fetch a thaw or a mutation made stale reads the page again instead of getting the old one (#294).
- A publish's thaw notices go through an outbox handed to the request's
waitUntil(the newapp.keepAlive), so a serverless instance that freezes after the response no longer loses them and peers no longer keep stale pages until their TTL (#286). - A peer whose store fails to apply a thaw notice now answers an error, so the sender sends it again, instead of answering done and deduping the retry;
app.notifyrejects once every hook ran when one failed (#287). - A thaw notice that a peer never took, after every retry, now prints
federation_thaw_notice_failedwith the peers that missed it, instead of nothing. - A peer applies two copies of a thaw notice that arrive at once only once, and keeps at most the newest 10 000 notice ids instead of every id for ten minutes (#308).
Dependencies: @ogygia/core@0.13.0, @ogygia/machine@0.13.0, @ogygia/router@0.13.0
0.12.0 minor
0.11.0 minor
Patch Changes
- Remote deferred holes now share local holes' lifetime and renewal: they were signed for a fixed 5 minutes and answered 410 after, so a stored or cached page older than that showed dead remote regions. Plugins sign with core's rule through
app.capability. - A peer-cache refresh that answers an error no longer replaces the good document it was refreshing.
Dependencies: @ogygia/core@0.11.0, @ogygia/router@0.11.0