@verajs/lite 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +99 -2
- package/dist/development/vera-lite.d.ts +121 -0
- package/dist/development/vera-lite.d.ts.map +1 -0
- package/dist/development/vera-lite.js +1746 -0
- package/dist/development/vera-lite.js.map +1 -0
- package/dist/vera-lite.min.js +4 -0
- package/dist/vera-lite.min.js.map +1 -0
- package/package.json +111 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vera-lite.min.js","sources":["../../shared-utils/src/diagnostic.ts","../../shared-utils/src/markup-grammar.ts","../../shared-utils/src/utils.ts","../src/markup.ts","../src/patch.ts","../src/schedule.ts","../src/define.ts","../src/signal.ts","../src/tags.ts"],"sourcesContent":["/**\n * **Where every diagnostic code is explained.** The URL is permanent: a released bundle is immutable, so every version\n * published points here for ever — the domain cannot lapse and `/e/` cannot be reorganized without breaking links in\n * code nobody can edit; the docs site redirects instead. `scripts/sync-diagnostics.mjs` imports this constant, so the\n * pages and the bundles can never disagree about where they are.\n */\nexport const DOCS = 'https://verajs.dev/e/';\n\n/**\n * **What this copy of the framework has already said** (Brian's ruling, 2026-11-12): the ONE memory behind `warnOnce`, `errorOnce`\n * and `hasWarned`, for DEVELOPMENT-ONLY warnings. It replaced the hand-written once-flags every package kept\n * (`saidLists`, `warnedDrop`, per-element WeakSets, per-key Sets: two naming styles, Brian: no names). **A warning that\n * ships to production keeps its memory at its site** (bytes, measured 2026-11-12: the shared memory costs +80–145 B gz\n * per bundle); development-only warnings use warnOnce. Module state by necessity, since \"once\" spans every call on the\n * page. One per BUNDLE COPY, exactly the scope each flag had, because this package is inlined into every bundle.\n * A code, or `code key` for a string key, in a Set. An object key (an element, a setup function) in a WeakMap, so its\n * entry goes with the object. Marked pure, so a bundle that never prints once drops both.\n */\nconst printed = /* @__PURE__ */ new Set<string>();\nconst printedOn = /* @__PURE__ */ new WeakMap<object, Map<string, Set<unknown>>>();\n/**\n * A once's KEY: none (once per page), a string (once per that string), an object (once per that object: an element, a\n * class, a setup function), or the PAIR `[object, value]`, a value key on that object (a store write: the object and its\n * property; a keyed list: the list and the duplicate key, compared as the list compares them, by value, so `1` and `'1'`\n * stay apart). A pair is the only array a key may be.\n */\ntype OnceKey = string | object | readonly [object, unknown];\n/** Where an object key's (code, value) lives: the value set for that code on that object, made on demand. */\nconst valuesOn = (on: object, code: string, make: boolean): Set<unknown> | undefined => {\n let codes = printedOn.get(on);\n if (codes === undefined) {\n if (!make) return undefined;\n printedOn.set(on, (codes = new Map()));\n }\n let values = codes.get(code);\n if (values === undefined && make) codes.set(code, (values = new Set()));\n return values;\n};\n/** The object and value of an object or pair key. */\nconst split = (key: object): readonly [object, unknown] => (Array.isArray(key) ? (key as unknown as readonly [object, unknown]) : [key, undefined]);\n/** Whether (code, key) is new, recording it if so. */\nconst firstTime = (code: string, key?: OnceKey): boolean => {\n if (key === undefined || typeof key === 'string') {\n const entry = key === undefined ? code : `${code} ${key}`;\n if (printed.has(entry)) return false;\n printed.add(entry);\n return true;\n }\n const [on, sub] = split(key);\n const values = valuesOn(on, code, true)!;\n if (values.has(sub)) return false;\n values.add(sub);\n return true;\n};\n\n/**\n * **One shape for every diagnostic the framework prints** — the short line production keeps, the whole sentence\n * development adds — so a package converting its messages writes a table and a call, never its own format.\n *\n * production `[vera] hydration: element: found <i> — https://verajs.dev/e/hydration-fallback`\n * development `[vera] hydration: element: found <i> — fell back to a client render: … (hydration-fallback)`\n *\n * `subject` is the free information — what the code already has at hand, naming the problem area — the same in both\n * builds. `prose` is development only: the package's table entry (`Prose`), called behind `__DEV__` at the call site so\n * the table goes unreferenced in production and rollup drops it whole. Production prints the code inside the link, so\n * the reader is one click from the explanation, which `scripts/sync-diagnostics.mjs` publishes from the same tables.\n *\n * **Every production message is coded** (Brian, 2026-11-11; this supersedes \"convert where smaller\", 2026-10-02):\n * consistency over a few bytes, so no package keeps a hand-written production line beside its table.\n */\n/*\n * The parameter names are deliberately unlike anything a caller holds: terser will not inline a function whose\n * parameter shadows a name at the call site (measured 2026-10-02 — directives passes its own `code`, and a parameter\n * called `code` left `((e,t,n)=>`…`)(0,t,n)` in its bundle, +8 B; renamed, the call folds to the bare template).\n */\n/**\n * **A misused API, named by its function** — the thrown-error twin of `diagnostic()`: `untrack: expected a function …\n * (untrack-not-function)`, function-first because a stack already names the source and the sweep reads that shape. The\n * prose comes from a package's table, behind `__DEV__`, so a development-only guard costs production nothing.\n */\nexport const misuse = (forName: string, withCode: string, andProse?: false | readonly [string, string?]) =>\n __DEV__ && andProse\n ? `${forName}: ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `${forName}: ${DOCS}${withCode}`;\n\n/**\n * **A misused API and what it was misused ABOUT** — `misuse()` with a subject, in `diagnostic()`'s ` — ` separator:\n * `parseFrontmatter: line 3 — https://verajs.dev/e/cms-frontmatter-unsupported`. The subject is the free information\n * (a line, a URL and its status) and prints in both builds. A sibling rather than an optional parameter on `misuse()`,\n * because `misuse()` is inlined into every bundle that throws and a conditional subject would tax all of them for a\n * shape few need; a sibling is tree-shaken where unused.\n */\nexport const misuseAbout = (forName: string, aboutSubject: string, withCode: string, andProse?: false | readonly [string, string?]) =>\n __DEV__ && andProse\n ? `${forName}: ${aboutSubject} — ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `${forName}: ${aboutSubject} — ${DOCS}${withCode}`;\n\nexport const diagnostic = (\n inArea: string,\n bySubject: string,\n withCode: string,\n andProse?: false | readonly [string, string?]\n) =>\n /** `__DEV__` HERE as well as at the call: production folds this to the one-line form, branch and all. */\n __DEV__ && andProse\n ? `[vera] ${inArea}: ${bySubject} — ${andProse[0]}${andProse[1] ? ` ${andProse[1]}` : ''} (${withCode})`\n : `[vera] ${inArea}: ${bySubject} — ${DOCS}${withCode}`;\n\n/**\n * **Text from outside — a file path, a YAML key, a URL, an error's message — quoted before it reaches a line.** A log is a\n * pipeline, and such text can be shaped by an author or a request: a newline in it forges a line, an ESC sequence hides\n * one (log injection). `JSON.stringify` escapes both; cut to 80 characters so one value cannot fill the log. @verajs/ssr\n * keeps a twin (it cannot import this), held equal by tests/ssr-coded-diagnostics.\n */\n/**\n * `max` caps the length (80 by default); `Infinity` keeps the whole text for a value worth reading in full — a site\n * owner's own path — which is still ESCAPED: truncation and escaping are separate jobs, and a path is not free of control\n * characters just because its owner wrote it (2026-10-09).\n */\nexport const quoted = (text: string, max = 80): string => JSON.stringify(text.length > max ? `${text.slice(0, max)}…` : text);\n\n/**\n * **The errors a package constructs, marked as its own** — so a wrapper that reports an inner refusal (cms's\n * `generateManifest` around a frontmatter line) carries it as it is: already formatted, its outside text already\n * quoted. Anything else is foreign, and quoted. Identity, never a shape test: a message can imitate ours, an identity\n * cannot. @verajs/ssr keeps a twin (it cannot import this).\n */\nconst ours = /* @__PURE__ */ new WeakSet<object>();\nexport const own = <E extends Error>(error: E): E => {\n ours.add(error);\n return error;\n};\nexport const isOwn = (error: unknown): boolean => typeof error === 'object' && error !== null && ours.has(error);\n\n/**\n * **Whether this copy has already said `code` (for `key`)**: for a GUARD only, where deciding to warn costs work worth\n * skipping once the warning is out (development's whole-tree walk for unwired directive attributes, an event-name\n * guess over every property of an element). A site that only prints calls `warnOnce`. Asks, never records.\n */\nexport const hasWarned = (code: string, key?: OnceKey): boolean => {\n if (key === undefined || typeof key === 'string') return printed.has(key === undefined ? code : `${code} ${key}`);\n const [on, sub] = split(key);\n return valuesOn(on, code, false)?.has(sub) === true;\n};\n\ntype Detail = false | readonly [string, string?] | (() => readonly [string, string?] | undefined);\n/**\n * The printer behind both, on one level. `andDetail` is `diagnostic()`'s prose, or a function returning it where building\n * the sentence costs something: it is called only the first time. `...andMore` rides beside the line behind '%s' (an\n * element, a thrown error), never inside it, so text from outside cannot forge a line. The console method is read at the\n * call, so a test that replaces `console.warn` sees it.\n */\nconst sayOnce =\n (level: 'warn' | 'error') =>\n (inArea: string, bySubject: string, withCode: string, andDetail?: Detail, forKey?: OnceKey, ...andMore: unknown[]): void => {\n if (!firstTime(withCode, forKey)) return;\n const line = diagnostic(inArea, bySubject, withCode, typeof andDetail === 'function' ? andDetail() : andDetail);\n if (andMore.length) console[level]('%s', line, ...andMore);\n else console[level](line);\n };\n/**\n * **A diagnostic said once per page** (per key, where one is given: a string, or an object such as the element it is\n * about): `diagnostic()`'s arguments, then the key, then what rides beside the line. Coded in production exactly as\n * `diagnostic()` is, because it IS `diagnostic()`. `errorOnce` is its twin on `console.error`, for a refusal a page should\n * not miss.\n */\nexport const warnOnce = /* @__PURE__ */ sayOnce('warn');\nexport const errorOnce = /* @__PURE__ */ sayOnce('error');\n","import { misuse } from './diagnostic.js';\nimport * as SHARED from './diagnostics.js';\n/**\n * HTML's own element grammar — the facts about tags that every package emitting or reading markup\n * has to agree on.\n *\n * These are not this framework's rules; they are the parser's, and a package that guesses at them\n * produces markup whose *parse* differs from what its author wrote. That failure is silent by\n * nature: nothing throws, the page renders, and the DOM simply has a different shape than the\n * source said. See `VOID_ELEMENTS` below for the two measured instances.\n *\n * **Never `exec` a shared `/g` regex in a loop whose body can re-enter it** (a nested render, a recursive compose or\n * serialize, a callback): the inner use resets `lastIndex`, and the outer loop restarts or skips. Setting `lastIndex`\n * before every `exec` is not enough. Measured 2026-11-17: the static tier's composer re-entered its marker regex through\n * a nested template and composed forever; split once, or use a fresh regex per walk.\n *\n * **Why here.** These sets had grown copies in `@verajs/ssr`, `@verajs/cms` and (as a regex) the\n * renderer, all agreeing by luck rather than by construction. This file is the one source for\n * every package that can take a build-time import — `@verajs/shared-utils` is private and inlined,\n * so importing it costs a consumer nothing at runtime and adds no published dependency.\n *\n * **`@verajs/ssr` cannot import it** and keeps its own copies: that package publishes its `src`\n * with no dependencies at all, so an import of a package that is never published would break the\n * published tarball. The same constraint already forced a twin of `escapeStyleText` there. A copy\n * is acceptable; a copy nothing checks is not, so `tests/markup-grammar-homes.test.mjs` drives\n * every copy against this file source-to-source rather than trusting they get edited together.\n *\n * **A consumer may keep a different SHAPE for the same fact** where a hot path needs one — the\n * renderer matches raw-text tags with a case-insensitive regex rather than lowercasing a string to\n * probe a `Set`. The rule is agreement, not representation, and the homes test asserts agreement\n * across whatever shape each home uses.\n */\n\n/**\n * Elements with no end tag, and therefore no children.\n *\n * Both directions of getting this wrong are silent, and both were live in this repo until the\n * audit of 2026-09-12 measured them:\n *\n * - **A non-void element written self-closing swallows what follows it.** HTML has no\n * self-closing syntax outside foreign content, so `<div/><span>after</span>` parses as\n * `<div><span>after</span></div>` — the sibling becomes a child. Every JSX toolchain treats\n * `<div/>` as an empty element, which is exactly why authors write it.\n * - **A void element written with an end tag is duplicated.** A parser reads `</br>` as *another*\n * `<br>`, so `<br></br>` renders two line breaks where the author wrote one.\n *\n * Inside `<svg>` and `<math>` the parser switches to foreign content, where XML self-closing *is*\n * honored — so neither rule applies there, and a consumer that checks must know where it is.\n */\nexport const VOID_ELEMENTS = new Set([\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',\n 'link', 'meta', 'param', 'source', 'track', 'wbr',\n]);\n\n/**\n * Elements a parser reads the children of as text rather than as markup.\n *\n * Two pieces of measured lore travel with this list and are the reason it is not read off a spec:\n *\n * - `iframe` and `noscript` were once absent from the SSR copy, which built a tree no browser\n * builds — `<noscript><img src=\"x\"></noscript>` produced an element, so\n * `querySelectorAll('noscript img')` answered 1 where every engine answers 0.\n * - `noscript` is raw text only when scripting is ENABLED. Fragment parsing disables it, and\n * Chromium and WebKit then parse the content as markup while Firefox parses it as text — so a\n * binding inside `<noscript>` worked in two engines and painted the renderer's internal marker\n * onto the page in the third. Listing it is safe in both parses.\n *\n * jsdom is not the oracle for either: it parses with scripting disabled and agrees with the old,\n * wrong list.\n */\nexport const RAW_TEXT_ELEMENTS = new Set(['style', 'script', 'textarea', 'title', 'iframe', 'noscript']);\n\n/**\n * The hyphenated names SVG and MathML already define, which the custom-elements spec reserves — so a\n * dash in one of these does NOT make it a custom element.\n *\n * Measured, the one that matters: JSX treats a dash-named tag as a custom element and compiles its\n * attributes to PROPERTIES, which turned `<annotation-xml encoding=\"text/html\">` into\n * `.encoding=${…}`. The HTML parser decides that element is an integration point from the\n * ATTRIBUTE on its start tag, so HTML content inside was moved out of the `<math>` entirely, and a\n * custom element there was built MathML-namespaced and never upgraded — silent on the server and\n * the client alike. That is also the exact spelling the renderer's own warning recommends.\n */\nexport const RESERVED_ELEMENT_NAMES = new Set([\n 'annotation-xml', 'color-profile', 'font-face', 'font-face-src',\n 'font-face-uri', 'font-face-format', 'font-face-name', 'missing-glyph',\n]);\n\n/**\n * **A custom element, by its name:** a dash, except the eight names SVG and MathML already own (above). One\n * definition for every package that asks — `@verajs/jsx` compiles such a tag's attributes to properties, and\n * `@verajs/renderer/slots` captures such a host's children. (The renderer's own property paths ask a narrower\n * question, the bare dash, on its hot path; a reserved name never carries a property binding.)\n */\nexport const isCustomElementName = (tag: string): boolean =>\n tag.includes('-') && !RESERVED_ELEMENT_NAMES.has(tag.toLowerCase());\n\n/**\n * A URL whose scheme a browser reads as `javascript:` — navigating to one runs it, so a BOUND value\n * that parses this way is code arriving as data, never a link.\n *\n * Matched the way the URL Standard's parser reads a scheme, because that is the only reading that\n * matters: leading C0 controls and spaces are stripped, ASCII tab, LF and CR are removed anywhere, and\n * the scheme is case-insensitive. A check that only lowercases is bypassed by `\" jAvA\\tscript:\"`,\n * which every engine navigates to. React's blocking pattern is the same rule.\n *\n * `@verajs/ssr` keeps a twin (it cannot import this package), held to this one by\n * `tests/url-sinks.test.mjs`, so a server never emits a link the client refuses.\n */\n// eslint-disable-next-line no-control-regex\nexport const SCRIPT_URL = /^[\\u0000- ]*j[\\t\\n\\r]*a[\\t\\n\\r]*v[\\t\\n\\r]*a[\\t\\n\\r]*s[\\t\\n\\r]*c[\\t\\n\\r]*r[\\t\\n\\r]*i[\\t\\n\\r]*p[\\t\\n\\r]*t[\\t\\n\\r]*:/i;\n\n/**\n * **Every bound name whose value is checked for a `javascript:` URL — and how.** One test answers both.\n *\n * Captured, checked from the start: the attributes (and their reflecting properties) whose value a browser\n * NAVIGATES to or loads as a document — links and areas (`href`, SVG's `xlink:href`), forms (`action`,\n * `formaction`), frames (`src`), and `<object data>`. `src` is matched on every element — refusing one on an `<img>`\n * costs nothing, since an image never runs it. Resource-only attributes (`poster`, `srcset`) are fetched, never run,\n * so they are not listed.\n *\n * Not captured, checked ITEM BY ITEM (`SCRIPT_URL_ITEM`): an SVG animation's values — `to`, `from`, `by`, `values`.\n * `<animate attributeName=\"href\" to=\"javascript:…\">` (or `<set>`, or `values`) writes its value onto the link it\n * animates, and clicking the link then RUNS it: measured 2026-09-30 in Chromium, Firefox and WebKit, through `href`\n * and `xlink:href` alike. Refused on EVERY element and whatever `attributeName` says, because `attributeName` can\n * itself be bound or spread, a server spread has no element to ask, and no legitimate value of any attribute by these\n * names starts with `javascript:` (a component's `to`, a router link's, is a URL too). **Only these names are checked\n * item by item**: an unanchored test scans the whole value for `;`, which on a bound `src` holding a data URI costs\n * ~0.45 ms per MB per update in Chromium and Firefox (measured 2026-09-30), where the anchored `SCRIPT_URL` stops at\n * the first character.\n *\n * Case-insensitive, because property spellings (`formAction`) and attribute spellings meet here. `@verajs/ssr` keeps\n * a twin, held to this one by `tests/url-sinks.test.mjs`.\n */\nexport const URL_SINK = /^(?:(href|src|action|formaction|xlink:href|data)|to|from|by|values)$/i;\n\n/**\n * `SCRIPT_URL` at the start of the value OR of any `;`-separated item of it — an animation's `values` list\n * (`\"#a;javascript:…\"`) applies every item in turn. Only for an animation's values (`URL_SINK`'s uncaptured names): a `;` inside an `href` is a path\n * character, and `/p;javascript:x` is a working link, never a script. Written out rather than derived from\n * `SCRIPT_URL`: the repeated text costs less gzipped than the code that would build it.\n */\n// eslint-disable-next-line no-control-regex\nexport const SCRIPT_URL_ITEM = /(?:^|;)[\\u0000- ]*j[\\t\\n\\r]*a[\\t\\n\\r]*v[\\t\\n\\r]*a[\\t\\n\\r]*s[\\t\\n\\r]*c[\\t\\n\\r]*r[\\t\\n\\r]*i[\\t\\n\\r]*p[\\t\\n\\r]*t[\\t\\n\\r]*:/i;\n\n/**\n * **An inline event-handler attribute** — `on` and a letter, any case (`onclick`, `onLoad`, `onbeforeinput`): its\n * value is run as CODE, so a BOUND one is code arriving as data, refused by the template scanner, `spread` and the\n * server alike (a static `onclick=\"save()\"` is the author's own and untouched). Broad on purpose — it also refuses a\n * bound `once=`/`online=` attribute; the precise rule would need the platform's list of handler names. `@verajs/ssr`\n * keeps a twin, held to this one by `tests/inline-handlers.test.mjs`.\n */\nexport const INLINE_HANDLER = /^on./i;\n\n/**\n * **A `<script>` that is a JSON data block, by its `type`** (Brian, 2026-11-17): the only script a value may enter (state\n * handoff, JSON-LD); every other script hole is refused (`script-hole`), since a value there is code — run on a page the\n * server rendered. \"The type ends in `json`\" never names a script that runs — measured on Chromium, Firefox and WebKit,\n * parameters included (`text/javascript; x=json` is inert), as the spec reads a type (a JavaScript MIME essence match on\n * the whole string); `type=\"\"` and a `language` attribute alone do run, and end in no `json`.\n */\nexport const JSON_BLOCK = /json\\s*$/i;\n\n/**\n * Whether a script START TAG, as written, opens a JSON data block: its attributes read IN ORDER (so a `type=` inside\n * another attribute's quoted value is never taken for the type), the first `type` as the parser keeps it, and that value\n * holding no `&` (a character reference is refused rather than decoded — a decoder slightly off would make the server\n * and the client disagree) and ending in `json` (`JSON_BLOCK`). Every side applies it to the start tag that OPENED the\n * script a hole sits in — recorded where the scanner enters raw text, never found by searching back (a `<script…>`\n * inside a script's own text is no start tag). `@verajs/ssr` holds a twin, held equal by a test.\n */\nexport const dataBlock = (openTag: string) => {\n for (const [, name, double, single, bare] of openTag.slice(7).matchAll(/[\\s/]*([^\\s\"'>/=]+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s>]*)))?/g))\n if (name!.toLowerCase() === 'type') {\n const type = double ?? single ?? bare ?? '';\n return !type.includes('&') && JSON_BLOCK.test(type);\n }\n return false;\n};\n\n/**\n * **A raw-text element's composed text, unable to end its element** — the rule every side writes, byte for byte (the\n * server's `styleHole` and JSON rule, the renderer, hydration's comparison, lite, static): in a style each `</style`\n * (any case) as `<\\/style` (the same CSS), in a JSON data block every `<` as `\\u003c` (the same JSON). A style's or a\n * JSON block's text is serialized VERBATIM (BROWSER-LEDGER), so written as composed, a value became markup once the page\n * was saved from the DOM and parsed again. Applied to the COMPOSED text: a closer can form across a hole. Idempotent —\n * neither form leaves what it replaces.\n */\nexport const closedRawText = (text: string, json: boolean) =>\n json ? text.replace(/</g, '\\\\u003c') : text.replace(/<\\/(style)/gi, '<\\\\/$1');\n\n/**\n * **A value as inert text in ANY position** — every ASCII non-word character as a character reference (`<` `<`,\n * a space ` `, `=` `=`), everything else as it is: the encoding `@verajs/static` writes every value with, and the\n * renderer writes a never-shown element's values with. Read as raw text it holds no `<`; read as markup it decodes to\n * the same characters and cannot end a tag, a quoted or unquoted attribute value, or the element.\n */\nexport const encodeText = (text: string) => text.replace(/[^\\w\\u0080-\\uffff]/g, (c) => `&#${c.charCodeAt(0)};`);\n\n/**\n * **The properties that replace an element's whole content** — a binding to one owns the element's children, so it\n * cannot share the element with content of its own (markup, or a child binding the write would strand: a later commit\n * into it then throws on a missing parent). Development refuses the pair in the template scanner and in `spread` alike.\n */\nexport const CONTENT_PROPERTY = /^(?:textContent|innerHTML|innerText|outerHTML|outerText)$/;\n/**\n * Whether an element has content of its own that a content-replacing write would strand or lose: a child that is not\n * whitespace-only text (formatting whitespace loses nothing), or — `$content`, set in development by the renderer — a\n * child binding that owns the element whole and leaves no node behind until it commits. The element-specific `.text`\n * setters (`<a>`, `<option>`, `<title>`, `<script>`) are deliberately not in the list: a custom element's own `text`\n * prop is common, and would be refused for nothing.\n */\nexport const ownsContent = (element: Element): boolean => {\n if ((element as Element & { $content?: boolean }).$content === true) return true;\n for (let node = element.firstChild; node !== null; node = node.nextSibling)\n /**\n * An EMPTY text node is a child binding's anchor, not formatting: formatting whitespace is never empty. And\n * formatting is HTML's whitespace, `[ \\t\\n\\f\\r]` — not JS's `trim()`, which would let an ` ` be overwritten.\n */\n if (node.nodeType !== 3 || (node as Text).data === '' || /[^ \\t\\n\\f\\r]/.test((node as Text).data)) return true;\n return false;\n};\n/** `side` is the module the user wired — `renderer` for a template, `spread` for a spread. */\nexport const contentClash = (side: string, tag: string, name: string): never => {\n throw new Error(misuse(side, 'content-clash', __DEV__ && SHARED.contentClash(tag, name, side === 'spread' ? `<${tag} \\${spread({ '.${name}': … })}></${tag}>` : `<${tag} .${name}=\\${…}></${tag}>`)));\n};\n\n/**\n * **An expression in TAG-name position** (`<${x}>`, `</${x}>`, `<my-${x}>`) without `@verajs/renderer/tag`: no\n * element can be made from it — the parser reads a tag name before any value exists. Refused by the client in\n * development and by the server in every build, with one message. The tag entry splices a tag VALUE into the\n * statics before the renderer sees it, so only a non-tag ever reaches here.\n */\nexport const TAG_NAME_HOLE = /<\\/?[^\\s>]*$/;\nexport const tagHole = (side: string): never => {\n throw new Error(misuse(side, 'tag-hole', __DEV__ && SHARED.tagHole()));\n};\n","import type { HandlerHolder, Untracked } from './types.js';\nimport { diagnostic } from './diagnostic.js';\nimport * as SHARED from './diagnostics.js';\n\n/**\n * Get an object's type.\n *\n * @param obj The object\n * @return The type\n */\nexport const getType = (obj: unknown) => Object.prototype.toString.call(obj).slice(8, -1).toLowerCase();\n\n/**\n * Weak collections need their per-key dependencies stored weakly, or tracking `weakMap.get(obj)`\n * holds `obj` and defeats the whole point of the type. Checked by type string rather than\n * `instanceof`, which fails across realms (iframes, `vm`).\n */\n/**\n * A WeakMap or WeakSet (or WeakRef) — read from `Symbol.toStringTag`, the tag `Object.prototype.toString` itself reads, so\n * the answer is the same (another realm's collections included) without building and lower-casing a string on every first\n * tracked read of every object.\n */\nexport const isWeakCollection = (item: unknown) => {\n const tag = (item as { [Symbol.toStringTag]?: unknown } | null)?.[Symbol.toStringTag];\n return typeof tag === 'string' && (tag[0] === 'W' || tag[0] === 'w');\n};\n\n/**\n * Remove a trailing slash from an url if its not root url (`/`).\n *\n * @param str String to remove trailing slash from\n */\nexport const stripTrailingSlash = (str: string) => (str !== '/' && str.endsWith('/') ? str.slice(0, -1) : str);\n\n/**\n * **Reports an error nothing else handled, the way the platform reports one.** `reportError` fires\n * the window's `error` event — what `window.onerror`, error trackers and test runners listen for —\n * without unwinding the caller, so one failing hook or ref never stops its siblings. A bare\n * `console.error` reached none of those: a component could stop updating while every page-error\n * listener stayed silent. Off-browser (Node has no `reportError`) the console is all there is.\n * `line` is the framework's own line, printed beside the error — a CODED one (2026-10-09):\n * each caller passes `'[vera] <code>'` in production and its table's `diagnostic()` sentence in development, both\n * literal codes at the call site, so the static checks read them. The subject is fixed wording too (`a hook`, `an\n * element ref`), never a tag name: this line is the console's FORMAT (no `'%s'`, which measured +2–3 B on the renderer\n * bundles), so nothing from outside may reach it — the element goes to the `'error'` handlers instead. Production prints it only where the platform has no\n * `reportError` (Node); in a browser, `reportError` alone reports.\n *\n * Shared by core (a hook threw) and the renderer (a ref threw) so the fallback is one rule.\n */\nexport const reportUncaught = (error: unknown, line: string) => {\n if (typeof reportError !== 'function') console.error(line, error);\n else {\n if (__DEV__) console.error(line, error);\n reportError(error);\n }\n};\n\n/**\n * **Reports what user code a render called threw — to the app's `'error'` chain, else as uncaught.** One rule for\n * every callback the framework runs on the user's behalf and survives: a hook (core), an element ref, and an element\n * claim's `create`/`mount`/`unmount` (the renderer). The caller catches at the call site and carries on, so one\n * failing callback never stops its siblings or leaves a commit half applied. `element` is the component the error\n * belongs to, handed to each handler. Every throw is reported — nothing is deduped, as a hook's never was.\n * **Core keeps a deliberate twin** (`reportHookError`, the same rule as a `forEach`): routed through here it measured\n * +11 B gzip on `vera.min.js` (2026-10-09). A change to the rule changes both.\n */\nexport const reportTo = (handlers: readonly unknown[] | undefined, error: unknown, element: Element | undefined, line: string) => {\n if (handlers?.length) for (const handler of handlers) (handler as (error: unknown, element?: Element) => void)(error, element);\n else reportUncaught(error, line);\n};\n\n/** The component a render root belongs to: a shadow root's host, or a light root itself. */\nexport const hostOf = (root: Node | null | undefined): Element | undefined =>\n root == null ? undefined : root.nodeType === 11 ? (root as ShadowRoot).host : (root as Element);\n\n/** `fn(a, b, c)`, tracked as the caller is — the stand-in for core's `untracked` when no core was wired. */\nexport const call: Untracked = (fn, a, b, c) => fn(a!, b!, c!);\n\n/**\n * **Runs a bound handler, and its callers run it UNTRACKED**: the renderer's template `@event` and spread's event key,\n * each through `untracked(dispatch, holder, event)` (2026-10-09). An effect that fires an event synchronously\n * (`el.click()`, `focus()`, `dispatchEvent`) runs the handler INSIDE itself, and the handler's reads subscribed the\n * effect: a handler doing `state.n++` made the effect re-run on every click, a self-feeding loop held to one round per\n * frame, forever (measured). A handler's reads are event-time decisions, never a hook's inputs. The directives engine's\n * delegated `listen` makes the same choice its own way. A function is called with the element as `this`; an object\n * through its `handleEvent`. One function for both callers (Brian's size-audit ruling, 2026-11-13): it was two\n * identical copies, so a fix had two addresses; each bundle still inlines its own.\n */\nexport const dispatch = (holder: HandlerHolder, event: Event) => {\n const handler = holder._handler as EventListener | EventListenerObject | null;\n if (typeof handler === 'function') handler.call(holder._element as never, event);\n else if (typeof handler?.handleEvent === 'function') handler.handleEvent(event);\n};\n\n/**\n * **Whether a property binding is a `<select>`'s SELECTION** — `value` or `selectedIndex` — which the renderer and\n * `spread` both treat as live: re-asserted every render and compared against the live value (as `!value` is), because\n * a select's options can be replaced under an unchanged value, which drops the selection. One rule, asked once per\n * binding by both, so a template and a spread key cannot disagree about it.\n *\n * In development it names the one shape it cannot serve: on a `<select multiple>` both properties read and set a\n * SINGLE selection, so a selection the user adds is kept rather than controlled. Always writing there was measured\n * 2–3% slower on every table with a select per row, to serve an API that does not fit — hence a warning, not a cost.\n */\nexport const isSelection = (element: Element, name: unknown) => {\n if ((name !== 'value' && name !== 'selectedIndex') || element.localName !== 'select') return false;\n return true;\n};\n\n/**\n * Development: the one shape a selection binding cannot serve, named by the module the user wired (`side`). Called only\n * behind `__DEV__` at each call site, so production keeps `isSelection` exactly as small as it was (a `side` argument on\n * it measured +1 B, a default +9 B on vera-renderer.min.js — 2026-10-09).\n */\nexport const saySelectMultiple = (element: Element, name: unknown, side: string) => {\n if (element.hasAttribute('multiple'))\n console.warn(diagnostic(side, '<select multiple>', 'select-multiple', __DEV__ && SHARED.selectMultiple(String(name))));\n};\n\n/**\n * `target[key]`, as a function — how a component's GETTER is read through `untracked`. Not `Reflect.get`: `untracked`\n * passes three arguments, and `Reflect.get`'s third is the RECEIVER — `undefined` there runs the getter with no `this`.\n */\nexport const read = (target: object, key: string) => (target as Record<string, unknown>)[key];\n\n/**\n * **What a thrown value says, whatever was thrown — and it never throws itself.** A caught value comes from author\n * code (a `resolve` option, a motion tick or vocabulary function), and JavaScript can throw anything: `null`, an object\n * with no prototype (`String()` finds no `toString`), one whose `toString` or `message` getter throws, a Proxy whose\n * traps throw. Formatting it naively replaced the real failure with an unrelated TypeError from inside the framework.\n * Anything unreadable becomes a fixed phrase; `Object.prototype.toString` is no fallback, since it reads\n * `Symbol.toStringTag` through a Proxy's trap too.\n *\n * **A deliberate duplicate of `thrownMessage` in `packages/ssr/src/vera/escaping.ts` — fix both copies.** `@verajs/ssr`\n * is compiled per file with no bundling, so it cannot import this private, unpublished package at run time;\n * `tests/thrown-message-copies.test.mjs` runs one table of thrown values against both, so they cannot drift.\n */\nexport const thrownMessage = (error: unknown): string => {\n try {\n if (error instanceof Error) return String(error.message);\n const message = (error as { message?: unknown } | null)?.message;\n return typeof message === 'string' ? message : String(error);\n } catch {\n return '[unprintable value thrown]';\n }\n};\n\n/** `data-tone` → `dataTone`: the prop an observed attribute arrives as, in every package that defines components (`@verajs/core`'s `define`, its checks, `@verajs/lite`). */\nexport const camel = (name: string) => name.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase());\n","/**\n * **What the lite tier reads in a template's static text, and what it refuses to write.** Where a hole is, the HTML\n * PARSER says: a rough scan only picks each hole's MARKER form (a comment in text, a value mark inside a start tag), the\n * template is parsed once in a `<template>`, and each hole must land EXACTLY ONCE where its form can be filled\n * (`patch.ts`'s `prepare`). A marker the rough scan misplaces lands in raw text, a comment, a name, a template's content\n * or nowhere — missing — and the template is refused: a scan error can only refuse, never misplace a value. (This\n * replaced a verbatim twin of core's scanner grammar and a separate parser check, 2026-11-17: the static sketch's design,\n * when static was retired into lite.) The refusals are the full tier's (`@verajs/core` with its renderer), from\n * shared-utils' one grammar: a bound inline handler or `srcdoc` is never written, and a script URL on a URL-bearing name\n * is removed.\n */\nimport { INLINE_HANDLER, SCRIPT_URL, SCRIPT_URL_ITEM, SHARED, URL_SINK, attributeValueKind, diagnostic, eventKey, eventNameGuess, warnOnce } from '@verajs/shared-utils';\nimport { PROSE } from './diagnostics.js';\n\n/**\n * The rough scan: a hole is in a tag when the source before it ends inside a start tag — a `<` and a letter, then no\n * `>` outside quotes (so `<a title=\"Next >\" href=${url}>` stays in the tag). Wrong only toward a marker that is then\n * missing, so the template is refused, never misrendered. Its group is the open quote's text when the hole is inside\n * a quoted value (`undefined` when it is not).\n */\nexport const IN_TAG = /<[a-zA-Z](?:[^>\"']|\"[^\"]*\"|'[^']*')*(\"[^\"]*|'[^']*)?$/;\n\n/** The name of the attribute a hole's value starts in, AS WRITTEN (case kept: the parser lowercases), from the source before it. */\nexport const WRITTEN_NAME = /([^\\s\"'>/=]+)\\s*=\\s*(?:\"[^\"]*|'[^']*|[^\\s\"'>]*)$/;\n\n/** A text hole's marker is a comment holding `\\u0001` and its index; a value hole's is its index between two `\\u0002`s. */\n// eslint-disable-next-line no-control-regex -- the markers ARE control characters: ones no template's own text holds\nexport const TEXT_MARK = /^\\u0001(\\d+)$/;\n/** A value hole's marker, inside an attribute value: its index between two `\\u0002`s. */\n// eslint-disable-next-line no-control-regex -- the same\nexport const VALUE_MARK = /\\u0002(\\d+)\\u0002/g;\n/** A text marker as it reads inside HTML's RCDATA or raw text, where the parser leaves the comment as text. */\n// eslint-disable-next-line no-control-regex -- the same\nexport const TEXT_MARKS = /<!--\\u0001(\\d+)-->/g;\n\n/**\n * Elements a value never enters, by name in ANY namespace (Brian, 2026-11-17): `script` (its text is code, unless a JSON\n * data block), and those whose content is never shown — `iframe`, `noscript`, a `template`'s inert content, the obsolete\n * raw-text four. Never walked, so a hole anywhere inside one is missing, and refused. Their own attributes bind.\n */\nexport const RAW = /^(?:script|iframe|noscript|xmp|noembed|noframes|plaintext|template)$/i;\n\n/**\n * Elements whose content is TEXT, in any namespace (Brian, 2026-11-17): `title` (HTML's and SVG's accessible name),\n * `textarea`, and `style` — an author writing `<style>:host{--accent:${c}}</style>` means CSS. Their holes fill the\n * element's text, composed with its statics, never parsed.\n */\nexport const TEXT_ONLY = /^(?:title|textarea|style)$/i;\n\n/** A script start tag, whole and quote-aware (a `>` inside a quoted value does not end it). */\nexport const SCRIPT_START = /<script\\b(?:[^>\"']|\"[^\"]*\"|'[^']*')*>?/gi;\n\n/**\n * The strings every FORGED template renders as: the text any object renders as (`[object Object]`), one shared literal.\n * Module state, immutable: shared so every forgery reuses one preparation. A REAL tagged literal, so it is frozen and\n * owns `raw` by the language's own rule — the forged-template rule holds for it by construction (and it is 31 B gz\n * smaller than building that shape by hand, 2026-11-17).\n */\nconst FORGED = ((strings: TemplateStringsArray) => strings)`[object Object]`;\n\n/** A tagged template literal's strings: an array owning `raw` (core's check, identical). */\nconst literal = (strings: unknown) => Array.isArray(strings) && Object.hasOwn(strings, 'raw');\n\n/**\n * **Only a tagged template literal is a template** — core's rule, identical (`@verajs/renderer`'s `getTemplate`, the check\n * Lit makes): its strings array OWNS `raw`, which `JSON.parse` cannot give an array. A value from JSON shaped like a\n * template result (an API field an attacker can turn into an object) otherwise rendered as MARKUP in the small tiers\n * (found 2026-11-17; unreleased). Asked on a call site's cache MISS, which a forged array always is, so a cached\n * template pays nothing. A forgery renders as `FORGED`'s text, never a throw (the value is attacker-controlled);\n * development says so (`forged-template`, core's words).\n */\nexport const genuine = (strings: TemplateStringsArray): TemplateStringsArray => {\n if (literal(strings)) return strings;\n if (__DEV__) console.warn(diagnostic('lite', 'a child value', 'forged-template', __DEV__ && SHARED.forgedTemplate()));\n return FORGED;\n};\n\n/**\n * **Development: a binding refused, said as core's renderer says it** (its codes and `SHARED`'s words; lite's own label,\n * as its other diagnostics) — a refusal nobody is told about reads as a bug (CODE-PRINCIPLES §11: `onclick=${fn}` doing\n * nothing). Said at preparation, once per call site and name, as core decides it when it prepares a template: `bound`\n * is the binding as `check` reads it (a sigil name as written, else the parser's attribute name).\n */\nexport const sayRefused = (element: Element, bound: string) => {\n const where = `<${element.localName}>`;\n if (/^[.!]__proto__$/.test(bound)) console.warn(diagnostic('lite', where, 'proto-binding', __DEV__ && SHARED.protoBinding(bound)));\n else if (/^[@.!?]/.test(bound)) return;\n else if (bound === 'srcdoc') console.warn(diagnostic('lite', where, 'srcdoc-attribute', __DEV__ && SHARED.srcdocAttribute('.srcdoc=${…}')));\n else if (INLINE_HANDLER.test(bound))\n console.warn(\n diagnostic('lite', where, 'handler-attribute',\n __DEV__ && SHARED.handlerAttribute(bound, `\\`@${bound.slice(2)}=\\${…}\\` (or \\`on${bound[2]!.toUpperCase()}${bound.slice(3)}=\\${…}\\`)`))\n );\n};\n\n/** Development: a script URL refused at commit, said as core's renderer says it (`script-url`), each time the refused value changes. */\nexport const sayScriptUrl = (element: Element, name: string) =>\n console.warn(diagnostic('lite', `<${element.localName}>`, 'script-url', __DEV__ && SHARED.scriptUrl(name)));\n\n/** A name whose bound value would run or render as code, never written (an inline handler, `srcdoc`), as core refuses it. */\nexport const refusedName = (name: string) => INLINE_HANDLER.test(name) || name.toLowerCase() === 'srcdoc';\n\n/**\n * The pattern a URL-bearing name's value is checked against, or `null` for any other name: a whole URL (`href`, `src`,\n * `action`, `formaction`, `xlink:href`, `data`) is checked whole, an animation value list (`to`, `from`, `by`,\n * `values`) item by item.\n */\nexport const urlCheck = (name: string) => {\n const sink = URL_SINK.exec(name);\n return sink === null ? null : sink[1] ? SCRIPT_URL : SCRIPT_URL_ITEM;\n};\n\n/**\n * **Development: core's value diagnostics, in core's words** (Brian, 2026-11-19: lite says them too — the same checks\n * and prose, shared from `@verajs/shared-utils`; production carries none of it). A boolean at a child position renders\n * as the word, said on each change to one (core's rule).\n */\nexport const sayBooleanChild = (value: unknown) => {\n if (typeof value === 'boolean') console.warn(diagnostic('lite', 'a child position', 'boolean-child', __DEV__ && SHARED.booleanChild(String(value))));\n};\n/** Development: a whole attribute value that is not text (a function, an array, a Date…), once per element, name and kind. */\nexport const sayAttributeValue = (element: Element, name: string, value: unknown) => {\n const kind = value == null ? null : attributeValueKind(element.localName, name, value);\n if (kind !== null) console.warn(diagnostic('lite', `<${element.localName}>`, 'attribute-value', __DEV__ && SHARED.attributeValue(name, kind, `.${name}=\\${value}`)));\n};\n/**\n * Development: a handler that cannot listen (`@click=${'alert(1)'}` — `false`/`undefined` are the deliberate \"none\"), and\n * at a binding's FIRST handler a misspelled event name (`@clik`), once per tag and name — core's two checks.\n */\nexport const sayListener = (element: Element, name: string, value: unknown, first: boolean) => {\n if (value == null || value === false) return;\n if (typeof value !== 'function' && typeof (value as EventListenerObject).handleEvent !== 'function')\n console.warn(diagnostic('lite', `<${element.localName}>`, 'not-a-listener', __DEV__ && SHARED.notAListener(name, typeof value)));\n const best = first ? eventNameGuess(element, name) : null;\n if (best !== null) warnOnce('lite', `<${element.localName}>`, 'event-name-typo', __DEV__ && (() => SHARED.eventNameTypo(name, element.localName, best)), eventKey(element, name));\n};\n\n/**\n * Development: a value only core renders, in a text position — an object that is not a template or a list (a `keyed` or\n * `spread` result, a DOM node: rendered as its text here). Said once.\n */\nexport const onlyCore = (value: unknown) => {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) return;\n /**\n * Template-SHAPED (it holds `strings`) but no template: a forgery (`JSON.parse`), said in core's words\n * (`forged-template`), or a wrapper around a real literal's strings, which only core's `hold`/`tag` build — a template\n * to core, text here (2026-11-19, Brian: a recorded difference, said in development).\n */\n const strings = (value as { strings?: unknown }).strings;\n if (strings !== undefined) {\n if (Array.isArray(strings) && Object.hasOwn(strings, 'raw'))\n warnOnce('lite', 'html', 'template-wrapper', __DEV__ && (() => SHARED.templateWrapper()), 'template-wrapper');\n else warnOnce('lite', 'html', 'forged-template', __DEV__ && (() => SHARED.forgedTemplate()), 'forged-template');\n return;\n }\n const what = 'an object value (a `keyed` or `spread` result, a DOM node)';\n warnOnce('lite', 'html', 'tier-needs-core', __DEV__ && (() => PROSE['tier-needs-core'](what)), what);\n};\n","/**\n * **The lite tier's renderer: values patched in place.** A template is prepared once per call site (its `strings`\n * array): its HTML with a marker per hole, parsed into a `<template>`, walked once for where each hole is. Each instance\n * clones it and binds one part per hole; a render writes only what changed. Holes: text, attribute (whole or partial),\n * `?bool`, `.prop`, `!live`, `@event`, a nested template, an array (unkeyed, reused by index). The full tier's (`@verajs/core` + `@verajs/renderer`) template semantics,\n * with core's refusals (`markup.ts`); keyed lists, spread, refs and hydration are core's alone.\n */\nimport { JSON_BLOCK, SHARED, checkForeign, closedRawText, landing, misuse } from '@verajs/shared-utils';\nimport { PROSE } from './diagnostics.js';\nimport { IN_TAG, RAW, SCRIPT_START, TEXT_MARK, TEXT_MARKS, TEXT_ONLY, VALUE_MARK, WRITTEN_NAME, genuine, onlyCore, refusedName, sayAttributeValue, sayBooleanChild, sayListener, sayRefused, sayScriptUrl, urlCheck } from './markup.js';\nimport type { TemplateResult, LiteRoot } from './types.js';\n\n/**\n * Development: lite's sentence in the wrong-namespace advice (`checkForeign`), on another way to the right namespace —\n * there is none here but the tag (core's renderer can parse a template where it lands).\n */\nconst RETAG = ' (lite parses a template by its tag alone)';\n/** A hole's name for a hole that is its element's only child (`solePart`). */\nconst SOLE = '';\n/** A hole's name for a text-only element's content (`textPart`): `title`, `textarea`, `style`, a JSON data block. */\nconst TEXT = '\\u0003';\n\n/** A part: commits the value(s) starting at `at`. */\ntype Part = (values: readonly unknown[], at: number) => void;\n/**\n * A hole: the PATH to its node from the template's root (per level, how many `nextSibling` hops after `firstChild`), its\n * attribute name as written (`null` for a range, `SOLE` for an only child), its statics, the index of its first value.\n */\ntype Hole = [path: number[], name: string | null, statics: string[] | null, at: number];\n/**\n * A prepared template: the root every instance clones, its holes, whether it holds no custom element (`plain`), and\n * whether the root is the `<template>` element itself (`wrapped`: the server's DOM, which has no template content).\n */\ntype Prepared = [root: Node, holes: Hole[], plain: boolean, wrapped: boolean];\n/**\n * A list item: its first and last nodes, which stay for its life, and what it shows — a template instance (its strings,\n * parts and holes), a text node (neither; `_value` is the value it last wrote), or a nested list (a range between two\n * comments of its own).\n */\ntype Item = { _first: Node; _last: Node; _strings?: TemplateStringsArray; _parts?: Part[]; _holes?: Hole[]; _range?: Part; _value?: unknown };\n\n/**\n * Module state: each call site's prepared template, by its `strings` array, built once. Shared because every component\n * rendering a call site reuses its preparation; weak, so a call site's module unloading frees it.\n */\nconst prepared = new WeakMap<TemplateStringsArray, Prepared>();\n\n/** The path from `root` to `node`: per level down, the hops from the parent's first child. */\nconst pathTo = (node: Node, root: Node) => {\n const path: number[] = [];\n for (; node !== root; node = node.parentNode!) {\n let hops = 0;\n for (let sibling = node.previousSibling; sibling !== null; sibling = sibling.previousSibling) hops++;\n path.unshift(hops);\n }\n return path;\n};\n\nconst refuse = () => {\n throw new TypeError(misuse('html', 'tier-hole-position', __DEV__ && PROSE['tier-hole-position']()));\n};\n\n/**\n * Lands hole `at`: once, and of its kind (`text`, a text hole's marker; else a value hole's), or the template is refused —\n * an author's marker-shaped text standing in for a hole the parser lost is a duplicate, out of range, or the wrong kind.\n * `written[at]` is `null` exactly for a text hole (`prepare`).\n */\nconst land = (at: number, seen: boolean[], written: (string | null)[], text: boolean) => {\n if (seen[at] !== false || (written[at] === null) !== text) refuse();\n seen[at] = true;\n return at;\n};\n\n/**\n * `data` split by its markers (`marks` captures each hole's index), in one pass: every hole landed (`land`), and the\n * statics around them with the first hole's index (-1: none).\n */\nconst mark = (data: string, marks: RegExp, seen: boolean[], written: (string | null)[]): [statics: string[], first: number] => {\n const pieces = data.split(marks);\n const statics: string[] = [];\n let first = -1;\n for (let i = 0; i < pieces.length; i++)\n if (i % 2 === 0) statics.push(pieces[i]!);\n else {\n const at = land(+pieces[i]!, seen, written, marks === TEXT_MARKS);\n if (first === -1) first = at;\n }\n return [statics, first];\n};\n\n/** A hole found while checking: its node, its name (`null` a range, `SOLE`, `TEXT`, or an attribute's), its statics, its first value. */\ntype Found = [node: Node, name: string | null, statics: string[] | null, at: number];\n\n/**\n * **Checks every hole under `parent`, the template's first parse only** — each must land EXACTLY ONCE where it can be\n * filled (a comment holding exactly its marker; an attribute's value; a text-only element's text), or it is left unseen\n * and the template refused. A sigil binding (`@`, `.`, `!`, `?`) keeps its name AS WRITTEN (the parser lowercases), and\n * that name, lowercased, must be the parser's: a rough-scan naming error refuses the template rather than binding the\n * wrong property or event (the name backstop). Answers whether it met a custom element (a template holding one is\n * imported, not cloned: `instantiate`).\n */\nconst check = (parent: Node, seen: boolean[], found: Found[], written: (string | null)[], data: boolean): boolean => {\n let custom = false;\n for (let node = parent.firstChild; node !== null; node = node.nextSibling) {\n if (node.nodeType === 1) {\n const element = node as Element;\n if (element.localName.includes('-') || element.hasAttribute('is')) custom = true;\n /** False once `.innerHTML` or `.textContent` makes the content the author's value: a hole inside would be lost. */\n let walk = true;\n /** A script's type as the parser read it — the element that OPENED it, never a search of the text. */\n const type = element.localName === 'script' ? (element.getAttribute('type') ?? '') : '';\n /** Whether a value is bound on this element itself (a JSON block carrying one is refused, below). */\n let carries = false;\n for (const { name, value } of [...element.attributes]) {\n const [statics, at] = mark(value, VALUE_MARK, seen, written);\n if (at === -1) continue;\n carries = true;\n let bound = name;\n /**\n * A sigil binding, or `on` + a capital (`onClick=${fn}`, React muscle memory): core's rule, the renderer's own test\n * on the WRITTEN name, an event named by the rest, lowercased (Brian, 2026-11-17; parity rows in tests/lite.test.mjs).\n */\n if (/^[@.!?]/.test(name) || /^on[A-Z]/.test(written[at]!)) {\n bound = written[at]!;\n if (bound.toLowerCase() !== name) refuse();\n if (bound[0] === 'o') bound = `@${name.slice(2)}`;\n if (bound === '.innerHTML' || bound === '.textContent') walk = false;\n }\n element.removeAttribute(name);\n if (__DEV__) sayRefused(element, bound);\n found.push([node, bound, statics, at]);\n }\n if (!walk) continue;\n /**\n * A JSON block carrying a binding of its own is refused (2026-11-18): `?type=${false}`, `.type`, `!type` change the\n * type after it was judged here, and a page saved from the DOM then runs the value. Left unseen, so refused.\n */\n if (TEXT_ONLY.test(element.localName) || (element.localName === 'script' && data && !carries && JSON_BLOCK.test(type))) {\n /**\n * Its content as one string (in HTML RCDATA a marker is literal text, in SVG a comment); an element child stops it,\n * and so does the END marker (the template ends with the element open: a `<style/>` slip): left unseen.\n */\n let content = '';\n let textual = true;\n for (let child = element.firstChild; child !== null; child = child.nextSibling)\n if (child.nodeType === 3) content += (child as Text).data;\n else if (child.nodeType === 8) content += TEXT_MARK.test((child as Comment).data) ? `<!--${(child as Comment).data}-->` : '';\n else textual = false;\n if (textual && !content.includes(`<!--\\u0001${seen.length - 1}-->`)) {\n const [statics, at] = mark(content, TEXT_MARKS, seen, written);\n if (at !== -1) {\n element.textContent = '';\n found.push([node, TEXT, statics, at]);\n }\n }\n } else if (!RAW.test(element.localName) && check(node, seen, found, written, data)) custom = true;\n } else if (node.nodeType === 8) {\n const hole = TEXT_MARK.exec((node as Comment).data);\n if (hole !== null) found.push([node, null, null, land(+hole[1]!, seen, written, true)]);\n }\n }\n return custom;\n};\n\n/**\n * **A call site prepared, once:** its static text written with a marker per hole (the rough scan, `IN_TAG`, picks each\n * marker's form), one more after the end, parsed in a `<template>` (the server's DOM parses into the template itself) —\n * inside an `<svg>` or `<math>` root for an `svg` or `mathml` template (`type`) — every hole checked (`check`), then the\n * shape every instance clones.\n */\nconst prepare = (strings: TemplateStringsArray, doc: Document, type: number): Prepared => {\n let source = strings[0]!;\n /** Per hole, its attribute name as written (`''` in a tag where none reads), or `null` for a text hole; the end marker's too. */\n const written: (string | null)[] = [];\n for (let i = 1; i < strings.length; i++) {\n const tag = IN_TAG.exec(source);\n written.push(tag ? (WRITTEN_NAME.exec(source)?.[1] ?? '') : null);\n /**\n * An unquoted value followed by `/>` would absorb the slash (`<circle r=${r}/>` gives `r=\"5/\"` to the parser): a\n * space keeps it out, as core's renderer writes one — for every such hole (core's own scan, for an attribute's first).\n */\n source += (tag ? `\\u0002${i - 1}\\u0002${tag[1] || !strings[i]!.startsWith('/>') ? '' : ' '}` : `<!--\\u0001${i - 1}-->`) + strings[i];\n }\n written.push(null);\n const template = doc.createElement('template');\n /**\n * An `svg` or `mathml` template parses inside its root element, as core's renderer parses it; one more marker after\n * the end (inside that root): a template ending inside a tag, a comment or raw text swallows it.\n */\n const wrap = ['', '', 'svg', 'math'][type];\n const endMark = `<!--\\u0001${strings.length - 1}-->`;\n template.innerHTML = wrap ? `<${wrap}>${source}${endMark}</${wrap}>` : source + endMark;\n /** The server's DOM has no template content: its parse lands in the template itself (`instantiate` unwraps it). */\n const content: DocumentFragment | HTMLTemplateElement = template.content ?? template;\n /**\n * The root removed and EVERYTHING the parser made kept, in place: an HTML element written in foreign content breaks\n * out of it, and lands after it (core's rule — the template shows what the parser made, never less).\n */\n if (wrap) (content.firstChild as Element).replaceWith(...content.firstChild!.childNodes);\n /**\n * No script is a data block when any script start tag in the statics holds an `&` (matched whole, quote-aware): the\n * server reads the RAW type and refuses a character reference there (`dataBlock`), so the client refuses it too.\n */\n let data = true;\n for (const [tag] of strings.join('').matchAll(SCRIPT_START)) if (tag.includes('&')) data = false;\n const seen: boolean[] = new Array(strings.length).fill(false);\n const found: Found[] = [];\n const custom = check(content, seen, found, written, data);\n /** A hole missing; else the END marker swallowed: the template ends inside a tag, a comment or raw text. */\n const missing = seen.indexOf(false);\n if (missing !== -1) {\n if (missing < strings.length - 1) refuse();\n throw new TypeError(misuse('html', 'unfinished-tag', __DEV__ && SHARED.unfinishedTag()));\n }\n /**\n * The end marker has done its work: removed, so no instance carries it. It is the LAST hole found — the last text in\n * the source, and holes are found in document order — and anything else in that place refuses the template, so a\n * broken assumption can only refuse, never remove a node that is not the marker.\n */\n const [marker, , , last] = found.pop()!;\n if (last !== strings.length - 1) refuse();\n (marker as Comment).remove();\n /** An empty template still has a first node, so an instance of it can be a list item (bounded by its own nodes). */\n if (content.firstChild === null) content.append(doc.createTextNode(''));\n /**\n * A range is \"after its boundary\": a template that STARTS with a hole gets an empty comment as that boundary, since an\n * instance's first node has no stable node before it once inserted.\n */\n const first = content.firstChild!;\n if (first.nodeType === 8 && TEXT_MARK.test((first as Comment).data)) content.prepend(doc.createComment(''));\n /**\n * A hole that is its ELEMENT's only child needs no range: its marker becomes an empty text node IN THE TEMPLATE, so\n * every instance is cloned holding it and a render only sets its data (`solePart`).\n */\n for (let i = 0; i < found.length; i++) {\n const [node, name, , at] = found[i]!;\n if (name === null && node.parentNode !== content && node.parentNode!.childNodes.length === 1) {\n const parent = node.parentNode!;\n (node as Comment).replaceWith(doc.createTextNode(''));\n found[i] = [parent, SOLE, null, at];\n }\n }\n /** A template that is ONE element clones that element: one node to clone and to insert, no fragment (core's root). */\n const root = content.childNodes.length === 1 && content.firstChild!.nodeType === 1 ? content.firstChild! : content;\n return [root, found.map(([node, name, statics, at]) => [pathTo(node, root), name, statics, at]), !custom, root === template];\n};\n\n/**\n * **One instance: the template's root cloned, and a part per hole, located by its path BEFORE anything commits** (a\n * committed value inserts nodes, which would shift the siblings a later path counts). A plain template is cloned in its\n * own inert document and adopted on insertion — creating an element in a document with a custom-element registry costs\n * a definition lookup each; one holding a custom element is imported into the page's document, which upgrades it at\n * clone time, so a `.prop` commit reaches its setter (core's rule, `@verajs/renderer`'s instantiate).\n */\nconst instantiate = (strings: TemplateStringsArray, doc: Document, type: number): [Node, Part[], Hole[]] => {\n let entry = prepared.get(strings);\n if (entry === undefined) {\n /**\n * A forged template (JSON-shaped, `genuine`) renders as the forgery's text, as HTML: its own values are never read,\n * and its kind never chooses a namespace.\n */\n const real = genuine(strings);\n if (real !== strings) return instantiate(real, doc, 1);\n prepared.set(strings, (entry = prepare(strings, doc, type)));\n }\n const [root, holes, plain, wrapped] = entry;\n let clone = plain ? root.cloneNode(true) : doc.importNode(root, true);\n /**\n * A plain loop: a `map` arrow here would capture `clone`, a closure made on every instance (the hot-path rule).\n * **`parts` is a copy of `holes`, overwritten in place, so its storage is EXACTLY one slot per hole** (2026-11-17):\n * `parts` lives as long as the instance, and `[]` grown by `push` makes V8 reserve 17 slots for 3 entries (shown by\n * `%DebugPrint` on the built bundle). In Chrome, after rows were created and cleared on the page, appending 1 000 rows\n * was ~9% slower with `push` on every page: not its own script, which was within 0.15 ms, but the page's collection\n * schedule and the layout that followed it. A copy of `holes` has the right length and is already PACKED_ELEMENTS\n * (holes are tuples), so storing a part never changes its kind. The trade, accepted by Brian: on the first append in\n * a fresh page, exact-size arrays read slow on ~6 of 10 page loads (~+5%), where `push` did not.\n */\n const parts = holes.slice() as unknown as Part[];\n for (let i = 0; i < holes.length; i++) {\n const [path, name, statics] = holes[i]!;\n let node = clone;\n for (let step = 0; step < path.length; step++) {\n node = node.firstChild!;\n for (let hops = path[step]!; hops > 0; hops--) node = node.nextSibling!;\n }\n parts[i] = (\n name === null ? childPart(node.previousSibling, node as Comment)\n : name === SOLE ? solePart(node.firstChild as Text)\n : name === TEXT ? textPart(node as Element, statics!)\n : attrPart(node as Element, name, statics!)\n );\n }\n /** On the server the root is the parse's `<template>` element: its children, located above, are the instance. */\n if (wrapped) {\n const fragment = doc.createDocumentFragment();\n fragment.append(...clone.childNodes);\n clone = fragment;\n }\n return [clone, parts, holes];\n};\n\nconst commit = (parts: Part[], holes: Hole[], values: readonly unknown[]) => {\n for (let i = 0; i < parts.length; i++) parts[i]!(values, holes[i]![3]);\n};\n\n/** Removes `first` and every node after it, up to and with `last`. */\nconst removeRun = (first: Node, last: Node) => {\n /** Every node here is a child node (an element, text or a comment), so it has `remove`. */\n for (let node = first as ChildNode; ; ) {\n const next = node.nextSibling!;\n node.remove();\n if (node === last) return;\n node = next;\n }\n};\n\n/**\n * **Core's child rule for a list** (2026-11-19, the tier suites: a `Set` rendered `[object Set]`): an array, or any other\n * iterable OBJECT that is not a node — a `Set`, a `Map`'s entries, a generator — renders its items; a string (iterable\n * too, but a primitive) is one text, and a `<select>` or `<form>` (iterable nodes) is placed, never listed. Asked after\n * the template check, so a template or an array pays nothing for it.\n */\nconst isList = (value: unknown): boolean =>\n Array.isArray(value) ||\n (value !== null && typeof value === 'object' && typeof (value as Iterable<unknown>)[Symbol.iterator] === 'function' && (value as Node).nodeType === undefined);\n\n/**\n * A value's text at a child position. An object holding `strings` is template-SHAPED — a forgery (`JSON.parse`) or a\n * wrapper only core's `hold`/`tag` build — and never a template here: it renders as the constant text any object renders\n * as, NEVER converted (its own `toString` may be data, and a string there throws), as core renders a forgery.\n */\nconst childText = (value: unknown): string =>\n value == null ? '' : typeof value === 'object' && (value as { strings?: unknown }).strings !== undefined ? FORGED : `${value}`;\nconst FORGED = `${{}}`;\n\n/** Never a value: what an attribute part last wrote before its first write (core's `UNSET`). */\nconst UNSET = {};\n\n/**\n * **A new list item from `list[i]`, inserted into `parent` before `before`** — no comment of its own unless it needs one:\n * a template instance is bounded by its own first and last nodes (a one-element template is that element; one that\n * starts with a hole has a boundary comment; one that ends with a hole ends at that hole's comment), and a text value is\n * its text node. Anything else (a nested list) is a range between two comments, since nothing else bounds it.\n */\nconst makeItem = (source: readonly unknown[], at: number, parent: Node, before: Node | null): Item => {\n const value = source[at];\n const doc = parent.ownerDocument!;\n if ((value as TemplateResult | null)?._$litType$) {\n const { strings, values, _$litType$: type } = value as TemplateResult;\n const [clone, parts, holes] = /*@__NOINLINE__*/ instantiate(strings, doc, type);\n commit(parts, holes, values);\n const fragment = clone.nodeType === 11;\n const item: Item = { _first: fragment ? clone.firstChild! : clone, _last: fragment ? clone.lastChild! : clone, _strings: strings, _parts: parts, _holes: holes };\n /** Development: an element placed where its namespace does not render (a list's batch is checked where it lands). */\n if (__DEV__ && parent.nodeType !== 11) checkForeign('lite', parent, landing(clone), RETAG);\n parent.insertBefore(clone, before);\n return item;\n }\n if (isList(value)) {\n const first = doc.createComment('');\n const last = doc.createComment('');\n parent.insertBefore(first, before);\n parent.insertBefore(last, before);\n const range = childPart(first, last);\n range(source, at);\n return { _first: first, _last: last, _range: range };\n }\n if (__DEV__) onlyCore(value);\n if (__DEV__) sayBooleanChild(value);\n const text = doc.createTextNode(childText(value));\n parent.insertBefore(text, before);\n return { _first: text, _last: text, _value: value };\n};\n\n/** Renders `source[at]` into `items[i]`: in place when it is the same kind, or a new item takes its place. */\nconst updateItem = (items: Item[], i: number, source: readonly unknown[], at: number) => {\n const item = items[i]!;\n const value = source[at];\n if ((value as TemplateResult | null)?._$litType$) {\n if (item._strings === (value as TemplateResult).strings) return commit(item._parts!, item._holes!, (value as TemplateResult).values);\n } else if (isList(value)) {\n if (item._range !== undefined) return item._range(source, at);\n } else if (item._strings === undefined && item._range === undefined) {\n /** Compared with the value it last WROTE, never read back from the DOM (a read is a call into the engine per item). */\n if (value !== item._value) {\n if (__DEV__) sayBooleanChild(value);\n (item._first as Text).data = childText((item._value = value));\n }\n return;\n }\n items[i] = makeItem(source, at, item._last.parentNode!, item._last.nextSibling);\n removeRun(item._first, item._last);\n};\n\n/**\n * **A range: the nodes after `start` (from its parent's first child when `start` is `null`) up to `end`**, a comment kept\n * while the part lives. Everything the part shows, and everything its nested parts show, however they changed since,\n * lies inside it — so clearing removes exactly the range, and a range that is its parent's whole content clears in one\n * call. A single value is ONE item and a list is one item per element (`makeItem`, `updateItem`), so a template instance\n * (filled BEFORE it is inserted: one insertion) and text are made the same way in both; new list items are rendered into\n * one fragment and inserted once.\n */\nconst childPart = (start: Node | null, end: Comment): Part => {\n /** What the range shows: one item for a single value, one per element for a list (`list`), nothing when `undefined`. */\n let items: Item[] | undefined;\n let list = false;\n const clear = () => {\n if (items === undefined) return;\n if (start === null && end.nextSibling === null) end.parentNode!.replaceChildren(end);\n else\n for (let node = start === null ? end.parentNode!.firstChild! : start.nextSibling!; node !== end; ) {\n const next = node.nextSibling!;\n node.remove();\n node = next;\n }\n items = undefined;\n };\n return (values, at) => {\n let value = values[at];\n /** A non-array list (core's rule, `isList`) renders as the array of its items, read once per render. */\n if (!Array.isArray(value) && !(value as TemplateResult | null)?._$litType$ && isList(value)) value = [...(value as Iterable<unknown>)];\n if (Array.isArray(value)) {\n if (!list || items === undefined || value.length === 0) {\n clear();\n items = [];\n list = true;\n }\n const had = items.length;\n if (had > value.length) {\n /** The dropped items are one run of nodes: the first dropped item's first to the last item's last. */\n removeRun(items[value.length]!._first, items[had - 1]!._last);\n items.length = value.length;\n }\n for (let i = 0; i < Math.min(had, value.length); i++) updateItem(items, i, value, i);\n if (had < value.length) {\n /** New items are built in one fragment and inserted once. */\n const batch = end.ownerDocument.createDocumentFragment();\n for (let i = had; i < value.length; i++) items.push(makeItem(value, i, batch, null));\n if (__DEV__) checkForeign('lite', end.parentNode!, landing(batch), RETAG);\n end.before(batch);\n }\n } else if (value == null) clear();\n else if (list || items === undefined) {\n clear();\n list = false;\n items = [makeItem(values, at, end.parentNode!, end)];\n } else updateItem(items, 0, values, at);\n };\n};\n\n/**\n * **A hole that is its element's only child** (`<td>${id}</td>`, every cell of a table): it sets the data of the text node\n * the template already holds there — no comment, no insertion — until a value that is not text arrives (a template, a\n * list), when a comment takes the text's place as the end of a range that takes over for good.\n */\nconst solePart = (text: Text): Part => {\n let range: Part | undefined;\n /** The value last written, compared instead of reading the DOM back; `undefined` matches the template's empty text. */\n let last: unknown;\n return (values, at) => {\n const value = values[at];\n if (range === undefined && (value == null || typeof value !== 'object')) {\n if (value !== last) {\n if (__DEV__) sayBooleanChild(value);\n text.data = (last = value) == null ? '' : `${value}`;\n }\n } else {\n if (range === undefined) {\n const end = text.ownerDocument.createComment('');\n text.replaceWith(end);\n range = childPart(null, end);\n }\n range(values, at);\n }\n };\n};\n\n/**\n * A value as text, for a text-only element's content — the rule every tier and the server follow: `null`/`undefined`\n * none, a list its items' text (nested lists flattened by the same rule), a TEMPLATE refused (`template-in-text`, as\n * `@verajs/ssr` refuses it), otherwise the value as a string. A forged template (strings not owning `raw`) is no\n * template: its string.\n */\nconst textOf = (value: unknown): string => {\n if (value == null) return '';\n if (Array.isArray(value)) {\n let text = '';\n for (const item of value) text += textOf(item);\n return text;\n }\n const strings = (value as TemplateResult)._$litType$ ? (value as TemplateResult).strings : undefined;\n if (Array.isArray(strings) && Object.hasOwn(strings, 'raw'))\n throw new TypeError(misuse('html', 'template-in-text', __DEV__ && SHARED.templateInText()));\n return `${value}`;\n};\n\n/**\n * **A text-only element's content** (`title`, `textarea`, `style`, a JSON data block): its statics and its holes' values\n * as text, written as `textContent` (never parsed) when they changed — compared with the text last written.\n */\nconst textPart = (element: Element, statics: string[]): Part => {\n let last: string | undefined;\n /**\n * An HTML `<style>`'s or JSON block's text is serialized VERBATIM by the browser, so written as it is, a value would\n * become markup the moment the page is saved through `innerHTML`/`outerHTML` and parsed again (2026-11-18, measured on\n * three engines). So the COMPOSED text — statics and values together, since a closer can form across a hole (a static\n * `<` before a value `/style>`) — is written closed (`closedRawText`), as the renderer and `@verajs/ssr` write it, byte\n * for byte. HTML elements only — the upper-case `tagName` of an HTML document: an SVG `<style>` or `<script>` is\n * serialized escaped like any text, as core and the server leave it. Title and textarea are RCDATA, which\n * serialization escapes already.\n */\n const raw = element.tagName === 'STYLE' ? 1 : element.tagName === 'SCRIPT' ? 2 : 0;\n return (values, at) => {\n let text = statics[0]!;\n for (let i = 1; i < statics.length; i++) text += textOf(values[at + i - 1]) + statics[i]!;\n if (text !== last) element.textContent = raw ? /*@__NOINLINE__*/ closedRawText((last = text), raw > 1) : (last = text);\n };\n};\n\n/** One attribute hole: `@event`, `.prop`, `!live`, `?bool`, or an attribute, whole or with statics around its holes. */\nconst attrPart = (element: Element, name: string, statics: string[]): Part => {\n const prefix = name[0];\n const real = name.slice(1);\n const target = element as unknown as Record<string, unknown>;\n /** The value last written; a sentinel at first, so a first `undefined` is WRITTEN as core writes it (2026-11-19). */\n let last: unknown = UNSET;\n if (prefix === '@') {\n let handler: unknown;\n /** One listener per hole, registered once; a new handler only replaces what it calls. `this` is the element (core's). */\n element.addEventListener(real, {\n handleEvent(event: Event) {\n if (typeof handler === 'function') handler.call(element, event);\n else (handler as EventListenerObject | null)?.handleEvent?.(event);\n },\n });\n return (values, at) => {\n if (__DEV__) sayListener(element, real, values[at], handler == null);\n handler = values[at];\n };\n }\n if (prefix === '?')\n return (values, at) => {\n if (!!values[at] !== last) element.toggleAttribute(real, (last = !!values[at]));\n };\n /** `.prop` and `!live` write a property; anything else an attribute, by its parser name. */\n const property = prefix === '.' || prefix === '!';\n const key = property ? real : name;\n /**\n * Refused, as core refuses them: `.__proto__` would replace the element's prototype; a bound inline handler or `srcdoc`\n * attribute would run its value as code or markup. Kept a CALL, never pasted in (CLAUDE.md, the one-caller rule): as\n * this function's only caller, the minifier would substitute it here as an arrow made and invoked on every call —\n * every attribute hole created (both checks).\n */\n if (property ? real === '__proto__' : /*@__NOINLINE__*/ refusedName(name)) return () => {};\n const check = /*@__NOINLINE__*/ urlCheck(key);\n /** A component's URL-named property is its own business (often an object): only a string is checked there (core's). */\n const custom = property && element.localName.includes('-');\n const whole = statics.length === 2 && !statics[0] && !statics[1];\n /** Development: the script URL last refused, so a refusal is said each time the value changes (core's rule). */\n let refused: unknown;\n return (values, at) => {\n /** The statics and values joined by a plain loop: a `reduce` arrow here would capture `values` and `at` on every commit. */\n let value: unknown = values[at];\n if (!whole) {\n let joined = statics[0]!;\n for (let i = 1; i < statics.length; i++) joined += `${values[at + i - 1] ?? ''}${statics[i]}`;\n value = joined;\n }\n /**\n * A script URL is refused on the JOINED value and its attribute removed, as core does, for an attribute and a property\n * alike. Converted ONCE, so the string checked is the string written: an object whose `toString` answers differently\n * each time cannot pass as `https:` and be written as `javascript:`.\n */\n if (check !== null && value != null && (!custom || typeof value === 'string')) {\n value = `${value}`;\n if (check.test(value as string)) {\n if (__DEV__ && value !== refused) sayScriptUrl(element, key);\n if (__DEV__) refused = value;\n element.removeAttribute(key);\n last = UNSET;\n return;\n }\n }\n /** A LIVE property is compared against the element's current value (what was typed), as core's `!name`. */\n if (prefix === '!') {\n if (target[key] !== value) target[key] = value;\n } else if (value !== last) {\n last = value;\n if (property) target[key] = value;\n else if (value == null) element.removeAttribute(key);\n else {\n if (__DEV__ && whole) sayAttributeValue(element, key, values[at]);\n element.setAttribute(key, value as string);\n }\n }\n };\n};\n\n/** Paints `result` into `root`: the first paint clears what was there (served markup included) and anchors one range. */\nexport const patch = (result: unknown, root: LiteRoot) => {\n if (root._$t$ === undefined) {\n const end = root.ownerDocument.createComment('');\n root.replaceChildren(end);\n root._$t$ = childPart(null, end);\n }\n root._$t$([result], 0);\n};\n","/**\n * **When a small-tier component renders: a write queues it, and one microtask renders every queued component**, however\n * many writes landed first. No scheduler, no priorities, no tracking graph: a declared prop's setter and a signal's setter both end here.\n */\nimport { patch } from './patch.js';\nimport type { LiteElement } from './types.js';\n\n/**\n * Module state: the component whose render function is running, so a signal read during it subscribes that component.\n * Module-level because a signal is created anywhere (a module, a setup) and must find the render reading it. An object,\n * not an exported `let`: a hot read of an exported binding is slower (CLAUDE.md).\n */\nexport const reading: { element: LiteElement | undefined } = { element: undefined };\n\n/**\n * Module state: the components waiting to render, in the order they were queued. ONE microtask renders them all, and a\n * render queued DURING that flush (a parent's commit handing a child new props) joins it, so a parent and its children\n * are drawn before anything that awaited the write runs (the full tier's flush, `@verajs/core`'s, does the same). Module-level because every write,\n * from any component or signal, queues here.\n */\nconst pending: LiteElement[] = [];\n\n/** Lets go of every signal `element` read: before each render (which reads afresh), and when it is retired. */\nexport const unlink = (element: LiteElement) => {\n if (element._$l$ !== undefined) for (const readers of element._$l$) readers.delete(element);\n element._$l$ = undefined;\n};\n\n/**\n * Renders `element` now: its render function's result, patched into its root (`patch`). Nothing for an\n * element that is not connected, or whose setup returned no render function.\n * - It is no longer queued from the moment it starts, so a write DURING its own render queues it again (and a queued\n * entry for a render that already happened, on connect, is skipped by the flush).\n * - It subscribes only to what THIS render reads: it leaves every signal the last one read first, so a component never\n * holds a signal it no longer reads (a long-lived shell reading a churning list's rows would otherwise grow).\n * - `reading` is restored in a `finally`, so a render that throws never leaves later reads subscribing the wrong component.\n */\nexport const render = (element: LiteElement) => {\n element._$u$ = false;\n const draw = element._$f$;\n if (typeof draw === 'function' && element.isConnected) {\n unlink(element);\n const outer = reading.element;\n reading.element = element;\n let result: unknown;\n try {\n result = draw();\n } finally {\n reading.element = outer;\n }\n /** Kept a CALL, never pasted in (CLAUDE.md, the one-caller rule): as this function's only caller, the minifier would substitute it here as an arrow made and invoked on every render. */\n /*@__NOINLINE__*/ patch(result, element._$r$!);\n }\n};\n\n/**\n * Renders every component still queued, walking the queue by index. One that throws is reported as its error escapes:\n * it and everything before it are consumed, and whatever remains is rendered by a fresh flush, so one failure never\n * strands the rest or renders anything twice.\n */\nconst flush = () => {\n let i = 0;\n try {\n for (; i < pending.length; i++) if (pending[i]!._$u$) render(pending[i]!);\n } finally {\n pending.splice(0, i + 1);\n if (pending.length !== 0) queueMicrotask(flush);\n }\n};\n\n/** Queues one render of `element`; a second write before it runs adds nothing. */\nexport const queue = (element: LiteElement) => {\n if (!element._$u$) {\n element._$u$ = true;\n if (pending.push(element) === 1) queueMicrotask(flush);\n }\n};\n","import { SHARED, camel, checkDefinition, errorOnce, warnOnce } from '@verajs/shared-utils';\nimport { PROSE } from './diagnostics.js';\nimport { queue, render, unlink } from './schedule.js';\nimport type { Methods, DefinedClass, DefineOptions, LiteElement, WithAttributes } from './types.js';\n\n/** An array or plain-object default is copied per element, as core copies it; nested values stay shared. */\nconst own = (value: unknown) =>\n Array.isArray(value) ? [...value] : (value as object | null)?.constructor === Object ? { ...(value as object) } : value;\n\n/** Lets go of a component for good: its signals stop queuing it, and a later connect runs its setup again (as core). */\nconst retire = (element: LiteElement) => {\n unlink(element);\n element._$f$ = undefined;\n};\n\n/** Development: an option only core has (`foreignNodes`, `persist`, a module's key, a `ShadowRootInit`), said once per tag and key. */\nconst checkOptions = (tag: string, options: object) => {\n for (const [key, value] of Object.entries(options))\n if (!['tag', 'props', 'attributes', 'methods', 'shadow'].includes(key) || (key === 'shadow' && ![undefined, false, 'open', 'closed'].includes(value)))\n warnOnce('lite', `define('${tag}')`, 'tier-needs-core', __DEV__ && (() => PROSE['tier-needs-core'](`\\`${key}: ${typeof value === 'object' ? 'an object' : String(value)}\\``)), `${tag} ${key}`);\n};\n\n/**\n * Development: what a setup returned, when it is not a render function — core's words: a value is drawn once (in both\n * packages), a promise is an async setup, which is core's.\n */\nconst checkSetupResult = (element: LiteElement, out: unknown) => {\n if (typeof (out as PromiseLike<unknown> | null)?.then === 'function')\n warnOnce('lite', `<${element.localName}>`, 'tier-needs-core', __DEV__ && (() => PROSE['tier-needs-core']('an async setup')), element.constructor);\n else if (out !== undefined && typeof out !== 'function') {\n const kind = Array.isArray(out) ? 'an array' : typeof out === 'object' ? 'a template or object' : `a ${typeof out}`;\n errorOnce('lite', `<${element.localName}>`, 'setup-returned-value', __DEV__ && (() => SHARED.setupReturnedValue(kind)), element.constructor);\n }\n};\n\n/**\n * **`@verajs/lite`'s `define`**, rendering through its one renderer (`patch.ts`, called by `render` in `schedule.ts`).\n * `@verajs/core`'s call shape — `define(tag, setup)` or `define({ tag, props, attributes, methods, shadow }, setup)` — with the\n * reactivity reduced to a setter: a declared prop is an accessor on the generated prototype over the element's ONE values\n * record (`_$v$`, core's name and meaning), and a write that differs by `Object.is` queues one render. An observed\n * attribute arrives as its camel-cased prop, one way, as in core.\n *\n * - **Setup runs once per life, as core's:** a component removed and re-added in the same task (a move) keeps it; one\n * still out a microtask later is retired, and its next connect sets it up again. Props survive, as core's do.\n * - **A value set before the tag was defined** is an own property hiding the accessor: handed over through it at connect.\n * - **An own `__proto__` key** (`JSON.parse` makes one) is skipped in props and methods, as core skips it.\n * - **A setup that returns a value, not a render function, draws it once** (core's behavior and core's development error);\n * one that returns nothing, or a promise (an async setup, core's alone), draws nothing.\n * - An author's `methods.disconnectedCallback` runs first on removal, as core chains it.\n * - Development checks the definition in core's words (`checkDefinition`) and names every option only core has.\n */\nexport const define = <M extends Methods = Record<never, never>, P extends object = Record<never, never>, A extends readonly string[] = []>(\n target: string | (DefineOptions & { props?: P; attributes?: A; methods?: M & ThisType<HTMLElement & WithAttributes<P, A> & M> }),\n setup: (host: HTMLElement & WithAttributes<P, A> & M) => (() => unknown) | void\n): DefinedClass<WithAttributes<P, A> & M> => {\n let tag = target as string;\n let props: object | undefined;\n let attributes: readonly string[] = [];\n let methods: M | undefined;\n let shadow: DefineOptions['shadow'];\n if (typeof target !== 'string') ({ tag, props, attributes = [], methods, shadow } = target);\n if (__DEV__) {\n checkDefinition('lite', tag, setup, methods, props, typeof target === 'string' ? undefined : target.attributes, false);\n if (typeof target !== 'string') checkOptions(tag, target);\n }\n /** Each declared attribute is a prop under its camel name, default `null` unless a declared prop shares it. */\n const camels: Record<string, string> = {};\n const declared: Record<string, unknown> = {};\n for (const name of attributes) declared[(camels[name] = camel(name))] = null;\n const defaults: Record<string, unknown> = { ...declared, ...props };\n const keys = Object.keys(defaults).filter((key) => key !== '__proto__');\n const fill = () => {\n const record: Record<string, unknown> = {};\n for (const key of keys) record[key] = own(defaults[key]);\n return record;\n };\n const write = (element: LiteElement, key: string, value: unknown) => {\n const record = (element._$v$ ??= fill());\n if (!Object.is(record[key], value)) {\n record[key] = value;\n queue(element);\n }\n };\n const Class = class extends HTMLElement {};\n const installed: Record<string, unknown> = { ...methods };\n delete installed.__proto__;\n /** Methods first, so a method named like a callback never replaces one (core's order). */\n Object.assign(Class.prototype, installed, {\n constructor: Class,\n connectedCallback(this: LiteElement) {\n if (this._$f$ === undefined) {\n for (const key of keys)\n if (Object.hasOwn(this, key)) {\n const value = (this as unknown as Record<string, unknown>)[key];\n delete (this as unknown as Record<string, unknown>)[key];\n (this as unknown as Record<string, unknown>)[key] = value;\n }\n /** `shadowRoot` first: a declarative shadow root the server sent is the one to render into. */\n this._$r$ ??= shadow ? (this.shadowRoot ?? this.attachShadow({ mode: shadow })) : this;\n const out: unknown = setup(this as never);\n if (__DEV__) checkSetupResult(this, out);\n /** A promise is an async setup, which is core's: it draws nothing here (development says so). */\n this._$f$ =\n typeof out === 'function'\n ? (out as () => unknown)\n : out === undefined || typeof (out as PromiseLike<unknown>).then === 'function'\n ? null\n : () => out;\n }\n render(this);\n },\n disconnectedCallback(this: LiteElement) {\n (installed.disconnectedCallback as (() => void) | undefined)?.call(this);\n queueMicrotask(() => {\n /** Kept a CALL, never pasted in (CLAUDE.md, the one-caller rule): as this function's only caller, the minifier would substitute it here as an arrow made and invoked on every call — every removal. */\n if (!this.isConnected) /*@__NOINLINE__*/ retire(this);\n });\n },\n });\n /** Observed attributes only on a tag that declares some: every callback a class defines is creation work. */\n if (attributes.length) {\n (Class as unknown as { observedAttributes: readonly string[] }).observedAttributes = attributes;\n (Class.prototype as unknown as { attributeChangedCallback: unknown }).attributeChangedCallback = function (\n this: LiteElement,\n name: string,\n _old: string | null,\n value: string | null\n ) {\n write(this, camels[name]!, value);\n };\n }\n for (const key of keys)\n Object.defineProperty(Class.prototype, key, {\n get(this: LiteElement) {\n return (this._$v$ ??= fill())[key];\n },\n set(this: LiteElement, value: unknown) {\n write(this, key, value);\n },\n configurable: true,\n enumerable: true,\n });\n customElements.define(tag, Class);\n return customElements.get(tag) as unknown as DefinedClass<WithAttributes<P, A> & M>;\n};\n","import { warnOnce } from '@verajs/shared-utils';\nimport { PROSE } from './diagnostics.js';\nimport { reading, queue } from './schedule.js';\nimport type { Signal, LiteElement } from './types.js';\n\n/** Where a signal keeps its value and its readers: symbols private to this copy, so no key, spread or JSON shows them. */\nconst HELD = Symbol();\nconst READERS = Symbol();\ntype Held = { [HELD]: unknown; [READERS]?: Set<LiteElement> };\n\n/**\n * **What every small-tier signal shares: one accessor pair on one frozen prototype — the full tier's (`@verajs/core`'s) shape** (`modules/signal.ts`),\n * so a signal reads, writes, stringifies and enumerates the same in every tier: `Object.keys` and `for…in` list nothing,\n * `JSON.stringify` writes the value, its tag is `[object Signal]`. Reading `.value` during a render subscribes that\n * component (`reading`); a write that differs by `Object.is` queues every subscriber. The component, not a graph, is\n * the unit: no computed, no effect, nothing to unlink but the components, which let go when they are retired.\n */\nconst SIGNAL = Object.freeze(\n Object.defineProperties(\n {},\n {\n [Symbol.toStringTag]: { value: 'Signal' },\n value: {\n get(this: Held) {\n const element = reading.element;\n if (element !== undefined) {\n const readers = (this[READERS] ??= new Set());\n readers.add(element);\n (element._$l$ ??= new Set()).add(readers);\n }\n return this[HELD];\n },\n set(this: Held, next: unknown) {\n if (Object.is(this[HELD], next)) return;\n this[HELD] = next;\n const readers = this[READERS];\n if (readers !== undefined) for (const element of readers) queue(element);\n },\n },\n toJSON: {\n value(this: Held) {\n return this[HELD];\n },\n },\n },\n ),\n);\n\n/** The empty call first so a no-argument call matches it, the valued one last so `ReturnType` means the common case (as core). */\ntype SignalFactory = {\n <T = undefined>(): Signal<T | undefined>;\n <T>(initialValue: T): Signal<T>;\n};\n\n/**\n * **A reactive box for one value, read and written as `.value`; shallow, as core's default.** Replacing `.value` re-renders\n * every component that read it; mutating inside it does not. Core's `{ deep: true }` is core's alone.\n */\nexport const signal: SignalFactory = <T,>(initialValue?: T, options?: unknown) => {\n if (__DEV__ && options !== undefined)\n warnOnce('lite', 'signal', 'tier-needs-core', __DEV__ && (() => PROSE['tier-needs-core'](\"`signal`'s options (`{ deep: true }`)\")));\n const box = Object.create(SIGNAL) as Held;\n box[HELD] = initialValue;\n return box as unknown as Signal<T>;\n};\n","/**\n * **`@verajs/lite`'s template tags, `html`, `svg` and `mathml`**: the same tags as `@verajs/core`'s\n * (`packages/core/src/store/store.ts`), a second copy on purpose (2026-11-18). When both packages took the tags from one\n * shared-utils module, they moved within core's production bundle, and core's create1k measured +3.5% slower in Chrome\n * (20 sessions, A/A valid); with its own copy, core's bundle is byte-identical to the one raced at release.\n * `tests/lite.test.mjs` holds the two copies to one shape — never fold them back into one. Each tag is written out, as\n * core's are (one function per kind: no tag built by a factory, so each stays a plain function the engine inlines).\n *\n * Called with a string instead of tagged, development names it, in core's words (`tag-called`): `html('<p>x</p>')` puts a\n * string where the strings array goes and fails much later, naming nothing. Production folds the check away.\n */\nimport { misuse, SHARED } from '@verajs/shared-utils';\nimport type { ResultType, TemplateResult } from './types.js';\n\nconst tagCalled = (type: ResultType, strings: unknown): void => {\n if (!Array.isArray(strings)) {\n const name = ['html', 'svg', 'mathml'][type - 1]!;\n throw new TypeError(misuse(name, 'tag-called', __DEV__ && SHARED.tagCalled(name, typeof strings === 'string' ? JSON.stringify(strings) : String(strings), '<p>hi</p>')));\n }\n};\n\n/** The `html` tagged template. */\nexport const html = (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<1> => {\n if (__DEV__) tagCalled(1, strings);\n return { ['_$litType$']: 1, strings, values };\n};\n/** The `svg` tagged template — markup parsed as SVG, for a fragment that is not inside an `<svg>` element. */\nexport const svg = (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<2> => {\n if (__DEV__) tagCalled(2, strings);\n return { ['_$litType$']: 2, strings, values };\n};\n/** The `mathml` tagged template — markup parsed as MathML, for a fragment that is not inside a `<math>` element. */\nexport const mathml = (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<3> => {\n if (__DEV__) tagCalled(3, strings);\n return { ['_$litType$']: 3, strings, values };\n};\n"],"names":["misuse","forName","withCode","andProse","SCRIPT_URL","URL_SINK","SCRIPT_URL_ITEM","INLINE_HANDLER","JSON_BLOCK","closedRawText","text","json","replace","camel","name","_","c","toUpperCase","IN_TAG","WRITTEN_NAME","TEXT_MARK","VALUE_MARK","TEXT_MARKS","RAW","TEXT_ONLY","SCRIPT_START","FORGED","strings","refusedName","test","toLowerCase","urlCheck","sink","exec","prepared","WeakMap","pathTo","node","root","path","parentNode","hops","sibling","previousSibling","unshift","refuse","TypeError","land","at","seen","written","mark","data","marks","pieces","split","statics","first","i","length","push","check","parent","found","custom","firstChild","nextSibling","nodeType","element","localName","includes","hasAttribute","walk","type","getAttribute","carries","value","attributes","bound","slice","removeAttribute","content","textual","child","textContent","hole","instantiate","doc","entry","get","undefined","real","Array","isArray","Object","hasOwn","literal","genuine","set","source","tag","startsWith","template","createElement","wrap","endMark","innerHTML","replaceWith","childNodes","join","matchAll","fill","missing","indexOf","marker","last","pop","remove","append","createTextNode","prepend","createComment","map","prepare","holes","plain","wrapped","clone","cloneNode","importNode","parts","step","childPart","solePart","textPart","attrPart","fragment","createDocumentFragment","commit","values","removeRun","next","isList","Symbol","iterator","childText","UNSET","makeItem","before","ownerDocument","_$litType$","item","_first","_last","lastChild","_strings","_parts","_holes","insertBefore","range","_range","_value","updateItem","items","start","end","list","clear","replaceChildren","had","Math","min","batch","textOf","raw","tagName","prefix","target","handler","addEventListener","handleEvent","event","call","toggleAttribute","property","key","whole","joined","setAttribute","patch","result","_$t$","reading","pending","unlink","_$l$","readers","delete","render","_$u$","draw","_$f$","isConnected","outer","_$r$","flush","splice","queueMicrotask","queue","retire","define","setup","props","methods","shadow","camels","declared","defaults","keys","filter","record","constructor","write","_$v$","is","Class","HTMLElement","installed","__proto__","assign","prototype","connectedCallback","this","shadowRoot","attachShadow","mode","out","then","disconnectedCallback","observedAttributes","attributeChangedCallback","_old","defineProperty","configurable","enumerable","customElements","HELD","READERS","SIGNAL","freeze","defineProperties","toStringTag","Set","add","toJSON","signal","initialValue","options","box","create","html","svg","mathml"],"mappings":"AAMO,MA0EMA,EAAS,CAACC,EAAiBC,EAAkBC,IAGpD,GAAGF,2BAAmBC,IC2BfE,EAAa,qHAwBbC,EAAW,wEASXC,EAAkB,2HASlBC,EAAiB,QASjBC,EAAa,YA2BbC,EAAgB,CAACC,EAAcC,IAC1CA,EAAOD,EAAKE,QAAQ,KAAM,WAAaF,EAAKE,QAAQ,eAAgB,UCzCzDC,EAASC,GAAiBA,EAAKF,QAAQ,aAAa,CAACG,EA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AC1O,KAAkCgH,KAE7C,CAAEW,WAAgB,EAAG3H,UAASgH,WAG1B2H,GAAS,CAAC3O,KAAkCgH,KAEhD,CAAEW,WAAgB,EAAG3H,UAASgH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,113 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verajs/lite",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
}
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "VeraJS's small tier: web components with define, signal and html, and a renderer that patches the values that changed in place. No build step required.",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/vera-js/vera.git",
|
|
15
|
+
"directory": "packages/lite"
|
|
16
|
+
},
|
|
17
|
+
"author": "Brian Grider <hello@verajs.com>",
|
|
18
|
+
"homepage": "https://verajs.dev",
|
|
19
|
+
"main": "./dist/vera-lite.min.js",
|
|
20
|
+
"types": "./dist/development/vera-lite.d.ts",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/development/vera-lite.d.ts",
|
|
25
|
+
"development": "./dist/development/vera-lite.js",
|
|
26
|
+
"default": "./dist/vera-lite.min.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "wireit"
|
|
34
|
+
},
|
|
35
|
+
"wireit": {
|
|
36
|
+
"build": {
|
|
37
|
+
"dependencies": [
|
|
38
|
+
"build:development",
|
|
39
|
+
"build:production",
|
|
40
|
+
"build:types"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"build:development": {
|
|
44
|
+
"command": "npx rollup -c",
|
|
45
|
+
"clean": "if-file-deleted",
|
|
46
|
+
"env": {
|
|
47
|
+
"MODE": "dev"
|
|
48
|
+
},
|
|
49
|
+
"files": [
|
|
50
|
+
"src/**/*{.js,.ts}",
|
|
51
|
+
"../shared-types/src/**/*{.js,.ts}",
|
|
52
|
+
"../shared-utils/src/**/*{.js,.ts}",
|
|
53
|
+
"tsconfig.json",
|
|
54
|
+
"../../tsconfig.json",
|
|
55
|
+
"rollup.config.js",
|
|
56
|
+
"../../defaultRollupConfig.js"
|
|
57
|
+
],
|
|
58
|
+
"output": [
|
|
59
|
+
"dist/development/*.js",
|
|
60
|
+
"dist/development/*.js.map"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"build:production": {
|
|
64
|
+
"command": "npx rollup -c",
|
|
65
|
+
"clean": "if-file-deleted",
|
|
66
|
+
"env": {
|
|
67
|
+
"MODE": "prod"
|
|
68
|
+
},
|
|
69
|
+
"files": [
|
|
70
|
+
"src/**/*{.js,.ts}",
|
|
71
|
+
"../shared-types/src/**/*{.js,.ts}",
|
|
72
|
+
"../shared-utils/src/**/*{.js,.ts}",
|
|
73
|
+
"tsconfig.json",
|
|
74
|
+
"../../tsconfig.json",
|
|
75
|
+
"rollup.config.js",
|
|
76
|
+
"../../defaultRollupConfig.js"
|
|
77
|
+
],
|
|
78
|
+
"output": [
|
|
79
|
+
"dist/*.min.js",
|
|
80
|
+
"dist/*.min.js.map"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"build:types": {
|
|
84
|
+
"command": "npx rollup -c",
|
|
85
|
+
"env": {
|
|
86
|
+
"MODE": "types"
|
|
87
|
+
},
|
|
88
|
+
"files": [
|
|
89
|
+
"src/**/*{.js,.ts}",
|
|
90
|
+
"../shared-types/src/**/*{.js,.ts}",
|
|
91
|
+
"../shared-utils/src/**/*{.js,.ts}",
|
|
92
|
+
"tsconfig.json",
|
|
93
|
+
"../../tsconfig.json",
|
|
94
|
+
"rollup.config.js",
|
|
95
|
+
"../../defaultRollupConfig.js"
|
|
96
|
+
],
|
|
97
|
+
"output": [
|
|
98
|
+
"dist/development/*.d.ts",
|
|
99
|
+
"dist/development/*.d.ts.map"
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"filename": "vera-lite",
|
|
104
|
+
"keywords": [
|
|
105
|
+
"verajs",
|
|
106
|
+
"vera",
|
|
107
|
+
"web-components",
|
|
108
|
+
"custom-elements",
|
|
109
|
+
"reactive",
|
|
110
|
+
"small"
|
|
111
|
+
],
|
|
112
|
+
"sideEffects": false
|
|
113
|
+
}
|