@pithyjs/vite-plugin 0.2.0-beta.0 → 0.2.0-beta.10
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/dist/aotCodegen/generateBindings.d.ts +1 -1
- package/dist/aotCodegen/generateBindings.d.ts.map +1 -1
- package/dist/aotCodegen/generateBindings.js +4 -2
- package/dist/aotCodegen/generateBindings.js.map +1 -1
- package/dist/aotCodegen/generateDomFactory.d.ts +2 -1
- package/dist/aotCodegen/generateDomFactory.d.ts.map +1 -1
- package/dist/aotCodegen/generateDomFactory.js +48 -18
- package/dist/aotCodegen/generateDomFactory.js.map +1 -1
- package/dist/aotCodegen/index.d.ts +2 -2
- package/dist/aotCodegen/index.js +1 -1
- package/dist/aotCodegen/index.js.map +1 -1
- package/dist/aotCodegen/serializeNode.d.ts +1 -1
- package/dist/aotCodegen/serializeNode.d.ts.map +1 -1
- package/dist/aotCodegen/serializeNode.js +2 -3
- package/dist/aotCodegen/serializeNode.js.map +1 -1
- package/dist/aotCodegen/structuralCodegen.d.ts +2 -2
- package/dist/aotCodegen/structuralCodegen.d.ts.map +1 -1
- package/dist/aotCodegen/structuralCodegen.js +2 -2
- package/dist/aotCodegen/structuralCodegen.js.map +1 -1
- package/dist/aotCodegen/utils.js.map +1 -1
- package/dist/babelPlugin/babelPlugin.d.ts +1 -1
- package/dist/babelPlugin/babelPlugin.d.ts.map +1 -1
- package/dist/babelPlugin/babelPlugin.js +140 -7
- package/dist/babelPlugin/babelPlugin.js.map +1 -1
- package/dist/babelPlugin/extractUsedIdentifiers.d.ts +13 -3
- package/dist/babelPlugin/extractUsedIdentifiers.d.ts.map +1 -1
- package/dist/babelPlugin/extractUsedIdentifiers.js +83 -48
- package/dist/babelPlugin/extractUsedIdentifiers.js.map +1 -1
- package/dist/buildPlugin/plugin.js.map +1 -1
- package/dist/designSystemPlugin/channelVars.js.map +1 -1
- package/dist/designSystemPlugin/collector.d.ts +1 -1
- package/dist/designSystemPlugin/collector.js +1 -1
- package/dist/designSystemPlugin/collector.js.map +1 -1
- package/dist/designSystemPlugin/cssTokens.d.ts +1 -1
- package/dist/designSystemPlugin/cssTokens.js +1 -1
- package/dist/designSystemPlugin/cssTokens.js.map +1 -1
- package/dist/designSystemPlugin/enumerate.d.ts.map +1 -1
- package/dist/designSystemPlugin/enumerate.js +13 -13
- package/dist/designSystemPlugin/enumerate.js.map +1 -1
- package/dist/designSystemPlugin/extractor.d.ts +1 -1
- package/dist/designSystemPlugin/extractor.js.map +1 -1
- package/dist/designSystemPlugin/generator.d.ts +1 -1
- package/dist/designSystemPlugin/generator.js +3 -3
- package/dist/designSystemPlugin/generator.js.map +1 -1
- package/dist/designSystemPlugin/index.d.ts +2 -2
- package/dist/designSystemPlugin/index.js +1 -1
- package/dist/designSystemPlugin/index.js.map +1 -1
- package/dist/designSystemPlugin/patterns/a11y.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/a11y.js.map +1 -1
- package/dist/designSystemPlugin/patterns/borders.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/borders.js +1 -1
- package/dist/designSystemPlugin/patterns/borders.js.map +1 -1
- package/dist/designSystemPlugin/patterns/colors.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/colors.js +2 -2
- package/dist/designSystemPlugin/patterns/colors.js.map +1 -1
- package/dist/designSystemPlugin/patterns/iconography.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/iconography.js +1 -1
- package/dist/designSystemPlugin/patterns/iconography.js.map +1 -1
- package/dist/designSystemPlugin/patterns/index.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/index.js +11 -11
- package/dist/designSystemPlugin/patterns/index.js.map +1 -1
- package/dist/designSystemPlugin/patterns/layout.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/layout.js +1 -1
- package/dist/designSystemPlugin/patterns/layout.js.map +1 -1
- package/dist/designSystemPlugin/patterns/motion.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/motion.js +1 -1
- package/dist/designSystemPlugin/patterns/motion.js.map +1 -1
- package/dist/designSystemPlugin/patterns/radius.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/radius.js +1 -1
- package/dist/designSystemPlugin/patterns/radius.js.map +1 -1
- package/dist/designSystemPlugin/patterns/shadows.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/shadows.d.ts.map +1 -1
- package/dist/designSystemPlugin/patterns/shadows.js +1 -1
- package/dist/designSystemPlugin/patterns/shadows.js.map +1 -1
- package/dist/designSystemPlugin/patterns/smartContainer.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/smartContainer.js +1 -1
- package/dist/designSystemPlugin/patterns/smartContainer.js.map +1 -1
- package/dist/designSystemPlugin/patterns/spacing.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/spacing.js +1 -1
- package/dist/designSystemPlugin/patterns/spacing.js.map +1 -1
- package/dist/designSystemPlugin/patterns/typography.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/typography.js +1 -1
- package/dist/designSystemPlugin/patterns/typography.js.map +1 -1
- package/dist/designSystemPlugin/plugin.d.ts +11 -1
- package/dist/designSystemPlugin/plugin.d.ts.map +1 -1
- package/dist/designSystemPlugin/plugin.js +421 -55
- package/dist/designSystemPlugin/plugin.js.map +1 -1
- package/dist/designSystemPlugin/types.d.ts +8 -2
- package/dist/designSystemPlugin/types.d.ts.map +1 -1
- package/dist/designSystemPlugin/types.js.map +1 -1
- package/dist/htmlTransform/htmlTransform.d.ts +1 -1
- package/dist/htmlTransform/htmlTransform.d.ts.map +1 -1
- package/dist/htmlTransform/htmlTransform.js +5 -2
- package/dist/htmlTransform/htmlTransform.js.map +1 -1
- package/dist/iconsPlugin/index.d.ts +2 -2
- package/dist/iconsPlugin/index.js +1 -1
- package/dist/iconsPlugin/index.js.map +1 -1
- package/dist/iconsPlugin/optimize.js.map +1 -1
- package/dist/iconsPlugin/plugin.d.ts +1 -1
- package/dist/iconsPlugin/plugin.js +2 -2
- package/dist/iconsPlugin/plugin.js.map +1 -1
- package/dist/iconsPlugin/types.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/pithyPlugin/plugin.d.ts.map +1 -1
- package/dist/pithyPlugin/plugin.js +1 -8
- package/dist/pithyPlugin/plugin.js.map +1 -1
- package/dist/routerPlugin/manifest.js.map +1 -1
- package/dist/routerPlugin/plugin.js +2 -2
- package/dist/routerPlugin/plugin.js.map +1 -1
- package/dist/routerPlugin/scanner.js.map +1 -1
- package/dist/ssrPlugin/plugin.d.ts.map +1 -1
- package/dist/ssrPlugin/plugin.js +26 -21
- package/dist/ssrPlugin/plugin.js.map +1 -1
- package/package.json +15 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateBindings.d.ts","sourceRoot":"","sources":["../../src/aotCodegen/generateBindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"generateBindings.d.ts","sourceRoot":"","sources":["../../src/aotCodegen/generateBindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcnD,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,OAAO,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,CAAC,EAAE,QAAQ,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,CAAC;QAAE,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CAC1C,CAAC;AAEF,MAAM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CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,EAAE,QAAQ,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GACzB,eAAe,GACf,uBAAuB,GACvB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,eAAe,GACf,aAAa,GACb,cAAc,GACd,YAAY,GACZ,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,uBAAuB,GACvB,oBAAoB,CAAC;AAIzB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wKAAwK;AACxK,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAAE,EAClB,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,iBAAiB,EAAE,CAQrB;AA8LD;;;;;;;;;;;;;;;;;;GAkBG;AACH,0KAA0K;AAC1K,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAK1E"}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
*/
|
|
16
|
-
import { escapeJS } from './utils';
|
|
17
|
-
import { isStructuralNode } from './structuralCodegen';
|
|
16
|
+
import { escapeJS } from './utils.js';
|
|
17
|
+
import { isStructuralNode } from './structuralCodegen.js';
|
|
18
18
|
// ─── Codegen ─────────────────────────────────────────────────────────────────
|
|
19
19
|
/**
|
|
20
20
|
* Walk a PithyNode tree and extract non-structural binding descriptors.
|
|
@@ -69,6 +69,8 @@ function collectBindings(node, out, childFactories) {
|
|
|
69
69
|
// Event handlers
|
|
70
70
|
if (d?.events) {
|
|
71
71
|
for (const [eventWithMods, expr] of Object.entries(d.events)) {
|
|
72
|
+
if (!expr.trim())
|
|
73
|
+
continue;
|
|
72
74
|
const parts = eventWithMods.split('.');
|
|
73
75
|
const event = parts[0];
|
|
74
76
|
const mods = parts.slice(1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateBindings.js","sourceRoot":"","sources":["../../src/aotCodegen/generateBindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAGF,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA6KvD,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wKAAwK;AACxK,MAAM,UAAU,gBAAgB,CAC9B,KAAkB,EAClB,cAA4C;IAE5C,MAAM,WAAW,GAAwB,EAAE,CAAC;IAE5C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,eAAe,CACtB,IAAe,EACf,GAAwB,EACxB,cAA4C;IAE5C,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACzB,mBAAmB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC/B,OAAO;IACT,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO;IAEpC,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;IAE1B,iFAAiF;IACjF,sFAAsF;IACtF,4FAA4F;IAC5F,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;QACtD,OAAO;IACT,C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",\n \"title\": \"AOT Binding Descriptor Generator\",\n \"category\": \"compiler\",\n \"description\": \"Generates binding descriptors from template nodes for AOT compilation of reactive bindings.\",\n \"since\": \"0.0.1\",\n \"stability\": \"experimental\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"aotCodegen.test.ts\" },\n \"integration\": { \"required\": false, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport type { PithyNode } from '@pithyjs/compiler';\nimport { escapeJS } from './utils';\nimport { isStructuralNode } from './structuralCodegen';\n\n// ─── Binding descriptor types ────────────────────────────────────────────────\n// Compact format optimized for bundle size (single-letter keys).\n// These match the format defined in the AOT implementation plan.\n//\n// NOTE: Individual descriptor types are exported for sibling module access\n// (generateDomFactory.ts). The package-level public API is controlled by\n// index.ts which only re-exports generateDomFactory + AotCodegenResult.\n// Phase 5 (runtime binder / applyBindings) will need the BindingDescriptor\n// union and possibly individual types — re-evaluate index.ts exports then.\n\nexport type EventDescriptor = {\n t: 'event';\n pid: string;\n event: string;\n expr: string;\n mods?: string[];\n};\n\nexport type InterpolationDescriptor = {\n t: 'interp';\n pid: string;\n parts: ({ s: string } | { e: string })[];\n};\n\nexport type ClassDescriptor = {\n t: 'class';\n pid: string;\n name: string;\n expr: string;\n};\n\nexport type ClassesDescriptor = {\n t: 'classes';\n pid: string;\n expr: string;\n};\n\nexport type BoundDescriptor = {\n t: 'bound';\n pid: string;\n attr: string;\n expr: string;\n};\n\nexport type StyleDescriptor = {\n t: 'style';\n pid: string;\n prop: string;\n expr: string;\n};\n\nexport type RefDescriptor = {\n t: 'ref';\n pid: string;\n name: string;\n};\n\nexport type BindDescriptor = {\n t: 'bind';\n pid: string;\n expr: string;\n};\n\n// ─── Phase 3: Component, projection, defer, error boundary ──────────────────\n\nexport type ComponentDescriptor = {\n t: 'comp';\n pid: string;\n /** Original component tag name (for context lookup) */\n tag: string;\n /** Non-directive attributes as prop expressions */\n props: Record<string, string>;\n children?: string;\n};\n\nexport type DeferDescriptor = {\n t: 'defer';\n pid: string;\n /** Trigger type: 'visible' or 'when' */\n trigger: string;\n /** LazyHandle expression */\n load: string;\n /** Placeholder component expression */\n placeholder?: string;\n /** Condition expression (for @defer=\"when\") */\n when?: string;\n /** Loading priority ('high' | 'low') */\n priority?: string;\n /** Timeout in ms */\n timeout?: number;\n};\n\nexport type ErrorBoundaryDescriptor = {\n t: 'error';\n pid: string;\n /** Error signal expression */\n expr: string;\n};\n\nexport type ProjectionDescriptor = {\n t: 'proj';\n pid: string;\n /** Slot name (empty string for default slot) */\n name: string;\n /** Fallback content sub-factory function name */\n fallback?: string;\n};\n\n// ─── Phase 2: Structural directive descriptor types ─────────────────────────\n\nexport type IfBranch = {\n /** Condition expression (absent for @else) */\n expr?: string;\n /** Sub-factory function name */\n factory: string;\n};\n\nexport type IfDescriptor = {\n t: 'if';\n pid: string;\n branches: IfBranch[];\n};\n\nexport type ForDescriptor = {\n t: 'for';\n pid: string;\n /** Loop item variable name */\n item: string;\n /** Loop index variable name */\n index?: string;\n /** Collection expression */\n expr: string;\n /** TrackBy expression */\n trackBy?: string;\n /** Body sub-factory function name */\n factory: string;\n};\n\nexport type SwitchCase = {\n /** Case value expression (absent for @default) */\n val?: string;\n /** Case sub-factory function name */\n factory: string;\n};\n\nexport type SwitchDescriptor = {\n t: 'switch';\n pid: string;\n /** Switch expression */\n expr: string;\n cases: SwitchCase[];\n};\n\n/** Union of all binding descriptor types (Phase 1 + Phase 2 + Phase 3). */\nexport type BindingDescriptor =\n | EventDescriptor\n | InterpolationDescriptor\n | ClassDescriptor\n | ClassesDescriptor\n | StyleDescriptor\n | BoundDescriptor\n | RefDescriptor\n | BindDescriptor\n | IfDescriptor\n | ForDescriptor\n | SwitchDescriptor\n | ComponentDescriptor\n | DeferDescriptor\n | ErrorBoundaryDescriptor\n | ProjectionDescriptor;\n\n// ─── Codegen ─────────────────────────────────────────────────────────────────\n\n/**\n * Walk a PithyNode tree and extract non-structural binding descriptors.\n *\n * Extracts:\n * - Event handlers (`@click=\"expr\"`)\n * - Text interpolations (`{{ expr }}`)\n * - Class directives (`[class.active]=\"expr\"`)\n * - Class groups (`[classes]=\"expr\"`)\n * - Style bindings (`[style.color]=\"expr\"`)\n * - Bound attributes (`[attr]=\"expr\"`)\n * - Ref directives (`@ref=\"name\"`)\n * - Two-way bind (`@bind=\"signal\"`)\n *\n * Skips structural directive nodes (@if, @for, @switch, @case, @else, etc.)\n * — those are handled by sub-factories via `generateDomFactory`.\n * Also extracts Phase 3 descriptors: components, @defer, @error.\n *\n * @example\n * ```typescript\n * const descriptors = generateBindings(pithyNodes);\n * // Returns: [{ t: 'event', pid: 'r1', event: 'click', expr: 'increment()' }, ...]\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.aot.generate-bindings\",\"name\":\"generateBindings\",\"stability\":\"experimental\",\"signature\":\"(nodes: PithyNode[]) => BindingDescriptor[]\"} */\nexport function generateBindings(\n nodes: PithyNode[],\n childFactories?: ReadonlyMap<string, string>\n): BindingDescriptor[] {\n const descriptors: BindingDescriptor[] = [];\n\n for (const node of nodes) {\n collectBindings(node, descriptors, childFactories);\n }\n\n return descriptors;\n}\n\nfunction collectBindings(\n node: PithyNode,\n out: BindingDescriptor[],\n childFactories?: ReadonlyMap<string, string>\n): void {\n if (node.type === 'text') {\n collectTextBindings(node, out);\n return;\n }\n\n if (node.type !== 'element') return;\n\n const d = node.directives;\n\n // Skip structural directive nodes — their bindings are handled by sub-factories.\n // Exception: @switch nodes stay in the DOM, so extract their non-structural bindings.\n // All @switch children are skipped (cases handled by sub-factories, others not in AOT DOM).\n if (isStructuralNode(node) && d?.switch === undefined) {\n return;\n }\n\n const pid = node.nodeId;\n\n // Extract directives only when this element has a pid.\n // Even if pid is absent (e.g. synthetic wrappers), we still recurse\n // into children below so descendant bindings are not silently dropped.\n if (pid) {\n // Event handlers\n if (d?.events) {\n for (const [eventWithMods, expr] of Object.entries(d.events)) {\n if (!expr.trim()) continue;\n const parts = eventWithMods.split('.');\n const event = parts[0];\n const mods = parts.slice(1);\n const desc: EventDescriptor = { t: 'event', pid, event, expr };\n if (mods.length > 0) desc.mods = mods;\n out.push(desc);\n }\n }\n\n // Class directives: [class.active]=\"expr\"\n if (d?.classMap) {\n for (const [name, expr] of Object.entries(d.classMap)) {\n out.push({ t: 'class', pid, name, expr });\n }\n }\n\n if (d?.classes) {\n out.push({ t: 'classes', pid, expr: d.classes });\n }\n\n // Style bindings: [style.color]=\"expr\"\n if (d?.styleMap) {\n for (const [prop, expr] of Object.entries(d.styleMap)) {\n out.push({ t: 'style', pid, prop, expr });\n }\n }\n\n // Bound attributes: [disabled]=\"expr\"\n if (d?.bound) {\n for (const [attr, expr] of Object.entries(d.bound)) {\n out.push({ t: 'bound', pid, attr, expr });\n }\n }\n\n // Ref directive: @ref=\"name\"\n if (d?.ref) {\n out.push({ t: 'ref', pid, name: d.ref });\n }\n\n // Two-way bind: @bind=\"signal\"\n if (d?.bind) {\n out.push({ t: 'bind', pid, expr: d.bind });\n }\n\n // ─── Phase 3: Component, defer, error boundary ──────────────────────\n\n // Component descriptor: isComponent flag set by the parser\n if (node.isComponent) {\n const tag = node.originalTagName ?? node.tagName ?? '';\n // Collect non-directive, non-internal attributes as props.\n // Matches runtime bindComponentsTags.ts which skips data-*, class, style, directives.\n // Use originalAttrs for key casing (parse5 lowercases node.attrs keys).\n const props: Record<string, string> = {};\n for (const [name, value] of Object.entries(node.attrs ?? {})) {\n if (\n name.startsWith('@') ||\n name.startsWith('[') ||\n name === 'data-pid' ||\n name === 'slot'\n )\n continue;\n if (name === 'class' || name === 'style') continue;\n const originalName = node.originalAttrs?.[name] ?? name;\n if (originalName.startsWith('data-')) continue;\n props[originalName] = value;\n }\n const desc: ComponentDescriptor = { t: 'comp', pid, tag, props };\n const children = childFactories?.get(pid);\n if (children) desc.children = children;\n out.push(desc);\n }\n\n // Defer directive: @defer=\"visible|when\"\n if (d?.defer && d?.load) {\n const desc: DeferDescriptor = {\n t: 'defer',\n pid,\n trigger: d.defer,\n load: d.load,\n };\n if (d.placeholder !== undefined) desc.placeholder = d.placeholder;\n if (d.when !== undefined) desc.when = d.when;\n if (d.deferPriority !== undefined) desc.priority = d.deferPriority;\n if (d.deferTimeout !== undefined) desc.timeout = d.deferTimeout;\n out.push(desc);\n }\n\n // Error boundary: @error=\"errorSignal\"\n if (d?.error) {\n out.push({ t: 'error', pid, expr: d.error });\n }\n }\n\n // Recurse into children.\n // Skip ALL children of @switch nodes — @case/@default are handled by sub-factories,\n // and any other children are invalid template syntax that won't exist in the AOT DOM.\n if (\n node.children &&\n d?.switch === undefined &&\n !(pid && childFactories?.has(pid))\n ) {\n for (const child of node.children) {\n collectBindings(child, out, childFactories);\n }\n }\n}\n\n/**\n * Extract interpolation descriptors from a text node.\n *\n * Text nodes with `{{ expr }}` interpolations get split into static parts\n * and expression parts. The parent element's pid is used since text nodes\n * don't have their own pid.\n *\n * We use the text node's parentId to reference the containing element.\n */\nfunction collectTextBindings(node: PithyNode, out: BindingDescriptor[]): void {\n if (!node.interpolations || node.interpolations.length === 0) return;\n\n const pid = node.parentId ?? '';\n const text = node.textContent ?? '';\n\n // Build parts array: interleave static text with expressions\n const parts: ({ s: string } | { e: string })[] = [];\n let lastIndex = 0;\n\n // Known limitation: we use indexOf(interp.raw) to locate interpolations in the text.\n // This is fragile if whitespace differs between interp.raw and textContent. The parser's\n // InterpolationInfo has an optional `location` field with start/end offsets, but\n // extractInterpolationsFromText does not populate it. If location offsets become available,\n // prefer using them directly instead of indexOf.\n for (const interp of node.interpolations) {\n const interpIndex = text.indexOf(interp.raw, lastIndex);\n if (interpIndex === -1) {\n // Raw text not found (malformed input) — push expression, skip static extraction\n parts.push({ e: interp.expression });\n continue;\n }\n if (interpIndex > lastIndex) {\n const staticPart = text.substring(lastIndex, interpIndex);\n if (staticPart) parts.push({ s: staticPart });\n }\n parts.push({ e: interp.expression });\n lastIndex = interpIndex + interp.raw.length;\n }\n\n // Trailing static text after last interpolation\n if (lastIndex < text.length) {\n const trailing = text.substring(lastIndex);\n if (trailing) parts.push({ s: trailing });\n }\n\n if (parts.length > 0) {\n out.push({ t: 'interp', pid, parts });\n }\n}\n\n/**\n * Serialize a binding descriptor array to a JS code string.\n *\n * Produces a compact JSON-like representation with single-quoted strings\n * and single-letter keys, suitable for inlining in generated factory code.\n * Returns `'[]'` for empty arrays.\n *\n * @param descriptors - Array of binding descriptors from `generateBindings`\n * @returns JS code string (e.g. `[{t:'event',pid:'r1',event:'click',expr:'inc()'}]`)\n *\n * @example\n * ```typescript\n * const code = serializeBindings([\n * { t: 'event', pid: 'r1', event: 'click', expr: 'inc()' },\n * { t: 'ref', pid: 'r2', name: 'myRef' },\n * ]);\n * // code: \"[{t:'event',pid:'r1',event:'click',expr:'inc()'},{t:'ref',pid:'r2',name:'myRef'}]\"\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.aot.generate-bindings\",\"name\":\"serializeBindings\",\"stability\":\"experimental\",\"signature\":\"(descriptors: BindingDescriptor[]) => string\"} */\nexport function serializeBindings(descriptors: BindingDescriptor[]): string {\n if (descriptors.length === 0) return '[]';\n\n const items = descriptors.map(serializeDescriptor);\n return `[${items.join(',')}]`;\n}\n\nfunction serializeDescriptor(d: BindingDescriptor): string {\n switch (d.t) {\n case 'event': {\n let s = `{t:'event',pid:'${escapeJS(d.pid)}',event:'${escapeJS(d.event)}',expr:'${escapeJS(d.expr)}'`;\n if (d.mods && d.mods.length > 0) {\n s += `,mods:[${d.mods.map(m => `'${escapeJS(m)}'`).join(',')}]`;\n }\n return s + '}';\n }\n case 'interp': {\n const parts = d.parts\n .map(p =>\n 's' in p ? `{s:'${escapeJS(p.s)}'}` : `{e:'${escapeJS(p.e)}'}`\n )\n .join(',');\n return `{t:'interp',pid:'${escapeJS(d.pid)}',parts:[${parts}]}`;\n }\n case 'class':\n return `{t:'class',pid:'${escapeJS(d.pid)}',name:'${escapeJS(d.name)}',expr:'${escapeJS(d.expr)}'}`;\n case 'classes':\n return `{t:'classes',pid:'${escapeJS(d.pid)}',expr:'${escapeJS(d.expr)}'}`;\n case 'bound':\n return `{t:'bound',pid:'${escapeJS(d.pid)}',attr:'${escapeJS(d.attr)}',expr:'${escapeJS(d.expr)}'}`;\n case 'ref':\n return `{t:'ref',pid:'${escapeJS(d.pid)}',name:'${escapeJS(d.name)}'}`;\n case 'style':\n return `{t:'style',pid:'${escapeJS(d.pid)}',prop:'${escapeJS(d.prop)}',expr:'${escapeJS(d.expr)}'}`;\n case 'bind':\n return `{t:'bind',pid:'${escapeJS(d.pid)}',expr:'${escapeJS(d.expr)}'}`;\n\n // ─── Phase 2: Structural descriptor serialization ────────────────────\n // Factory references are emitted as bare identifiers (no quotes)\n // because they reference functions defined in the same scope.\n\n case 'if': {\n const branches = d.branches\n .map(b => {\n if (b.expr !== undefined) {\n return `{expr:'${escapeJS(b.expr)}',factory:${b.factory}}`;\n }\n return `{factory:${b.factory}}`; // @else has no expr\n })\n .join(',');\n return `{t:'if',pid:'${escapeJS(d.pid)}',branches:[${branches}]}`;\n }\n case 'for': {\n let s = `{t:'for',pid:'${escapeJS(d.pid)}',item:'${escapeJS(d.item)}',expr:'${escapeJS(d.expr)}',factory:${d.factory}`;\n if (d.index) s += `,index:'${escapeJS(d.index)}'`;\n if (d.trackBy) s += `,trackBy:'${escapeJS(d.trackBy)}'`;\n return s + '}';\n }\n case 'switch': {\n const cases = d.cases\n .map(c => {\n if (c.val !== undefined) {\n return `{val:'${escapeJS(c.val)}',factory:${c.factory}}`;\n }\n return `{factory:${c.factory}}`; // @default has no val\n })\n .join(',');\n return `{t:'switch',pid:'${escapeJS(d.pid)}',expr:'${escapeJS(d.expr)}',cases:[${cases}]}`;\n }\n\n // ─── Phase 3: Component, projection, defer, error boundary ────────────\n\n case 'comp': {\n const props = Object.entries(d.props)\n .map(([k, v]) => `'${escapeJS(k)}':'${escapeJS(v)}'`)\n .join(',');\n let s = `{t:'comp',pid:'${escapeJS(d.pid)}',tag:'${escapeJS(d.tag)}',props:{${props}}`;\n if (d.children) s += `,children:${d.children}`;\n return s + '}';\n }\n case 'defer': {\n let s = `{t:'defer',pid:'${escapeJS(d.pid)}',trigger:'${escapeJS(d.trigger)}',load:'${escapeJS(d.load)}'`;\n if (d.placeholder !== undefined)\n s += `,placeholder:'${escapeJS(d.placeholder)}'`;\n if (d.when !== undefined) s += `,when:'${escapeJS(d.when)}'`;\n if (d.priority !== undefined) s += `,priority:'${escapeJS(d.priority)}'`;\n if (d.timeout !== undefined) s += `,timeout:${d.timeout}`;\n return s + '}';\n }\n case 'error': {\n return `{t:'error',pid:'${escapeJS(d.pid)}',expr:'${escapeJS(d.expr)}'}`;\n }\n case 'proj': {\n let s = `{t:'proj',pid:'${escapeJS(d.pid)}',name:'${escapeJS(d.name)}'`;\n if (d.fallback) s += `,fallback:${d.fallback}`;\n return s + '}';\n }\n\n default: {\n const _exhaustive: never = d;\n throw new Error(\n `Unknown binding descriptor type: ${(_exhaustive as BindingDescriptor).t}`\n );\n }\n }\n}\n"]}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
*/
|
|
16
|
-
import type { PithyNode } from '
|
|
16
|
+
import type { PithyNode } from '@pithyjs/compiler';
|
|
17
17
|
export interface AotCodegenResult {
|
|
18
18
|
/** Complete JS code for the factory function + bindings const (includes sub-factory code) */
|
|
19
19
|
code: string;
|
|
@@ -26,6 +26,7 @@ export interface AotCodegenOptions {
|
|
|
26
26
|
templateComponents?: ReadonlySet<string>;
|
|
27
27
|
wrappable?: boolean;
|
|
28
28
|
anchorSlots?: ReadonlyMap<string, string>;
|
|
29
|
+
sub?: boolean;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* Generate AOT code from a PithyNode tree.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateDomFactory.d.ts","sourceRoot":"","sources":["../../src/aotCodegen/generateDomFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"generateDomFactory.d.ts","sourceRoot":"","sources":["../../src/aotCodegen/generateDomFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAsBnD,MAAM,WAAW,gBAAgB;IAC/B,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,uOAAuO;AACvO,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,EAAE,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,GAAE,iBAAsB,GAC9B,gBAAgB,CA8FlB"}
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
*/
|
|
16
|
-
import { createSerializeContext, serializeNode, } from './serializeNode';
|
|
17
|
-
import { generateBindings, serializeBindings, } from './generateBindings';
|
|
18
|
-
import { collectIfChain, stripStructuralDirective, isDefaultCase, } from './structuralCodegen';
|
|
19
|
-
import { escapeJS } from './utils';
|
|
16
|
+
import { createSerializeContext, serializeNode, } from './serializeNode.js';
|
|
17
|
+
import { generateBindings, serializeBindings, } from './generateBindings.js';
|
|
18
|
+
import { collectIfChain, stripStructuralDirective, isDefaultCase, } from './structuralCodegen.js';
|
|
19
|
+
import { escapeJS } from './utils.js';
|
|
20
20
|
/**
|
|
21
21
|
* Generate AOT code from a PithyNode tree.
|
|
22
22
|
*
|
|
@@ -90,14 +90,10 @@ export function generateDomFactory(nodes, hash, scopeId, options = {}) {
|
|
|
90
90
|
else if (topLevelVarNames.length > 1) {
|
|
91
91
|
bodyLines.push(`f.append(${topLevelVarNames.join(',')});`);
|
|
92
92
|
}
|
|
93
|
-
// Return with applied bindings (or just the fragment if no bindings)
|
|
94
93
|
const fragment = options.wrappable ? '(__wrap?__wrap(f):f)' : 'f';
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
bodyLines.push(`return {el:${fragment},destroy:function(){}};`);
|
|
100
|
-
}
|
|
94
|
+
const bindingsArg = allDescriptors.length > 0 ? bindingsName : '[]';
|
|
95
|
+
const drainArg = options.sub ? ',false' : '';
|
|
96
|
+
bodyLines.push(`return __applyBindings(${fragment},${bindingsArg},__ctx${drainArg});`);
|
|
101
97
|
// Assemble final code: sub-factories first, then this factory
|
|
102
98
|
const codeLines = [];
|
|
103
99
|
// Sub-factory code blocks (from structural directives)
|
|
@@ -146,7 +142,15 @@ function processNodes(nodes, ctx, safeHash, scopeId, subFactoryCodeBlocks, struc
|
|
|
146
142
|
const branchNode = chain[b];
|
|
147
143
|
const branchHash = `${safeHash}_if_${pid}_${b}`;
|
|
148
144
|
const stripped = stripStructuralDirective(branchNode);
|
|
149
|
-
|
|
145
|
+
if (branchNode.directives?.switch !== undefined)
|
|
146
|
+
stripped.directives = {
|
|
147
|
+
...stripped.directives,
|
|
148
|
+
switch: branchNode.directives.switch,
|
|
149
|
+
};
|
|
150
|
+
const sub = generateDomFactory([stripped], branchHash, scopeId, {
|
|
151
|
+
...options,
|
|
152
|
+
sub: true,
|
|
153
|
+
});
|
|
150
154
|
subFactoryCodeBlocks.push(sub.code);
|
|
151
155
|
const branch = {
|
|
152
156
|
factory: sub.factoryName,
|
|
@@ -171,6 +175,9 @@ function processNodes(nodes, ctx, safeHash, scopeId, subFactoryCodeBlocks, struc
|
|
|
171
175
|
node.directives?.else !== undefined ||
|
|
172
176
|
node.directives?.case !== undefined ||
|
|
173
177
|
isDefaultCase(node))) {
|
|
178
|
+
if (node.directives?.elseIf !== undefined ||
|
|
179
|
+
node.directives?.else !== undefined)
|
|
180
|
+
console.warn(`[pithy:aot] ${node.directives.elseIf !== undefined ? '@else-if' : '@else'} has no @if directly before it; <${node.originalTagName ?? node.tagName}> is dropped`);
|
|
174
181
|
continue;
|
|
175
182
|
}
|
|
176
183
|
// ─── @for loop ───────────────────────────────────────────────────
|
|
@@ -178,7 +185,10 @@ function processNodes(nodes, ctx, safeHash, scopeId, subFactoryCodeBlocks, struc
|
|
|
178
185
|
const pid = node.nodeId ?? `_${i}`;
|
|
179
186
|
const forHash = `${safeHash}_for_${pid}`;
|
|
180
187
|
const stripped = stripStructuralDirective(node);
|
|
181
|
-
const sub = generateDomFactory([stripped], forHash, scopeId,
|
|
188
|
+
const sub = generateDomFactory([stripped], forHash, scopeId, {
|
|
189
|
+
...options,
|
|
190
|
+
sub: true,
|
|
191
|
+
});
|
|
182
192
|
subFactoryCodeBlocks.push(sub.code);
|
|
183
193
|
const commentVar = `c${ctx.commentCount++}`;
|
|
184
194
|
ctx.lines.push(`const ${commentVar}=document.createComment('for:${escapeJS(pid)}');`);
|
|
@@ -217,15 +227,30 @@ function processNodes(nodes, ctx, safeHash, scopeId, subFactoryCodeBlocks, struc
|
|
|
217
227
|
varNames.push(shellResult.varName);
|
|
218
228
|
// Generate sub-factory for each @case/@default child
|
|
219
229
|
const cases = [];
|
|
230
|
+
let dropped;
|
|
220
231
|
for (let c = 0; c < (node.children ?? []).length; c++) {
|
|
221
232
|
const caseNode = node.children[c];
|
|
222
|
-
if (caseNode.type !== 'element'
|
|
223
|
-
|
|
224
|
-
|
|
233
|
+
if (caseNode.type !== 'element' ||
|
|
234
|
+
(caseNode.directives?.case === undefined && !isDefaultCase(caseNode))) {
|
|
235
|
+
if (caseNode.type === 'element')
|
|
236
|
+
dropped ??= `<${caseNode.originalTagName ?? caseNode.tagName}>`;
|
|
237
|
+
else if (caseNode.type === 'slot')
|
|
238
|
+
dropped ??= '<slot>';
|
|
239
|
+
else if (caseNode.type === 'text' && caseNode.textContent?.trim())
|
|
240
|
+
dropped ??= JSON.stringify(caseNode.textContent.trim());
|
|
225
241
|
continue;
|
|
242
|
+
}
|
|
226
243
|
const caseHash = `${safeHash}_sw_${pid}_${c}`;
|
|
227
244
|
const stripped = stripStructuralDirective(caseNode);
|
|
228
|
-
|
|
245
|
+
if (caseNode.directives?.switch !== undefined)
|
|
246
|
+
stripped.directives = {
|
|
247
|
+
...stripped.directives,
|
|
248
|
+
switch: caseNode.directives.switch,
|
|
249
|
+
};
|
|
250
|
+
const sub = generateDomFactory([stripped], caseHash, scopeId, {
|
|
251
|
+
...options,
|
|
252
|
+
sub: true,
|
|
253
|
+
});
|
|
229
254
|
subFactoryCodeBlocks.push(sub.code);
|
|
230
255
|
const caseDesc = {
|
|
231
256
|
factory: sub.factoryName,
|
|
@@ -234,6 +259,8 @@ function processNodes(nodes, ctx, safeHash, scopeId, subFactoryCodeBlocks, struc
|
|
|
234
259
|
caseDesc.val = caseNode.directives.case;
|
|
235
260
|
cases.push(caseDesc);
|
|
236
261
|
}
|
|
262
|
+
if (dropped)
|
|
263
|
+
console.warn(`[pithy:aot] @switch renders only its @case/@default children; ${dropped} is dropped`);
|
|
237
264
|
structuralDescriptors.push({
|
|
238
265
|
t: 'switch',
|
|
239
266
|
pid,
|
|
@@ -266,7 +293,10 @@ function processNodes(nodes, ctx, safeHash, scopeId, subFactoryCodeBlocks, struc
|
|
|
266
293
|
// Generate sub-factory for fallback content if present
|
|
267
294
|
if (node.fallbackChildren && node.fallbackChildren.length > 0) {
|
|
268
295
|
const fbHash = `${safeHash}_slot_${pid}`;
|
|
269
|
-
const sub = generateDomFactory(node.fallbackChildren, fbHash, scopeId,
|
|
296
|
+
const sub = generateDomFactory(node.fallbackChildren, fbHash, scopeId, {
|
|
297
|
+
...options,
|
|
298
|
+
sub: true,
|
|
299
|
+
});
|
|
270
300
|
subFactoryCodeBlocks.push(sub.code);
|
|
271
301
|
projDesc.fallback = sub.factoryName;
|
|
272
302
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateDomFactory.js","sourceRoot":"","sources":["../../src/aotCodegen/generateDomFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAGF,OAAO,EACL,sBAAsB,EACtB,aAAa,GAEd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,GAMlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAiBnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,uOAAuO;AACvO,MAAM,UAAU,kBAAkB,CAChC,KAAkB,EAClB,IAAY,EACZ,OAAgB,EAChB,UAA6B,EAAE;IAE/B,iFAAiF;IACjF,oEAAoE;IACpE,IAAI,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CACb,yBAAyB,OAAO,uEAAuE,CACxG,CAAC;IACJ,CAAC;IAED,iFAAiF;IACjF,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;IACtD,MAAM,WAAW,GAAG,OAAO,QAAQ,EAAE,CAAC;IACtC,MAAM,YAAY,GAAG,OAAO,QAAQ,EAAE,CAAC;IAEvC,mEAAmE;IACnE,MAAM,oBAAoB,GAAa,EAAE,CAAC;IAE1C,sEAAsE;IACtE,MAAM,qBAAqB,GAAwB,EAAE,CAAC;IAEtD,MAAM,cA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n \"category\": \"compiler\",\n \"description\": \"Generates a DOM factory function from parsed template nodes, producing static HTML with binding placeholders.\",\n \"since\": \"0.0.1\",\n \"stability\": \"experimental\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"aotCodegen.test.ts\" },\n \"integration\": { \"required\": false, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport type { PithyNode } from '@pithyjs/compiler';\nimport {\n createSerializeContext,\n serializeNode,\n type SerializeContext,\n} from './serializeNode';\nimport {\n generateBindings,\n serializeBindings,\n type BindingDescriptor,\n type IfDescriptor,\n type ForDescriptor,\n type SwitchDescriptor,\n type ProjectionDescriptor,\n} from './generateBindings';\nimport {\n collectIfChain,\n stripStructuralDirective,\n isDefaultCase,\n} from './structuralCodegen';\nimport { escapeJS } from './utils';\n\nexport interface AotCodegenResult {\n /** Complete JS code for the factory function + bindings const (includes sub-factory code) */\n code: string;\n /** The factory function name (e.g. \"__f_a7f3\") */\n factoryName: string;\n /** The bindings variable name (e.g. \"__b_a7f3\") */\n bindingsName: string;\n}\n\nexport interface AotCodegenOptions {\n templateComponents?: ReadonlySet<string>;\n wrappable?: boolean;\n anchorSlots?: ReadonlyMap<string, string>;\n sub?: boolean;\n}\n\n/**\n * Generate AOT code from a PithyNode tree.\n *\n * Produces:\n * 1. Sub-factory code for structural directives (@if branches, @for bodies, @switch cases)\n * 2. A bindings descriptor array (const __b_{hash} = [...])\n * 3. A DOM factory function (function __f_{hash}(__ctx) { ... })\n *\n * The factory creates DOM nodes via createElement/createTextNode,\n * sets static attributes, and calls __applyBindings with the\n * pre-extracted descriptors.\n *\n * Structural directives generate sub-factory functions (via recursive calls)\n * and comment placeholders in the parent factory. Sub-factory code is prepended\n * to the output so function references resolve correctly.\n *\n * **Phase 5 gap:** AOT factories do not set runtime-only DOM properties that\n * `pithyTreeToDom` assigns (`__pithyCtx`, `__pithyNode`, `__nodeId`,\n * `__slotName`, `__fallbackFactory`). Phase 5's `applyBindings()` will need\n * to set these on the factory-created DOM before wiring reactive effects.\n *\n * @param nodes - Parsed PithyNode tree (from parse5ToPithyTree)\n * @param hash - Unique identifier for this template (used in names)\n * @param scopeId - CSS scope ID (e.g. \"pithy-abc123\")\n *\n * @example\n * ```typescript\n * const result = generateDomFactory(pithyNodes, 'a7f3', 'pithy-abc');\n * // result.code contains the full factory + bindings code\n * // result.factoryName is \"__f_a7f3\"\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.aot.generate-dom-factory\",\"name\":\"generateDomFactory\",\"stability\":\"experimental\",\"signature\":\"(nodes: PithyNode[], hash: string, scopeId?: string, options?: AotCodegenOptions) => AotCodegenResult\"} */\nexport function generateDomFactory(\n nodes: PithyNode[],\n hash: string,\n scopeId?: string,\n options: AotCodegenOptions = {}\n): AotCodegenResult {\n // Validate scopeId — it's interpolated into an attribute name (data-scope-{id}),\n // so it must contain only characters valid in HTML attribute names.\n if (scopeId && !/^[a-zA-Z0-9_-]+$/.test(scopeId)) {\n throw new Error(\n `AOT: invalid scopeId \"${scopeId}\" — must contain only alphanumeric, hyphen, or underscore characters.`\n );\n }\n\n // Sanitize hash to ensure valid JS identifiers (replace non-alphanumeric with _)\n const safeHash = hash.replace(/[^a-zA-Z0-9_$]/g, '_');\n const factoryName = `__f_${safeHash}`;\n const bindingsName = `__b_${safeHash}`;\n\n // Accumulate sub-factory code blocks (emitted before this factory)\n const subFactoryCodeBlocks: string[] = [];\n\n // Accumulate structural descriptors (merged with Phase 1 descriptors)\n const structuralDescriptors: BindingDescriptor[] = [];\n\n const childFactories = new Map<string, string>();\n const subOptions: AotCodegenOptions = {\n templateComponents: options.templateComponents,\n anchorSlots: options.anchorSlots,\n };\n\n // Generate DOM factory body\n const ctx = createSerializeContext(scopeId);\n\n // Process all nodes recursively, handling structural directives at every level\n const topLevelVarNames = processNodes(\n nodes,\n ctx,\n safeHash,\n scopeId,\n subFactoryCodeBlocks,\n structuralDescriptors,\n subOptions,\n childFactories\n );\n\n // Generate Phase 1 binding descriptors (non-structural)\n const phase1Descriptors = generateBindings(nodes, childFactories);\n\n // Merge all descriptors: structural first, then Phase 1\n const allDescriptors = [...structuralDescriptors, ...phase1Descriptors];\n const bindingsCode = serializeBindings(allDescriptors);\n\n // Build factory function body\n const bodyLines: string[] = [];\n bodyLines.push(`const f=document.createDocumentFragment();`);\n\n // Add all serialized node creation code\n bodyLines.push(...ctx.lines);\n\n // Append top-level nodes to fragment\n if (topLevelVarNames.length === 1) {\n bodyLines.push(`f.appendChild(${topLevelVarNames[0]});`);\n } else if (topLevelVarNames.length > 1) {\n bodyLines.push(`f.append(${topLevelVarNames.join(',')});`);\n }\n\n const fragment = options.wrappable ? '(__wrap?__wrap(f):f)' : 'f';\n const bindingsArg = allDescriptors.length > 0 ? bindingsName : '[]';\n const drainArg = options.sub ? ',false' : '';\n bodyLines.push(\n `return __applyBindings(${fragment},${bindingsArg},__ctx${drainArg});`\n );\n\n // Assemble final code: sub-factories first, then this factory\n const codeLines: string[] = [];\n\n // Sub-factory code blocks (from structural directives)\n for (const block of subFactoryCodeBlocks) {\n codeLines.push(block);\n }\n\n // Bindings constant (only if non-empty)\n if (allDescriptors.length > 0) {\n codeLines.push(`const ${bindingsName}=${bindingsCode};`);\n }\n\n // Factory function\n codeLines.push(\n `function ${factoryName}(__ctx${options.wrappable ? ',__wrap' : ''}){`\n );\n codeLines.push(...bodyLines);\n codeLines.push(`}`);\n\n return {\n code: codeLines.join('\\n'),\n factoryName,\n bindingsName,\n };\n}\n\n// ─── Internal: recursive tree processing with structural awareness ───────────\n\n/**\n * Process an array of sibling nodes, handling structural directives at every level.\n * Returns the varNames of the processed top-level nodes (for parent.append()).\n *\n * This function replaces the simple for-of loop over serializeNode calls.\n * It detects structural directives (which span siblings for @if chains)\n * and delegates to sub-factory generation, creating comment placeholders\n * in the current factory for the structural nodes.\n *\n * For non-structural elements, it serializes the element shell (no children)\n * via serializeNode, then recursively processes children here.\n */\nfunction processNodes(\n nodes: PithyNode[],\n ctx: SerializeContext,\n safeHash: string,\n scopeId: string | undefined,\n subFactoryCodeBlocks: string[],\n structuralDescriptors: BindingDescriptor[],\n options: AotCodegenOptions,\n childFactories: Map<string, string>\n): string[] {\n const varNames: string[] = [];\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n\n // ─── @if/@else-if/@else chain ────────────────────────────────────\n if (node.type === 'element' && node.directives?.if !== undefined) {\n const chain = collectIfChain(nodes, i);\n const pid = node.nodeId ?? `_${i}`;\n i += chain.length - 1; // Skip consumed siblings\n\n // Generate sub-factory for each branch\n const branches: IfDescriptor['branches'] = [];\n for (let b = 0; b < chain.length; b++) {\n const branchNode = chain[b];\n const branchHash = `${safeHash}_if_${pid}_${b}`;\n const stripped = stripStructuralDirective(branchNode);\n if (branchNode.directives?.switch !== undefined)\n stripped.directives = {\n ...stripped.directives,\n switch: branchNode.directives.switch,\n };\n const sub = generateDomFactory([stripped], branchHash, scopeId, {\n ...options,\n sub: true,\n });\n subFactoryCodeBlocks.push(sub.code);\n\n const branch: IfDescriptor['branches'][0] = {\n factory: sub.factoryName,\n };\n if (branchNode.directives?.if !== undefined)\n branch.expr = branchNode.directives.if;\n else if (branchNode.directives?.elseIf !== undefined)\n branch.expr = branchNode.directives.elseIf;\n branches.push(branch);\n }\n\n // Emit comment placeholder\n const commentVar = `c${ctx.commentCount++}`;\n ctx.lines.push(\n `const ${commentVar}=document.createComment('if:${escapeJS(pid)}');`\n );\n markAnchorSlot(ctx, commentVar, options.anchorSlots?.get(pid));\n varNames.push(commentVar);\n\n structuralDescriptors.push({ t: 'if', pid, branches });\n continue;\n }\n\n // ─── Orphaned @else-if, @else, @case, @default ────────────────────\n if (\n node.type === 'element' &&\n (node.directives?.elseIf !== undefined ||\n node.directives?.else !== undefined ||\n node.directives?.case !== undefined ||\n isDefaultCase(node))\n ) {\n if (\n node.directives?.elseIf !== undefined ||\n node.directives?.else !== undefined\n )\n console.warn(\n `[pithy:aot] ${node.directives.elseIf !== undefined ? '@else-if' : '@else'} has no @if directly before it; <${node.originalTagName ?? node.tagName}> is dropped`\n );\n continue;\n }\n\n // ─── @for loop ───────────────────────────────────────────────────\n if (node.type === 'element' && node.directives?.for) {\n const pid = node.nodeId ?? `_${i}`;\n const forHash = `${safeHash}_for_${pid}`;\n const stripped = stripStructuralDirective(node);\n const sub = generateDomFactory([stripped], forHash, scopeId, {\n ...options,\n sub: true,\n });\n subFactoryCodeBlocks.push(sub.code);\n\n const commentVar = `c${ctx.commentCount++}`;\n ctx.lines.push(\n `const ${commentVar}=document.createComment('for:${escapeJS(pid)}');`\n );\n markAnchorSlot(ctx, commentVar, options.anchorSlots?.get(pid));\n varNames.push(commentVar);\n\n const forDir = node.directives.for;\n const desc: ForDescriptor = {\n t: 'for',\n pid,\n item: forDir.itemVar,\n expr: forDir.collectionExpr,\n factory: sub.factoryName,\n };\n if (forDir.indexVar) desc.index = forDir.indexVar;\n if (forDir.trackBy) desc.trackBy = forDir.trackBy;\n structuralDescriptors.push(desc);\n continue;\n }\n\n // ─── @switch block ───────────────────────────────────────────────\n if (node.type === 'element' && node.directives?.switch !== undefined) {\n const pid = node.nodeId ?? `_${i}`;\n // Ensure the original node has nodeId so generateBindings can find it too\n if (!node.nodeId) node.nodeId = pid;\n\n // Serialize the switch container (without children, without @switch directive).\n // nodeId is guaranteed set above, so data-pid is always emitted.\n const switchShell: PithyNode = {\n ...node,\n children: [],\n directives: stripSwitchDirective(node.directives),\n };\n const shellResult = serializeNode(switchShell, ctx);\n if (shellResult) varNames.push(shellResult.varName);\n\n // Generate sub-factory for each @case/@default child\n const cases: SwitchDescriptor['cases'] = [];\n let dropped: string | undefined;\n for (let c = 0; c < (node.children ?? []).length; c++) {\n const caseNode = node.children![c];\n if (\n caseNode.type !== 'element' ||\n (caseNode.directives?.case === undefined && !isDefaultCase(caseNode))\n ) {\n if (caseNode.type === 'element')\n dropped ??= `<${caseNode.originalTagName ?? caseNode.tagName}>`;\n else if (caseNode.type === 'slot') dropped ??= '<slot>';\n else if (caseNode.type === 'text' && caseNode.textContent?.trim())\n dropped ??= JSON.stringify(caseNode.textContent.trim());\n continue;\n }\n\n const caseHash = `${safeHash}_sw_${pid}_${c}`;\n const stripped = stripStructuralDirective(caseNode);\n if (caseNode.directives?.switch !== undefined)\n stripped.directives = {\n ...stripped.directives,\n switch: caseNode.directives.switch,\n };\n const sub = generateDomFactory([stripped], caseHash, scopeId, {\n ...options,\n sub: true,\n });\n subFactoryCodeBlocks.push(sub.code);\n\n const caseDesc: SwitchDescriptor['cases'][0] = {\n factory: sub.factoryName,\n };\n if (caseNode.directives?.case !== undefined)\n caseDesc.val = caseNode.directives.case;\n cases.push(caseDesc);\n }\n\n if (dropped)\n console.warn(\n `[pithy:aot] @switch renders only its @case/@default children; ${dropped} is dropped`\n );\n\n structuralDescriptors.push({\n t: 'switch',\n pid,\n expr: node.directives.switch,\n cases,\n });\n continue;\n }\n\n // ─── Text nodes ─────────────────────────────────────────────────\n if (node.type === 'text') {\n const result = serializeNode(node, ctx);\n if (result) varNames.push(result.varName);\n continue;\n }\n\n // ─── Slot nodes (content projection) ─────────────────────────────\n if (node.type === 'slot') {\n const slotName = node.slotName ?? '';\n const pid = node.nodeId ?? `_slot_${ctx.commentCount}`;\n\n // Emit comment anchor for the slot\n const commentVar = `c${ctx.commentCount++}`;\n ctx.lines.push(\n `const ${commentVar}=document.createComment('slot:${escapeJS(slotName)}');`\n );\n varNames.push(commentVar);\n\n // Build projection descriptor\n const projDesc: ProjectionDescriptor = {\n t: 'proj',\n pid,\n name: slotName,\n };\n\n // Generate sub-factory for fallback content if present\n if (node.fallbackChildren && node.fallbackChildren.length > 0) {\n const fbHash = `${safeHash}_slot_${pid}`;\n const sub = generateDomFactory(node.fallbackChildren, fbHash, scopeId, {\n ...options,\n sub: true,\n });\n subFactoryCodeBlocks.push(sub.code);\n projDesc.fallback = sub.factoryName;\n }\n\n structuralDescriptors.push(projDesc);\n continue;\n }\n\n // ─── Regular element (no structural directive on THIS node) ──────\n // Serialize element shell (without children) via serializeNode,\n // then process children recursively with structural awareness.\n if (node.type === 'element') {\n const shell: PithyNode = { ...node, children: [] };\n const result = serializeNode(shell, ctx);\n if (!result) continue;\n\n const tag = node.originalTagName ?? node.tagName ?? '';\n if (\n node.isComponent &&\n node.nodeId &&\n node.children?.length &&\n options.templateComponents?.has(tag)\n ) {\n const { children, anchorSlots } = asTemplateRoots(\n node.children,\n node.nodeId,\n tag\n );\n const sub = generateDomFactory(\n children,\n `${safeHash}_tpl_${node.nodeId}`,\n scopeId,\n { ...options, wrappable: true, anchorSlots }\n );\n subFactoryCodeBlocks.push(sub.code);\n childFactories.set(node.nodeId, sub.factoryName);\n varNames.push(result.varName);\n continue;\n }\n\n // Recursively process children (handles nested structural directives)\n const childVarNames = processNodes(\n node.children ?? [],\n ctx,\n safeHash,\n scopeId,\n subFactoryCodeBlocks,\n structuralDescriptors,\n options,\n childFactories\n );\n\n // Append children to this element\n if (childVarNames.length === 1) {\n ctx.lines.push(`${result.varName}.appendChild(${childVarNames[0]});`);\n } else if (childVarNames.length > 1) {\n ctx.lines.push(`${result.varName}.append(${childVarNames.join(',')});`);\n }\n\n varNames.push(result.varName);\n continue;\n }\n }\n\n return varNames;\n}\n\nfunction markAnchorSlot(\n ctx: SerializeContext,\n commentVar: string,\n slot: string | undefined\n): void {\n if (slot === undefined) return;\n ctx.lines.push(`${commentVar}.__pithyAnchorSlot='${escapeJS(slot)}';`);\n}\n\nfunction asTemplateRoots(\n nodes: PithyNode[],\n ownerId: string,\n ownerTag: string\n): { children: PithyNode[]; anchorSlots: Map<string, string> } {\n const anchorSlots = new Map<string, string>();\n let chainSlot: string | undefined;\n let inChain = false;\n let chainWarned = false;\n\n const children = nodes.map(child => {\n const root =\n child.parentId === ownerId ? { ...child, parentId: undefined } : child;\n const d = root.directives;\n const isHead = d?.if !== undefined;\n const isBranch = d?.elseIf !== undefined || d?.else !== undefined;\n const isLoop = d?.for !== undefined;\n\n if (isHead) {\n inChain = true;\n chainSlot = d.slot;\n chainWarned = false;\n } else if (!isBranch) {\n inChain = false;\n }\n\n if (isBranch && inChain && d.slot !== chainSlot && !chainWarned) {\n chainWarned = true;\n console.warn(\n `[pithy:aot] <${ownerTag}>: the branches of an @if chain carry different slots ` +\n `(${chainSlot ?? 'none'} and ${d.slot ?? 'none'}). ` +\n `The whole chain is placed by its first branch.`\n );\n }\n\n if (d?.else !== undefined) inChain = false;\n\n if (!d || d.slot === undefined || !(isHead || isBranch || isLoop))\n return root;\n\n if (root.nodeId && (isHead || isLoop)) anchorSlots.set(root.nodeId, d.slot);\n const { slot: _slot, ...directives } = d;\n return { ...root, directives };\n });\n\n return { children, anchorSlots };\n}\n\n/**\n * Remove the `switch` field from a ParsedDirectives object.\n * Used to serialize the switch container element without the @switch directive\n * (since the directive is captured in the SwitchDescriptor instead).\n */\nfunction stripSwitchDirective(\n d: NonNullable<PithyNode['directives']>\n): PithyNode['directives'] {\n const { switch: _switch, ...rest } = d;\n return Object.keys(rest).length > 0\n ? (rest as PithyNode['directives'])\n : undefined;\n}\n"]}
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
*/
|
|
16
|
-
export { generateDomFactory } from './generateDomFactory';
|
|
17
|
-
export type { AotCodegenResult, AotCodegenOptions } from './generateDomFactory';
|
|
16
|
+
export { generateDomFactory } from './generateDomFactory.js';
|
|
17
|
+
export type { AotCodegenResult, AotCodegenOptions } from './generateDomFactory.js';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/aotCodegen/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/aotCodegen/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/aotCodegen/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.aot.codegen\",\n \"title\": \"AOT Template Codegen\",\n \"category\": \"compiler\",\n \"description\": \"Public entry point for the AOT template code generation pipeline, re-exporting DOM factory, bindings, and serialization.\",\n \"since\": \"0.0.1\",\n \"stability\": \"experimental\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"aotCodegen.test.ts\" },\n \"integration\": { \"required\": true, \"covered\": true, \"file\": \"integration.test.ts\" },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nexport { generateDomFactory } from './generateDomFactory';\nexport type { AotCodegenResult, AotCodegenOptions } from './generateDomFactory';\n"]}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
*/
|
|
16
|
-
import type
|
|
16
|
+
import { type PithyNode } from '@pithyjs/compiler';
|
|
17
17
|
/** Tracks variable counters during a single factory generation pass. */
|
|
18
18
|
export interface SerializeContext {
|
|
19
19
|
/** Next element variable index (e0, e1, ...) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeNode.d.ts","sourceRoot":"","sources":["../../src/aotCodegen/serializeNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"serializeNode.d.ts","sourceRoot":"","sources":["../../src/aotCodegen/serializeNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAC;AAG3B,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,sKAAsK;AACtK,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAQzE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wLAAwL;AACxL,wBAAgB,aAAa,CAC3B,IAAI,EAAE,SAAS,EACf,GAAG,EAAE,gBAAgB,GACpB,cAAc,GAAG,IAAI,CAWvB"}
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
*/
|
|
16
|
-
import { SVG_TAGS, SVG_NS } from '
|
|
17
|
-
import {
|
|
18
|
-
import { escapeJS } from './utils';
|
|
16
|
+
import { SVG_TAGS, SVG_NS, forEachDomDirectiveAttr, } from '@pithyjs/compiler';
|
|
17
|
+
import { escapeJS } from './utils.js';
|
|
19
18
|
/**
|
|
20
19
|
* Create a fresh serialize context for a single factory generation pass.
|
|
21
20
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeNode.js","sourceRoot":"","sources":["../../src/aotCodegen/serializeNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAGF,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAwBnC;;;;;;;;;;;;;;;;GAgBG;AACH,sKAAsK;AACtK,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IAC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AAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,uDAAuD,IAAI,CAAC,MAAM,2EAA2E,CAC9I,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,oDAAoD,IAAI,CAAC,MAAM,2EAA2E,CAC3I,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,sDAAsD,IAAI,CAAC,MAAM,2EAA2E,CAC7I,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,oDAAoD,IAAI,CAAC,MAAM,2EAA2E,CAC3I,CAAC;IACJ,CAAC;IACD,+EAA+E;IAC/E,kFAAkF;AACpF,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.aot.serialize-node\",\n \"title\": \"AOT Node Serializer\",\n \"category\": \"compiler\",\n \"description\": \"Serializes parsed template nodes into static HTML strings with marker comments for dynamic binding points.\",\n \"since\": \"0.0.1\",\n \"stability\": \"experimental\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"aotCodegen.test.ts\" },\n \"integration\": { \"required\": false, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport {\n SVG_TAGS,\n SVG_NS,\n forEachDomDirectiveAttr,\n type PithyNode,\n} from '@pithyjs/compiler';\nimport { escapeJS } from './utils';\n\n/** Tracks variable counters during a single factory generation pass. */\nexport interface SerializeContext {\n /** Next element variable index (e0, e1, ...) */\n elementCount: number;\n /** Next text node variable index (t0, t1, ...) */\n textCount: number;\n /** Next comment variable index (c0, c1, ...) */\n commentCount: number;\n /** Scope ID for data-scope-{id} attributes (e.g. \"pithy-abc123\") */\n scopeId?: string;\n /** Accumulated lines of JS code */\n lines: string[];\n}\n\n/** Result of serializing a single node. */\nexport interface SerializedNode {\n /** Variable name assigned to this DOM node (e.g. \"e0\", \"t3\") */\n varName: string;\n /** Variable names of direct children (for parent.append(...children)) */\n childVarNames: string[];\n}\n\n/**\n * Create a fresh serialize context for a single factory generation pass.\n *\n * The context accumulates JS code lines and tracks variable counters\n * across recursive `serializeNode` calls. Each factory should use\n * its own context.\n *\n * @param scopeId - Optional CSS scope ID (e.g. \"pithy-abc123\").\n * When provided, every element gets a `data-scope-{scopeId}` attribute.\n *\n * @example\n * ```typescript\n * const ctx = createSerializeContext('pithy-abc123');\n * serializeNode(rootNode, ctx);\n * console.log(ctx.lines); // [\"const e0=document.createElement('div');\", ...]\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.aot.serialize-node\",\"name\":\"createSerializeContext\",\"stability\":\"experimental\",\"signature\":\"(scopeId?: string) => SerializeContext\"} */\nexport function createSerializeContext(scopeId?: string): SerializeContext {\n return {\n elementCount: 0,\n textCount: 0,\n commentCount: 0,\n scopeId,\n lines: [],\n };\n}\n\n/**\n * Serialize a single PithyNode into JS code that creates the corresponding\n * DOM node. Appends code lines to `ctx.lines` and returns the variable name.\n *\n * Phase 1 scope: elements, text nodes.\n * Skips directive attributes (@, []) — those become binding descriptors.\n * Throws on structural directives (@for, @if, @switch) — those are Phase 2.\n *\n * @example\n * ```typescript\n * const ctx = createSerializeContext('pithy-abc123');\n * const result = serializeNode(node, ctx);\n * // ctx.lines now contains JS code lines\n * // result.varName is e.g. \"e0\"\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.aot.serialize-node\",\"name\":\"serializeNode\",\"stability\":\"experimental\",\"signature\":\"(node: PithyNode, ctx: SerializeContext) => SerializedNode | null\"} */\nexport function serializeNode(\n node: PithyNode,\n ctx: SerializeContext\n): SerializedNode | null {\n if (node.type === 'text') {\n return serializeTextNode(node, ctx);\n }\n\n if (node.type === 'element') {\n return serializeElementNode(node, ctx);\n }\n\n // Slot nodes are handled by processNodes in generateDomFactory.ts — they should not reach here.\n return null;\n}\n\nfunction serializeTextNode(\n node: PithyNode,\n ctx: SerializeContext\n): SerializedNode {\n const varName = `t${ctx.textCount++}`;\n const content = node.textContent ?? '';\n ctx.lines.push(\n `const ${varName}=document.createTextNode('${escapeJS(content)}');`\n );\n return { varName, childVarNames: [] };\n}\n\nfunction serializeElementNode(\n node: PithyNode,\n ctx: SerializeContext\n): SerializedNode {\n // Guard: structural directives are not supported in Phase 1\n assertNoStructuralDirectives(node);\n\n const varName = `e${ctx.elementCount++}`;\n const tag = node.originalTagName ?? node.tagName ?? 'div';\n const tagLower = tag.toLowerCase();\n\n // Create element (SVG vs HTML namespace)\n if (SVG_TAGS.has(tagLower)) {\n ctx.lines.push(\n `const ${varName}=document.createElementNS('${SVG_NS}','${escapeJS(tag)}');`\n );\n } else {\n ctx.lines.push(\n `const ${varName}=document.createElement('${escapeJS(tag)}');`\n );\n }\n\n // Set static attributes (skip directive attrs, data-pid, and slot which are set separately)\n for (const [name, value] of Object.entries(node.attrs ?? {})) {\n if (\n name.startsWith('@') ||\n name.startsWith('[') ||\n name === 'data-pid' ||\n name === 'slot'\n )\n continue;\n\n // Use original casing (important for SVG attrs like viewBox)\n const originalName = node.originalAttrs?.[name] || name;\n ctx.lines.push(\n `${varName}.setAttribute('${escapeJS(originalName)}','${escapeJS(value)}');`\n );\n }\n\n // Phase 5's applyBindings() reads from descriptors only — directive data-*\n // attributes (data-on-click, data-bind-*, data-class-toggle-*, etc.) are NOT\n // emitted in AOT output. They were transitional scaffolding removed in Phase 6.\n //\n // That holds for every directive that HAS a descriptor. The router pair does\n // not: their consumers query the DOM for the attribute, so dropping them with\n // the rest of the `@` attributes above left every built app without an outlet.\n // Emitted through the compiler's own mapping rather than re-spelled here, so\n // the two compilation paths cannot disagree about it again.\n if (node.directives) {\n forEachDomDirectiveAttr(node.directives, (attr, value) => {\n ctx.lines.push(\n `${varName}.setAttribute('${escapeJS(attr)}','${escapeJS(value)}');`\n );\n });\n }\n\n // Slot assignment is still needed as a regular HTML attribute so the runtime\n // binder can collect slot content from DOM children.\n if (node.directives?.slot !== undefined) {\n ctx.lines.push(\n `${varName}.setAttribute('slot','${escapeJS(node.directives.slot)}');`\n );\n }\n\n // Set scope ID attribute\n if (ctx.scopeId) {\n ctx.lines.push(\n `${varName}.setAttribute('data-scope-${escapeJS(ctx.scopeId)}','');`\n );\n }\n\n // Set data-pid for binding resolution (after directives, matching runtime order)\n if (node.nodeId) {\n ctx.lines.push(\n `${varName}.setAttribute('data-pid','${escapeJS(node.nodeId)}');`\n );\n } else if (node.attrs?.['data-pid']) {\n ctx.lines.push(\n `${varName}.setAttribute('data-pid','${escapeJS(node.attrs['data-pid'])}');`\n );\n }\n\n // Recursively serialize children\n const childVarNames: string[] = [];\n for (const child of node.children ?? []) {\n const childResult = serializeNode(child, ctx);\n if (childResult) {\n childVarNames.push(childResult.varName);\n }\n }\n\n // Append children to this element\n if (childVarNames.length === 1) {\n ctx.lines.push(`${varName}.appendChild(${childVarNames[0]});`);\n } else if (childVarNames.length > 1) {\n ctx.lines.push(`${varName}.append(${childVarNames.join(',')});`);\n }\n\n return { varName, childVarNames };\n}\n\n/**\n * Defense-in-depth guard: structural directives should be handled by `processNodes`\n * in `generateDomFactory.ts` and never reach `serializeNode`. If one does, it means\n * a bug in the structural codegen pipeline.\n */\nfunction assertNoStructuralDirectives(node: PithyNode): void {\n const d = node.directives;\n if (!d) return;\n\n if (d.for) {\n throw new Error(\n `AOT: @for directive reached serializeNode (node ${node.nodeId}). This is a bug — structural directives must be handled by processNodes.`\n );\n }\n if (d.if !== undefined) {\n throw new Error(\n `AOT: @if directive reached serializeNode (node ${node.nodeId}). This is a bug — structural directives must be handled by processNodes.`\n );\n }\n if (d.elseIf !== undefined) {\n throw new Error(\n `AOT: @else-if directive reached serializeNode (node ${node.nodeId}). This is a bug — structural directives must be handled by processNodes.`\n );\n }\n if (d.else !== undefined) {\n throw new Error(\n `AOT: @else directive reached serializeNode (node ${node.nodeId}). This is a bug — structural directives must be handled by processNodes.`\n );\n }\n if (d.switch !== undefined) {\n throw new Error(\n `AOT: @switch directive reached serializeNode (node ${node.nodeId}). This is a bug — structural directives must be handled by processNodes.`\n );\n }\n if (d.case !== undefined) {\n throw new Error(\n `AOT: @case directive reached serializeNode (node ${node.nodeId}). This is a bug — structural directives must be handled by processNodes.`\n );\n }\n // Note: @default is stored in node.attrs['@default'], not in ParsedDirectives,\n // so it cannot be caught here. It is handled by processNodes via isDefaultCase().\n}\n"]}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
*/
|
|
16
|
-
import type { PithyNode } from '
|
|
17
|
-
export { collectIfChain, isDefaultCase, isStructuralNode, } from '
|
|
16
|
+
import type { PithyNode } from '@pithyjs/compiler';
|
|
17
|
+
export { collectIfChain, isDefaultCase, isStructuralNode, } from '@pithyjs/compiler';
|
|
18
18
|
/**
|
|
19
19
|
* Create a shallow copy of a PithyNode with structural directive fields removed.
|
|
20
20
|
* Preserves all other properties (tag, attrs, children, non-structural directives).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structuralCodegen.d.ts","sourceRoot":"","sources":["../../src/aotCodegen/structuralCodegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"structuralCodegen.d.ts","sourceRoot":"","sources":["../../src/aotCodegen/structuralCodegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,mBAAmB,CAAC;AAIrE,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;;GAiBG;AACH,oKAAoK;AACpK,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CA6BnE"}
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
*/
|
|
16
|
-
// Re-export shared utilities from compiler
|
|
16
|
+
// Re-export shared utilities from the compiler
|
|
17
17
|
// (single source of truth — also used by runtime bindConditionals/bindSwitchCases)
|
|
18
|
-
export { collectIfChain, isDefaultCase, isStructuralNode, } from '
|
|
18
|
+
export { collectIfChain, isDefaultCase, isStructuralNode, } from '@pithyjs/compiler';
|
|
19
19
|
/**
|
|
20
20
|
* Create a shallow copy of a PithyNode with structural directive fields removed.
|
|
21
21
|
* Preserves all other properties (tag, attrs, children, non-structural directives).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structuralCodegen.js","sourceRoot":"","sources":["../../src/aotCodegen/structuralCodegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;
|
|
1
|
+
{"version":3,"file":"structuralCodegen.js","sourceRoot":"","sources":["../../src/aotCodegen/structuralCodegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAIF,+CAA+C;AAC/C,mFAAmF;AACnF,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;;GAiBG;AACH,oKAAoK;AACpK,MAAM,UAAU,wBAAwB,CAAC,IAAe;IACtD,uCAAuC;IACvC,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACvB,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK,EAAE,CAAC;QACjC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;QACrD,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IACpE,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QACrB,8DAA8D;QAC9D,OAAO,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1D,CAAC;IAED,MAAM,EACJ,EAAE,EAAE,GAAG,EACP,IAAI,EAAE,KAAK,EACX,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,IAAI,EACT,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,KAAK,EACX,GAAG,IAAI,EACR,GAAG,IAAI,CAAC,UAAU,CAAC;IAEpB,OAAO;QACL,GAAG,IAAI;QACP,KAAK;QACL,UAAU,EACR,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAE,IAAyB,CAAC,CAAC,CAAC,SAAS;KACxE,CAAC;AACJ,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.aot.structural-codegen\",\n \"title\": \"AOT Structural Directive Codegen\",\n \"category\": \"compiler\",\n \"description\": \"Generates code for structural directives (@if, @for, @switch) in AOT-compiled templates.\",\n \"since\": \"0.0.1\",\n \"stability\": \"experimental\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"aotCodegen.test.ts\" },\n \"integration\": { \"required\": false, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport type { PithyNode, ParsedDirectives } from '@pithyjs/compiler';\n\n// Re-export shared utilities from the compiler\n// (single source of truth — also used by runtime bindConditionals/bindSwitchCases)\nexport {\n collectIfChain,\n isDefaultCase,\n isStructuralNode,\n} from '@pithyjs/compiler';\n\n/**\n * Create a shallow copy of a PithyNode with structural directive fields removed.\n * Preserves all other properties (tag, attrs, children, non-structural directives).\n *\n * Used to prepare nodes for sub-factory generation — the structural directive\n * itself is handled at the parent level, not inside the sub-factory.\n *\n * AOT-specific: the runtime doesn't need this because it processes directives\n * in-place rather than generating factories.\n *\n * @example\n * ```typescript\n * const node = { type: 'element', tagName: 'div',\n * directives: { if: 'show()', events: { click: 'fn()' } } };\n * const stripped = stripStructuralDirective(node);\n * // stripped.directives → { events: { click: 'fn()' } } (no @if)\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.aot.structural-codegen\",\"name\":\"stripStructuralDirective\",\"stability\":\"experimental\",\"signature\":\"(node: PithyNode) => PithyNode\"} */\nexport function stripStructuralDirective(node: PithyNode): PithyNode {\n // Strip @default from attrs if present\n let attrs = node.attrs;\n if (attrs && '@default' in attrs) {\n const { '@default': _default, ...restAttrs } = attrs;\n attrs = Object.keys(restAttrs).length > 0 ? restAttrs : undefined;\n }\n\n if (!node.directives) {\n // No directives to strip, but @default may have been in attrs\n return attrs !== node.attrs ? { ...node, attrs } : node;\n }\n\n const {\n if: _if,\n else: _else,\n elseIf: _elseIf,\n for: _for,\n switch: _switch,\n case: _case,\n ...rest\n } = node.directives;\n\n return {\n ...node,\n attrs,\n directives:\n Object.keys(rest).length > 0 ? (rest as ParsedDirectives) : undefined,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/aotCodegen/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wHAAwH;AACxH,MAAM,UAAU,QAAQ,CAAC,CAAS;IAChC,OAAO,CAAC;SACL,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC;SACvB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;SAC7B,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACnC,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/aotCodegen/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wHAAwH;AACxH,MAAM,UAAU,QAAQ,CAAC,CAAS;IAChC,OAAO,CAAC;SACL,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC;SACvB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;SAC7B,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.aot.utils\",\n \"title\": \"AOT String Utilities\",\n \"category\": \"compiler\",\n \"description\": \"Utility functions for escaping and formatting strings in AOT-generated code.\",\n \"since\": \"0.0.1\",\n \"stability\": \"experimental\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"aotCodegen.test.ts\" },\n \"integration\": { \"required\": false, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\n/**\n * Escape a string for use inside a single-quoted JS string literal.\n *\n * Handles: null byte, backslash, single quote, newline, carriage return,\n * tab, and JS line separators (U+2028, U+2029).\n * Does NOT escape double quotes (unnecessary inside single-quoted strings).\n *\n * Used by both `serializeNode` and `serializeBindings` to produce\n * safe string literals in generated factory code.\n *\n * @param s - Raw string to escape\n * @returns Escaped string safe for embedding in `'...'` JS literals\n *\n * @example\n * ```typescript\n * escapeJS(\"it's a test\") // \"it\\\\'s a test\"\n * escapeJS(\"line1\\nline2\") // \"line1\\\\nline2\"\n * escapeJS(\"back\\\\slash\") // \"back\\\\\\\\slash\"\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.aot.utils\",\"name\":\"escapeJS\",\"stability\":\"stable\",\"signature\":\"(s: string) => string\"} */\nexport function escapeJS(s: string): string {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\0/g, '\\\\x00')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029');\n}\n"]}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
*/
|
|
16
16
|
import type { PluginObj, PluginPass } from '@babel/core';
|
|
17
|
-
import { type ComponentScopesMap } from './extractUsedIdentifiers';
|
|
17
|
+
import { type ComponentScopesMap } from './extractUsedIdentifiers.js';
|
|
18
18
|
interface PluginState extends PluginPass {
|
|
19
19
|
importedIdentifiers: Set<string>;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babelPlugin.d.ts","sourceRoot":"","sources":["../../src/babelPlugin/babelPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAGF,OAAO,KAAK,EAAY,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,
|
|
1
|
+
{"version":3,"file":"babelPlugin.d.ts","sourceRoot":"","sources":["../../src/babelPlugin/babelPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAGF,OAAO,KAAK,EAAY,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAUlC,UAAU,WAAY,SAAQ,UAAU;IACtC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAClC;AA+ID;;GAEG;AACH,mKAAmK;AACnK,MAAM,WAAW,uBAAuB;IACtC,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC,uDAAuD;IACvD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,oHAAoH;IACpH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAoBD;;;;;;;GAOG;AACH,wLAAwL;AACxL,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,OAAO,CAAC,EAAE,uBAAuB,GAChC,SAAS,CAAC,WAAW,CAAC,CA6mBxB"}
|