Tests / @ogygia/rewrite

@ogygia/rewrite

243 test runs (243 tests, each run in Node, the browsers or both)
1.29× lines of test for each line of source (4,553 to 3,517) Only real test code counts: test files and their helpers, not fixtures, sample apps or benches. Blank lines are left out on both sides.
Exactly what is counted non-blank lines of test code across the repo (*.test.ts, *.test-d.ts, *.spec.ts, and the .ts helpers in test/ and e2e/ folders; no fixtures, fixture apps, stubs or benches), over non-blank lines of packages/*/src (no .d.ts or generated files)
95.7% of source lines run by the tests
  • 122Unit
  • 113Browser
  • 8End to end
  • 0Type tests
  • 0Lint rules
  • 0Failing

Coverage

  • 95.7%Lines
  • 89.3%Branches
  • 90.7%Functions
  • 94.3%Statements

Every test

243 tests

TestKindNodeChromiumFirefoxWebKit
../../../../../__w/ogygia/ogygia/packages/rewrite/e2e/restore.spec.ts
a first-load copy reaching the router (a store, a prerender, a cache that ignores Vary) is loaded, never swapped inEnd to endnot runpasspasspass
a hole’s answer arrives restored, and its island hydrates afterEnd to endnot runpasspasspass
a page with nothing reshaped carries no restorer; its hole’s answer still arrives restoredEnd to endnot runpasspasspass
a router navigation away and back: every restored host has its sheet, and nothing throwsEnd to endnot runpasspasspass
a router navigation morphs a server-owned host its own runtime unpacked, without the transform’s tree in its light DOMEnd to endnot runpasspasspass
a router-fetched page is rendered as an answer: every host planned, and the response varies on itEnd to endnot runpasspasspass
og-handoff="replace" through the real runtime: the document’s host, a hole answer’s host already defined, and a router page’s host each end with the component’s render alone, and a classic head listener hears eachEnd to endnot runpasspasspass
the island inside a reshaped host hydrates as is, and stays interactiveEnd to endnot runpasspasspass
packages/rewrite/test/browser-chunk-lost/client-restorer-lost.test.ts
a restorer that does not load is said, and the answers waiting for it go onBrowsernot runpasspasspass
packages/rewrite/test/browser-chunk-lost/restore-report.test.ts
a restore report whose wording chunk does not load says nothing, throws nothing, and keeps the logBrowsernot runpasspasspass
packages/rewrite/test/browser/client-restorer.test.ts
a page whose document carried the restorer uses that one and loads noneBrowsernot runpasspasspass
a page with elements whose ids are __og_restore and __og_restore_adopt loads the realm’s restorer, and an answer restores and adoptsBrowsernot runpasspasspass
a page with no restorer of its own loads the realm’s after the boot, and an answer parsed first waits for itBrowsernot runpasspasspass
an answer parsed before the realm’s restorer is in waits for it and comes out restored, though another script swapped window.Promise after the bootBrowsernot runpasspasspass
the realm’s restorer gives the page its __og_carry before the first answer is morphed: the copy hears ogygia:restoredBrowsernot runpasspasspass
packages/rewrite/test/browser/handoff.test.ts
a bare or empty og-handoff is adopt, logged with its empty value once per element name, and said with its codeBrowsernot runpasspasspass
a component that always calls attachShadow() in its constructor, ALREADY defined when the morph places its hole answer: it gets the restored root emptied, with its sheets, and nothing throwsBrowsernot runpasspasspass
a component that always calls attachShadow() in its constructor, defined after a hole answer the morph placed: its root is the restored one, emptied, and nothing throwsBrowsernot runpasspasspass
a late host ignores og-handoff: the component’s own root is left as it made it, and the attribute goesBrowsernot runpasspasspass
a page sheet a region answer carries inline goes to the head at the restore’s first step, and a host of the answer that names it adopts itBrowsernot runpasspasspass
a page with an element named after each of the restorer’s data globals: the report, the restore of the page, an answer’s restore and the morph that places it all workBrowsernot runpasspasspass
a page with an element whose id is __og_carry: the restorer installs its own over it, and the morph’s copy of a host hears ogygia:restoredBrowsernot runpasspasspass
a sheet’s media applies to the roots that adopt it: a print sheet does not paint on screen, adopted or as a <style> copyBrowsernot runpasspasspass
adopt (no og-handoff, as before): the same component renders next to the server’s tree, which stays and shows twiceBrowsernot runpasspasspass
adopt in a hole answer the morph places: the copy hears ogygia:restored once, the original neverBrowsernot runpasspasspass
an answer restored but never placed goes 30 s after its restore, though no restore_adopt() ran in betweenBrowsernot runpasspasspass
an incoming page restored while a hole answer’s restore_adopt() runs before it goes in (the router awaits between): its hosts keep waiting, and swapped in they get their sheets and ogygia:restoredBrowsernot runpasspasspass
an incoming page restored while a hole answer’s restore_adopt() runs before it goes in: morphed in, its copies get their sheets and ogygia:restored, in restore orderBrowsernot runpasspasspass
an og-handoff value neither adopt nor replace is adopt, logged and said with its code once per element name and valueBrowsernot runpasspasspass
an og-shadow key may name a page sheet (`<style data-og-head>`): the root adopts it; a key with no sheet at all is still loggedBrowsernot runpasspasspass
nested hosts in a hole answer the morph places: their copies hear ogygia:restored in restore order, innermost firstBrowsernot runpasspasspass
ogygia:restored for an answer never inserted is dropped after 30 s, like its rootsBrowsernot runpasspasspass
ogygia:restored for an answer: not during the restore of its inert fragment, but at restore_adopt() once it is in the pageBrowsernot runpasspasspass
ogygia:restored is composed: a host inside a declarative shadow root the page shipped is heard on the documentBrowsernot runpasspasspass
ogygia:restored is not heard for a late host or one that cannot have a rootBrowsernot runpasspasspass
ogygia:restored: once per restored host, after every host of the restore is done (nested ones too), in restore order, with its rootBrowsernot runpasspasspass
ogygia:restored: the root its listener gets has its sheets already, in the page and for an answerBrowsernot runpasspasspass
replace in a hole answer inserted as it is, its element already defined and writing as it connects: the server’s tree goesBrowsernot runpasspasspass
replace in a hole answer the morph places, its element already defined and writing as it connects: the server’s tree goes, and ogygia:restored sees the component’s render aloneBrowsernot runpasspasspass
replace in a hole answer the morph places: the copy of the host hears ogygia:restored, and its server tree goes at the first writeBrowsernot runpasspasspass
replace in an answer restored in its inert fragment: inserted, adopted, then the component defined, the server’s tree goes at its first writeBrowsernot runpasspasspass
replace in an incoming page swapped in whole, its element already defined and writing as it connects: the server’s tree goesBrowsernot runpasspasspass
replace in an incoming page the router morphs in: the copy hears ogygia:restored, and its server tree goes at the first writeBrowsernot runpasspasspass
replace with fallback <style> sheets (no adoptable sheets): the server’s tree goes, the sheets stayBrowsernot runpasspasspass
replace, nested: an element defined before the restore that renders during ANOTHER host’s ogygia:restored listener hands offBrowsernot runpasspasspass
replace, siblings: an element defined before the restore that renders during ANOTHER host’s ogygia:restored listener hands offBrowsernot runpasspasspass
replace, the limit: a listener that defines the element, whose component writes as it connects: that write is the listener’s, and the server’s tree staysBrowsernot runpasspasspass
replace, the limit: an element defined before the restore whose listener makes it render during the event: that render is the listener’s, and the server’s tree staysBrowsernot runpasspasspass
replace: a component that already cleared the server’s tree itself (replaceChildren) upgrades with no error and keeps what it wroteBrowsernot runpasspasspass
replace: a component that renders into the root it finds replaces the server’s tree at its first write, before the next task; the sheets stay, the light DOM stays Svelte’sBrowsernot runpasspasspass
replace: a listener that adds a node and defines an element whose component renders later: the node is the listener’s, and the server’s tree stays until the component’s first writeBrowsernot runpasspasspass
replace: a listener that defines the element after the event (queueMicrotask), whose component writes as it connects: the server’s tree goesBrowsernot runpasspasspass
replace: a node a listener inserts before the upgrade is no handoff; the first write after it is, and the listener’s node staysBrowsernot runpasspasspass
replace: a node an ogygia:restored listener adds is never the component’s, even when the element is defined in the same taskBrowsernot runpasspasspass
replace: a node another script adds to the root while the element is not defined is no handoff; the component’s first write once defined isBrowsernot runpasspasspass
replace: an element defined before the restore that renders during an EARLIER host’s ogygia:restored listener, its own event still to come, hands offBrowsernot runpasspasspass
replace: an element defined before the restore whose listener makes it render after the event (queueMicrotask): the server’s tree goesBrowsernot runpasspasspass
replace: on an element defined before the restore (its component makes its root later), a listener’s node leaves the server’s tree; the component’s own render replaces itBrowsernot runpasspasspass
replace: the observer goes at the handoff; a server node put back after it is never removedBrowsernot runpasspasspass
the copy’s handoff names the copies of the server nodes still in the root at the copy: one already gone stays gone, a node another added staysBrowsernot runpasspasspass
the morph keeps the live host of a second answer: that answer’s record waits with no event, and goes after 30 sBrowsernot runpasspasspass
packages/rewrite/test/browser/host-classes.test.ts
a token the component dropped on the client before the hydrate stays droppedBrowsernot runpasspasspass
an element hydration replaced gets nothing put back: the element left the pageBrowsernot runpasspasspass
Svelte’s own tokens are never put back; unrestored and replaced elements are left aloneBrowsernot runpasspasspass
the component’s tokens as they are just before the hydrate come back after Svelte’s writeBrowsernot runpasspasspass
through a real Svelte hydrate: the class write happens, and the component’s token survives itBrowsernot runpasspasspass
packages/rewrite/test/browser/inert-parse.test.ts
a host that cannot have a shadow root is said once per page and host tag, with its codeBrowsernot runpasspasspass
a parsed answer builds none of its custom elements, in this engine (#382)#382Browsernot runpasspasspass
a shadow sheet a host names but the page lacks is said once per key, with its codeBrowsernot runpasspasspass
every parse is checked: an answer with a built custom element breaks rule_parse_upgradedBrowsernot runpasspasspass
production: a late restore is said once per page and host tag, with its codeBrowsernot runpasspasspass
under the Firefox 159 model, an answer stays inert, and its host is restored, never late (#382)#382Browsernot runpasspasspass
packages/rewrite/test/browser/restore.test.ts
a component that attaches its own root in its constructor upgrades over a restored host: the root comes back emptied, the light DOM stays Svelte’sBrowsernot runpasspasspass
a csr=false page arms no class watch (the island hydrate puts the tokens back)Browsernot runpasspasspass
a custom element keeps the class tokens its render added beside Svelte’s (recorded for the hydrate); a plain element gets Svelte’s aloneBrowsernot runpasspasspass
a declarative shadow root parsed in an inert fragment gets the page’s registry after insertion (no transform needed)Browsernot runpasspasspass
a dev check that does not parse checks nothing: the restore goes on, and the script is consumedBrowsernot runpasspasspass
a DOM without adoptable sheets or CSS.escape (jsdom): a <style> per rootBrowsernot runpasspasspass
a host its component already upgraded (no root of its own yet) keeps its identity and gets the restored rootBrowsernot runpasspasspass
a host that cannot have a shadow root is skipped and said; the hosts after it are restoredBrowsernot runpasspasspass
a host that names a shadow sheet the page does not carry is recorded, and its other sheets still adoptedBrowsernot runpasspasspass
a host upgraded before the restore reached it keeps its own root; the light DOM is put back, the server’s tree dropped, and it says soBrowsernot runpasspasspass
a host whose tag name holds markup characters is restored with nothing parsed out of its nameBrowsernot runpasspasspass
a host with an attribute name only the HTML parser accepts (`=eq`) is restored, and so is every host after itBrowsernot runpasspasspass
a host’s attribute reset (`og-r`) never sets a data: URL, which html.ts refuses tooBrowsernot runpasspasspass
a host’s attribute reset (`og-r`) never sets an on* handler or a javascript: URLBrowsernot runpasspasspass
a Kit-hydrated page: a watched host that leaves the document leaves the watch, a moved one stays, and the observer goes with the last oneBrowsernot runpasspasspass
a Kit-hydrated page: the first whole write to Svelte’s tokens gets back what it dropped; the component’s own later removals standBrowsernot runpasspasspass
a mangled attribute reset (`og-r`) leaves the host’s attributes as served, and its mark goneBrowsernot runpasspasspass
a missing shadow sheet named by many hosts is logged once per key, and the log keeps room for what comes afterBrowsernot runpasspasspass
a planned host inside a declarative shadow root the page shipped is restored tooBrowsernot runpasspasspass
a root restored in an answer’s inert fragment gets the page’s registry after insertion: what is inside upgradesBrowsernot runpasspasspass
a root that cannot adopt its sheet leaves the others in the answer theirsBrowsernot runpasspasspass
a router swap: a root the swap left in the parsed page is skipped (it waits, and goes after 30 s), and every root in this one gets its sheetsBrowsernot runpasspasspass
a stand-in becomes only a tag the server pass writes as one, without on* attributesBrowsernot runpasspasspass
a stand-in keeps the parser from splitting the page’s link, and becomes a real <a> in the treeBrowsernot runpasspasspass
a stand-in with an attribute name only the HTML parser accepts (`=eq`) becomes its tag, and so does every stand-in after it (#1775)#1775Browsernot runpasspasspass
a text mark whose original does not parse carries none: the text stays as served, the mark goneBrowsernot runpasspasspass
an answer restored in its inert fragment: a component that attaches its own root upgrades at insertion over the emptied rootBrowsernot runpasspasspass
an answer still waiting for its stylesheet keeps its roots while another answer goes inBrowsernot runpasspasspass
an answer’s fragment: restored before insertion, its sheets adopted once the host is in the pageBrowsernot runpasspasspass
dev: the check compares each restored host with Svelte’s children, and names the first differenceBrowsernot runpasspasspass
every dev check under the root is read and consumed: a restore of a streamed page checks the hosts of every chunk, and a second restore finds nothing (found by the rewrite sim)Browsernot runpasspasspass
putting attributes back never adds an event handler, a srcdoc or a javascript: URLBrowsernot runpasspasspass
self-contained: the function source runs on its own (the handle inlines it)Browsernot runpasspasspass
Svelte’s children put back into a host are known render output (a later morph may remove one)Browsernot runpasspasspass
text a render trimmed inside a custom element it did not render comes back through the planned host aboveBrowsernot runpasspasspass
the dev check reads class as tokens and style as declarations, an empty one as absentBrowsernot runpasspasspass
the document: a shadow root with the tree, Svelte’s children back exactly, the host’s attributes backBrowsernot runpasspasspass
the restorer swaps back every tag the server pass may write as a stand-inBrowsernot runpasspasspass
packages/rewrite/test/browser/rewrite-sim.test.ts
a seeded swarm of streamed pages through two failing rewrites restores what Svelte rendered, says every failure, and restores onceBrowsernot runpasspasspass
region answers: every host restored in the fragment, nothing left, idempotentBrowsernot runpasspasspass
packages/rewrite/test/browser/rewrite.test.ts
check(): a document, its restored hosts compared with Svelte’sBrowsernot runpasspasspass
check(): a region answer restored in a DOM, every host exactly Svelte’sBrowsernot runpasspasspass
check(): a render that changes Svelte’s children is named in mismatchesBrowsernot runpasspasspass
check(): leaves no trace in the page (no sheet in its cache, no log entry, no head asset, no queued root, no carry hook), and still reports its mismatchesBrowsernot runpasspasspass
check(): the roots it restores in its own documents leave no entry in the page’s queuesBrowsernot runpasspasspass
chunk by chunk: the first chunk’s restorer and each later chunk’s call restore exactly their hosts, sheets found inlineBrowsernot runpasspasspass
packages/rewrite/test/browser/script-url.test.ts
the script-URL table in the restorer > as a module: an attribute reset sets every value but the script URLsBrowsernot runpasspasspass
the script-URL table in the restorer > inline, as the page runs it: an attribute reset sets every value but the script URLsBrowsernot runpasspasspass
the script-URL table in the restorer > this browser’s URL parser says what the table saysBrowsernot runpasspasspass
packages/rewrite/test/check-jsdom.test.ts
a replace-handoff root that changes under jsdom keeps the server tree, with no error from its observerUnitpassnot runnot runnot run
check() of a csr document restores its host under jsdomUnitpassnot runnot runnot run
check() of a region restores its host under jsdomUnitpassnot runnot runnot run
the pinned jsdom still throws matching :defined in a windowless document, so these tests still prove the catchUnitpassnot runnot runnot run
packages/rewrite/test/plugin.test.ts
a rewrite() handle > gives a pass to the requests it wrapped, and to no otherUnitpassnot runnot runnot run
a rewrite() handle > listed after ogygia.handle() is refused with rewrite_after_ogygiaUnitpassnot runnot runnot run
a rewrite() handle > refuses every request while rewrite() is not in vite.config, naming the fixUnitpassnot runnot runnot run
a rewrite() handle > several in sequence share one pass, in the order they ranUnitpassnot runnot runnot run
a rewrite() handle > wrapped in a conditional handle, it rewrites the requests the condition picks and leaves every other request untouchedUnitpassnot runnot runnot run
core's handle > refuses `transform`, pointing at @ogygia/rewriteUnitpassnot runnot runnot run
rewrite() in vite.config > takes no options, is named by its package and names its realms, the modules beside itUnitpassnot runnot runnot run
packages/rewrite/test/restore-happy-dom.test.ts
a list of waiting roots the window only inherits is not the restorer’s: an incoming page’s root waits in a list of the window’s ownUnitpassnot runnot runnot run
a live restore runs in a DOM with no customElements globalUnitpassnot runnot runnot run
a page element named after each of the restorer’s data globals, which happy-dom makes an own property of the window, leaves the restore of the page and of an answer workingUnitpassnot runnot runnot run
a restore runs, and its roots wait, in a browser with no Object.hasOwn (Safari before 15.4)Unitpassnot runnot runnot run
an answer parsed while happy-dom holds a page element named __og_restore_ready (no restorer on the page) waits for nothing and throws nothing; the restorer’s log is emptyUnitpassnot runnot runnot run
packages/rewrite/test/restorer-inline-safe.test.ts
the inlined restorer > is one script element whose text holds no </script and no <!--Unitpassnot runnot runnot run
packages/rewrite/test/restorer-size.test.ts
the inlined restorer > a later chunk’s restore is one short callUnitpassnot runnot runnot run
the inlined restorer > minified as the build does, stays inside its budget: 11.1 kB, 3.95 kB brotliUnitpassnot runnot runnot run
packages/rewrite/test/reversible-browser-read.test.ts
mark reads tags as the browser does > a comment ends at `--!>` and `<!-->` tooUnitpassnot runnot runnot run
mark reads tags as the browser does > a host inside a noscript is text, not an elementUnitpassnot runnot runnot run
mark reads tags as the browser does > a quote inside an unquoted value does not hide the host after itUnitpassnot runnot runnot run
mark reads tags as the browser does > a region’s attributes in any quoting place its hostsUnitpassnot runnot runnot run
packages/rewrite/test/reversible.test.ts
a page tag that closes a custom element around it > is the page’s, not the render’s: settle never makes it a stand-in (found by the round-trip fuzz)Unitpassnot runnot runnot run
closes_all > refuses HTML that would take in the page after it, or close an element around itUnitpassnot runnot runnot run
closes_all > takes HTML that closes what it opens, implied closes and voids includedUnitpassnot runnot runnot run
localize_marks > gives back the same string when the marks already count from 0Unitpassnot runnot runnot run
localize_marks > reads back ids a serializer requotedUnitpassnot runnot runnot run
localize_marks > renumbers a block’s marks from 0 for a cache key, and puts the document’s ids back afterUnitpassnot runnot runnot run
mark > a baked live region is opaque like a lake: on a Kit-hydrated document its hosts get no plan, its islands keep theirsUnitpassnot runnot runnot run
mark > a document the router fetched is an answer: every host planned, as in a region answerUnitpassnot runnot runnot run
mark > a Kit-hydrated document is Svelte-owned throughout its body; a region answer plans every hostUnitpassnot runnot runnot run
mark > a server-owned host around a hole is planned: ogygia swaps the hole, its runtime must not adopt itUnitpassnot runnot runnot run
mark > marks text a trimmer could change, deeper inside a planned host’s children — never the first text of a <pre>Unitpassnot runnot runnot run
mark > plans the hosts in Svelte-owned markup and around it; tags every custom element’s childrenUnitpassnot runnot runnot run
restored_ids > reads og-h however a serializer quotes itUnitpassnot runnot runnot run
settle > a block the tree opens inside a Svelte <p> becomes a stand-in tooUnitpassnot runnot runnot run
settle > a host ogygia will not restore gets no comment marks (its element children still carry their tag)Unitpassnot runnot runnot run
settle > a host without a plan loses every mark: left exactly as the transform wrote itUnitpassnot runnot runnot run
settle > a planned host keeps what the restorer needs: the attributes to reset, the text the render changedUnitpassnot runnot runnot run
settle > a planned host that is also a tagged child carries one attribute reset: its ownUnitpassnot runnot runnot run
settle > a tagged child that is a host ogygia won’t restore keeps the attributes its runtime adopts it byUnitpassnot runnot runnot run
settle > dev: each planned host’s original children, for the browser’s checkUnitpassnot runnot runnot run
settle > head assets in a document’s body go to its head, once per keyUnitpassnot runnot runnot run
settle > settle alone drops marks of hosts the transform never plannedUnitpassnot runnot runnot run
settle > stand-ins: a start tag the parser would restructure, where the render made either side of itUnitpassnot runnot runnot run
packages/rewrite/test/rewrite-fuzz.test.ts
a render that only adds beside each element > leaves every other byte as it was: marks, settle and splice undo each other (csr false, answer false)Unitpassnot runnot runnot run
a render that only adds beside each element > leaves every other byte as it was: marks, settle and splice undo each other (csr false, answer true)Unitpassnot runnot runnot run
a render that only adds beside each element > leaves every other byte as it was: marks, settle and splice undo each other (csr true, answer false)Unitpassnot runnot runnot run
an identity render > gives any markup, cut anywhere, back byte for byte (csr false, answer false)Unitpassnot runnot runnot run
an identity render > gives any markup, cut anywhere, back byte for byte (csr false, answer true)Unitpassnot runnot runnot run
an identity render > gives any markup, cut anywhere, back byte for byte (csr true, answer false)Unitpassnot runnot runnot run
packages/rewrite/test/rewrite.test.ts
.check() > lists failures, counts restored hosts, and has no DOM in nodeUnitpassnot runnot runnot run
buggify points: each way a render fails, drawn by the simulator > rewrite.chunk-split: a chunk read as two, cut inside an element, ships that element unrendered and says soUnitpassnot runnot runnot run
buggify points: each way a render fails, drawn by the simulator > rewrite.render-count: a batch one result short is retried one at a time, and an element whose own answer is short goes out as ogygia rendered itUnitpassnot runnot runnot run
buggify points: each way a render fails, drawn by the simulator > rewrite.render-malformed: a result that does not close what it opens goes out as ogygia rendered itUnitpassnot runnot runnot run
buggify points: each way a render fails, drawn by the simulator > rewrite.render-strips-marks: a result without the og-h of a host ogygia restores goes out as ogygia rendered itUnitpassnot runnot runnot run
element rewrites: failures cost only the element > a batch with the wrong count is retried one at a timeUnitpassnot runnot runnot run
element rewrites: failures cost only the element > a cancelled request: the batch is shipped as is, never retried, nothing saidUnitpassnot runnot runnot run
element rewrites: failures cost only the element > a failed batch is retried one element at a time; one that drops the marks goes out as ogygia rendered it (rewrite_marks_lost)Unitpassnot runnot runnot run
element rewrites: failures cost only the element > a failed batch is retried one element at a time; one that returns a bad sheet goes out as ogygia rendered it (rewrite_element_failed)Unitpassnot runnot runnot run
element rewrites: failures cost only the element > a failed batch is retried one element at a time; one that returns html that does not close goes out as ogygia rendered it (rewrite_element_failed)Unitpassnot runnot runnot run
element rewrites: failures cost only the element > a failed batch is retried one element at a time; one that returns no html goes out as ogygia rendered it (rewrite_element_failed)Unitpassnot runnot runnot run
element rewrites: failures cost only the element > a failed batch is retried one element at a time; one that throws goes out as ogygia rendered it (rewrite_element_failed)Unitpassnot runnot runnot run
element rewrites: failures cost only the element > a later chunk of a cancelled request goes out as it came, never renderedUnitpassnot runnot runnot run
element rewrites: failures cost only the element > a request cancelled during the first rewrite: the second never renders, and nothing is writtenUnitpassnot runnot runnot run
element rewrites: failures cost only the element > a request cancelled while the elements are retried one at a time: shipped as is, nothing said, and no element’s render starts after the cancel (found by the long rewrite sim)Unitpassnot runnot runnot run
element rewrites: failures cost only the element > production says each failure with its code, once per response and element nameUnitpassnot runnot runnot run
element rewrites: failures cost only the element > rule_rewrite_after_cancel: a render called after the request was cancelled is said with the rule’s codeUnitpassnot runnot runnot run
element rewrites: the restore > a chunk that ends inside a region or a tag carries no script: the restore waits for a chunk that ends where one may goUnitpassnot runnot runnot run
element rewrites: the restore > a chunk-1 meta or sheet never lands inside an island: the first-load mark goes before the element it is for (found by the rewrite sim)Unitpassnot runnot runnot run
element rewrites: the restore > a later chunk: its sheet inline at first use, once per key, and one restore call at its endUnitpassnot runnot runnot run
element rewrites: the restore > a later chunk's host inside a declarative shadow root the page opened, in that chunk or an earlier one, gets the restore call that enters every root (found by the rewrite sim)Unitpassnot runnot runnot run
element rewrites: the restore > a matched element whose start tag a chunk boundary cuts (after "<", in a chunk with no match before it) is said as split, as one its chunk ends inside (found by the rewrite sim)Unitpassnot runnot runnot run
element rewrites: the restore > a matched element whose start tag a chunk boundary cuts (after "<dem", in a chunk with no match before it) is said as split, as one its chunk ends inside (found by the rewrite sim)Unitpassnot runnot runnot run
element rewrites: the restore > a matched element whose start tag a chunk boundary cuts (after "<demo-", in a chunk with no match before it) is said as split, as one its chunk ends inside (found by the rewrite sim)Unitpassnot runnot runnot run
element rewrites: the restore > a matched element whose start tag a chunk boundary cuts (after "<demo-ca", in a chunk with no match before it) is said as split, as one its chunk ends inside (found by the rewrite sim)Unitpassnot runnot runnot run
element rewrites: the restore > a matched element whose start tag a chunk boundary cuts (after "<demo", in a chunk with no match before it) is said as split, as one its chunk ends inside (found by the rewrite sim)Unitpassnot runnot runnot run
element rewrites: the restore > a region whose start tag is cut by a chunk boundary (after "<") still owns its elements (found by the rewrite sim)Unitpassnot runnot runnot run
element rewrites: the restore > a region whose start tag is cut by a chunk boundary (after "<ogygia-region entry") still owns its elements (found by the rewrite sim)Unitpassnot runnot runnot run
element rewrites: the restore > a region whose start tag is cut by a chunk boundary (after "<ogygia-region") still owns its elements (found by the rewrite sim)Unitpassnot runnot runnot run
element rewrites: the restore > an element split across chunks goes out unrendered, said once, and the rest is read after itUnitpassnot runnot runnot run
element rewrites: the restore > the chunk that restored something carries the restorer before </body>; its sheets go to the headUnitpassnot runnot runnot run
element rewrites: the restore > the last chunk carries a restore still waiting, wherever it endsUnitpassnot runnot runnot run
element rewrites: what goes to render > a custom element outside Svelte-owned markup is rendered, not restoredUnitpassnot runnot runnot run
element rewrites: what goes to render > a page with no match goes out byte for byte, render is never called, and no restorer shipsUnitpassnot runnot runnot run
element rewrites: what goes to render > a render the page around its element would restructure goes out as a stand-in: a <div> in the page’s <p>, an <a> in the page’s <a> (the restore lab e2e)Unitpassnot runnot runnot run
element rewrites: what goes to render > only the outermost match goes, with marks numbered from 0, and equal elements render onceUnitpassnot runnot runnot run
element rewrites: what goes to render > text that spells a mark is text: moving ids never touches it, and render sees it as written (found by the fuzz)Unitpassnot runnot runnot run
element rewrites: what goes to render > the context carries kind, csr, url, event and a signal that fires when the request is cancelledUnitpassnot runnot runnot run
element rewrites: what goes to render > the ids of a response keep counting past each element, so marks never collideUnitpassnot runnot runnot run
og-handoff > on a host without a plan it is taken off with the other marksUnitpassnot runnot runnot run
og-handoff > on a planned host it goes to the restorer, and is never in the attribute resetUnitpassnot runnot runnot run
region answers > every host is restored; sheets go inline for the runtime to hoistUnitpassnot runnot runnot run
several rewrites > run in order on one marking: the second sees the first one’s output, marks intactUnitpassnot runnot runnot run
sheet attributes > .check() lists an element whose sheet attribute was refusedUnitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: ["media"]Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"a b":"1"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"data-og-head":"k2"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"data-ogygia-region-css":"1"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"DATA-OGYGIA-X":"1"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"is":"x-style"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"media":1}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"og-h":"0"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"ogygia-x":"1"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"ONERROR":"x"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"onload":"x"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"shadowrootmode":"open"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"x\"><script>":"1"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"xmlns-x":"urn:x"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"xmlns:x":"urn:x"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"xmlns":"urn:x"}Unitpassnot runnot runnot run
sheet attributes > a sheet attribute that cannot be written fails its element with the reason: {"XMLNSX":"urn:x"}Unitpassnot runnot runnot run
sheet attributes > are written on the sheet’s tag after its key, values escaped, on a page <style> and a shadow <template> alikeUnitpassnot runnot runnot run
sheet attributes > the first sheet of a key wins, attributes and allUnitpassnot runnot runnot run
the page form > .html(str) runs the page function on a plain string, outside any requestUnitpassnot runnot runnot run
the page form > a page function that throws: production sends the document as ogygia rendered it, said as rewrite_page_failedUnitpassnot runnot runnot run
the page form > a request cancelled while the page function ran: the document goes out as ogygia rendered itUnitpassnot runnot runnot run
the page form > dev throws itUnitpassnot runnot runnot run
the page form > holds the document until its last chunk and rewrites it wholeUnitpassnot runnot runnot run
packages/rewrite/test/types.test.ts
rewrite() > an element rewrite is a Kit handle with .check(); a page rewrite also has .html()Unitpassnot runnot runnot run
rewrite() > render gets the elements and the context, and gives one result per element, sync or asyncUnitpassnot runnot runnot run