@pithyjs/vite-plugin 0.2.0-beta.1 → 0.2.0-beta.11
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 +5 -3
- package/dist/aotCodegen/generateBindings.d.ts.map +1 -1
- package/dist/aotCodegen/generateBindings.js +16 -8
- 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 +111 -32
- 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 +80 -44
- 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
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;IACrD,OAAO;QACL,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;QACf,OAAO;QACP,KAAK,EAAE,EAAE;KACV,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wLAAwL;AACxL,MAAM,UAAU,aAAa,CAC3B,IAAe,EACf,GAAqB;IAErB,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACzB,OAAO,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,oBAAoB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,gGAAgG;IAChG,OAAO,IAAI,CAAC;AACd,C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,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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":["/** @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"}
|
|
@@ -15,12 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import * as t from '@babel/types';
|
|
17
17
|
import { parseFragment } from 'parse5';
|
|
18
|
-
import { extractUsedIdentifiers, } from './extractUsedIdentifiers';
|
|
19
|
-
import { warnOnLowercaseComponentTags } from '
|
|
20
|
-
import { parseTemplate } from '../../../compiler/src/parse/parseTemplate';
|
|
18
|
+
import { extractUsedIdentifiers, } from './extractUsedIdentifiers.js';
|
|
19
|
+
import { parseTemplate, warnOnLowercaseComponentTags, } from '@pithyjs/compiler';
|
|
21
20
|
import { createHash } from 'crypto';
|
|
22
21
|
import { parse as babelParse } from '@babel/parser';
|
|
23
|
-
import { generateDomFactory } from '../aotCodegen';
|
|
22
|
+
import { generateDomFactory } from '../aotCodegen/index.js';
|
|
24
23
|
/**
|
|
25
24
|
* Extract parameter names from arrow function expressions in template strings.
|
|
26
25
|
* Used to exclude event handler params (e.g., `ev`) from the hoisted context object.
|
|
@@ -42,6 +41,101 @@ function extractArrowParamNames(s) {
|
|
|
42
41
|
}
|
|
43
42
|
return out;
|
|
44
43
|
}
|
|
44
|
+
function stringLikeNames(node) {
|
|
45
|
+
if (t.isIdentifier(node))
|
|
46
|
+
return [node.name];
|
|
47
|
+
if (t.isNumericLiteral(node))
|
|
48
|
+
return [];
|
|
49
|
+
if (t.isBinaryExpression(node) &&
|
|
50
|
+
(node.operator === '-' || node.operator === '/')) {
|
|
51
|
+
const left = t.isExpression(node.left) ? stringLikeNames(node.left) : null;
|
|
52
|
+
const right = stringLikeNames(node.right);
|
|
53
|
+
return left && right ? [...left, ...right] : null;
|
|
54
|
+
}
|
|
55
|
+
if (t.isNewExpression(node) &&
|
|
56
|
+
t.isIdentifier(node.callee) &&
|
|
57
|
+
node.arguments.length === 0) {
|
|
58
|
+
return [node.callee.name];
|
|
59
|
+
}
|
|
60
|
+
if (t.isUnaryExpression(node) &&
|
|
61
|
+
(node.operator === 'typeof' || node.operator === 'void')) {
|
|
62
|
+
return stringLikeNames(node.argument);
|
|
63
|
+
}
|
|
64
|
+
if (t.isSequenceExpression(node)) {
|
|
65
|
+
const parts = node.expressions.map(stringLikeNames);
|
|
66
|
+
return parts.every(p => p !== null) ? parts.flat() : null;
|
|
67
|
+
}
|
|
68
|
+
if (t.isMemberExpression(node)) {
|
|
69
|
+
let root = node;
|
|
70
|
+
while (t.isMemberExpression(root) &&
|
|
71
|
+
!root.computed &&
|
|
72
|
+
t.isIdentifier(root.property)) {
|
|
73
|
+
root = root.object;
|
|
74
|
+
}
|
|
75
|
+
if (!t.isIdentifier(root))
|
|
76
|
+
return null;
|
|
77
|
+
return HOST_ROOTS.has(root.name) ? [] : [root.name];
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const HOST_ROOTS = new Set([
|
|
82
|
+
'window',
|
|
83
|
+
'document',
|
|
84
|
+
'location',
|
|
85
|
+
'navigator',
|
|
86
|
+
'history',
|
|
87
|
+
'localStorage',
|
|
88
|
+
'sessionStorage',
|
|
89
|
+
'console',
|
|
90
|
+
'performance',
|
|
91
|
+
'crypto',
|
|
92
|
+
'screen',
|
|
93
|
+
]);
|
|
94
|
+
const typeScopedNames = new WeakMap();
|
|
95
|
+
function scopeStatements(block) {
|
|
96
|
+
if (t.isProgram(block) ||
|
|
97
|
+
t.isBlockStatement(block) ||
|
|
98
|
+
t.isStaticBlock(block) ||
|
|
99
|
+
t.isTSModuleBlock(block))
|
|
100
|
+
return block.body;
|
|
101
|
+
if (t.isFunction(block) && t.isBlockStatement(block.body))
|
|
102
|
+
return block.body.body;
|
|
103
|
+
if (t.isSwitchStatement(block))
|
|
104
|
+
return block.cases.flatMap(c => c.consequent);
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
function declaredTsValueNames(path) {
|
|
108
|
+
const names = new Set();
|
|
109
|
+
for (let scope = path.scope; scope; scope = scope.parent) {
|
|
110
|
+
let declared = typeScopedNames.get(scope.block);
|
|
111
|
+
if (!declared) {
|
|
112
|
+
declared = new Set();
|
|
113
|
+
for (const stmt of scopeStatements(scope.block)) {
|
|
114
|
+
const decl = t.isExportNamedDeclaration(stmt) && stmt.declaration
|
|
115
|
+
? stmt.declaration
|
|
116
|
+
: stmt;
|
|
117
|
+
if ((t.isTSEnumDeclaration(decl) || t.isTSModuleDeclaration(decl)) &&
|
|
118
|
+
t.isIdentifier(decl.id)) {
|
|
119
|
+
declared.add(decl.id.name);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
typeScopedNames.set(scope.block, declared);
|
|
123
|
+
}
|
|
124
|
+
declared.forEach(name => names.add(name));
|
|
125
|
+
}
|
|
126
|
+
return names;
|
|
127
|
+
}
|
|
128
|
+
function quoteForTemplateSource(value) {
|
|
129
|
+
return `'${value
|
|
130
|
+
.replace(/\\/g, '\\\\\\\\')
|
|
131
|
+
.replace(/'/g, "\\\\'")
|
|
132
|
+
.replace(/\r/g, '\\\\r')
|
|
133
|
+
.replace(/\n/g, '\\\\n')
|
|
134
|
+
.replace(/`/g, '\\`')
|
|
135
|
+
.replace(/\$\{/g, '\\${')
|
|
136
|
+
.replace(/&/g, '&')
|
|
137
|
+
.replace(/"/g, '"')}'`;
|
|
138
|
+
}
|
|
45
139
|
// Names that should never be hoisted into ctx even if seen in expressions
|
|
46
140
|
const RESERVED_LOCAL_EVENT_NAMES = new Set([
|
|
47
141
|
'$event',
|
|
@@ -267,7 +361,7 @@ export default function pithyBabelPlugin(options) {
|
|
|
267
361
|
const trees = parseComponentTemplate(templateStr, importedIdentifiers);
|
|
268
362
|
if (trees.length === 0)
|
|
269
363
|
return;
|
|
270
|
-
const contextObject = buildContextObject(trees, templateStr);
|
|
364
|
+
const contextObject = buildContextObject(path, trees, templateStr, quasi.expressions.length === 0);
|
|
271
365
|
// ── AOT codegen path ──────────────────────────────────────────────
|
|
272
366
|
if (enableAot && !aotDisabledByCollision) {
|
|
273
367
|
// Templates with ${expr} expressions can't be AOT-compiled safely.
|
|
@@ -416,16 +510,25 @@ export default function pithyBabelPlugin(options) {
|
|
|
416
510
|
withSource: false,
|
|
417
511
|
}).nodes;
|
|
418
512
|
}
|
|
419
|
-
function buildContextObject(trees, templateStr) {
|
|
513
|
+
function buildContextObject(path, trees, templateStr, reportComponentAttrs) {
|
|
420
514
|
// Collect identifiers referenced by expressions in the template
|
|
421
515
|
const usedIdentifiers = new Set();
|
|
516
|
+
const attrReports = [];
|
|
422
517
|
for (const tree of trees) {
|
|
423
|
-
const ids = extractUsedIdentifiers(tree, componentScopes);
|
|
518
|
+
const ids = extractUsedIdentifiers(tree, componentScopes, report => attrReports.push(report));
|
|
424
519
|
ids.forEach(id => usedIdentifiers.add(id));
|
|
425
520
|
}
|
|
426
521
|
// Also collect arrow-function param names appearing in attribute expressions
|
|
427
522
|
// so we can remove them from usedIdentifiers (e.g., "(ev) => ..." or "ev => ...").
|
|
428
523
|
const arrowParams = extractArrowParamNames(templateStr);
|
|
524
|
+
for (const report of attrReports) {
|
|
525
|
+
if (reportComponentAttrs) {
|
|
526
|
+
warnOnStringLikeComponentAttr(path, report);
|
|
527
|
+
}
|
|
528
|
+
else if (!report.parsed) {
|
|
529
|
+
console.warn('[pithy] Failed to parse expression:', report.value, report.error);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
429
532
|
// Compute which imported identifiers are actually used as components
|
|
430
533
|
const usedComponents = new Set();
|
|
431
534
|
const collectComponents = (node) => {
|
|
@@ -452,6 +555,36 @@ export default function pithyBabelPlugin(options) {
|
|
|
452
555
|
])),
|
|
453
556
|
]);
|
|
454
557
|
}
|
|
558
|
+
function warnOnStringLikeComponentAttr(path, { tag, attr, value, names, parsed, expression, error }) {
|
|
559
|
+
let outcome = `does not parse (Failed to parse expression: ${error}), so the attribute is dropped`;
|
|
560
|
+
if (parsed) {
|
|
561
|
+
const collected = new Set(names);
|
|
562
|
+
const tsNames = declaredTsValueNames(path);
|
|
563
|
+
const candidates = expression ? stringLikeNames(expression) : null;
|
|
564
|
+
const unbound = [...new Set(candidates ?? [])].filter(name => collected.has(name) &&
|
|
565
|
+
!path.scope.hasBinding(name) &&
|
|
566
|
+
!tsNames.has(name));
|
|
567
|
+
if (unbound.length === 0)
|
|
568
|
+
return;
|
|
569
|
+
outcome = `reads ${unbound.map(n => `\`${n}\``).join(', ')}, which ${unbound.length === 1 ? 'has' : 'have'} no binding in this module, so it throws or reads a browser global at runtime`;
|
|
570
|
+
}
|
|
571
|
+
let advice = '';
|
|
572
|
+
if (value.includes('{{')) {
|
|
573
|
+
advice =
|
|
574
|
+
' `{{ }}` is not interpolated in a component attribute: write the expression itself, without the braces.';
|
|
575
|
+
}
|
|
576
|
+
else if (parsed || !/[()[\]{};=]/.test(value)) {
|
|
577
|
+
advice = ` To pass a string, quote it: ${attr}="${quoteForTemplateSource(value)}".`;
|
|
578
|
+
}
|
|
579
|
+
const file = options?.filename ??
|
|
580
|
+
path.hub?.file?.opts
|
|
581
|
+
?.filename;
|
|
582
|
+
const loc = path.node.loc?.start;
|
|
583
|
+
const where = file
|
|
584
|
+
? ` (${file}${loc ? `:${loc.line}:${loc.column + 1}` : ''})`
|
|
585
|
+
: '';
|
|
586
|
+
console.warn(`[pithy] <${tag} ${attr}="${value}">: a component attribute is a JavaScript expression, and this one ${outcome}.${advice}${where}`);
|
|
587
|
+
}
|
|
455
588
|
function reportJitFallback(path, reason) {
|
|
456
589
|
const where = options?.filename ? ` (${options.filename})` : '';
|
|
457
590
|
if (options?.strictAot) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babelPlugin.js","sourceRoot":"","sources":["../../src/babelPlugin/babelPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EACL,sBAAsB,GAEvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,kBAAkB,EA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Ae,CAAC,QAAQ,CAAC;gBAC3B,CAAC,CAAC,SAAS,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YAEnC,mBAAmB;YACnB,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE;gBACzD,kBAAkB;aACnB,CAAC,CAAC;YAEH,+DAA+D;YAC/D,8DAA8D;YAC9D,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;YAEvC,qDAAqD;YACrD,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACtC,2EAA2E;YAC3E,2EAA2E;YAC3E,wEAAwE;YACxE,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAAC;gBACvD,qBAAqB,GAAG,IAAI,CAAC;YAC/B,CAAC;YAED,wBAAwB,EAAE,CAAC;YAE3B,IAAI,CAAC,WAAW,CACd,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CACjE,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,iBAAiB,CACf,IAAI,EACJ,iCAAiC;gBAC/B,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CACrD,CAAC;YACF,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.babel.html-context-plugin\",\n \"title\": \"Babel HTML Context Injection Plugin\",\n \"category\": \"plugin\",\n \"description\": \"Babel plugin that injects compilation context into html`…` tagged template literals and AOT-compiles both the tagged form and literal html(template, context) calls, with scope ID generation.\",\n \"since\": \"0.0.1\",\n \"stability\": \"stable\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"babelPluginAot.test.ts\" },\n \"integration\": { \"required\": true, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport * as t from '@babel/types';\nimport type { NodePath, PluginObj, PluginPass } from '@babel/core';\nimport { parseFragment } from 'parse5';\nimport {\n extractUsedIdentifiers,\n type ComponentAttrReport,\n type ComponentScopesMap,\n} from './extractUsedIdentifiers';\nimport {\n parseTemplate,\n warnOnLowercaseComponentTags,\n type PithyNode,\n} from '@pithyjs/compiler';\nimport { createHash } from 'crypto';\nimport { parse as babelParse } from '@babel/parser';\nimport { generateDomFactory } from '../aotCodegen';\n\ninterface PluginState extends PluginPass {\n importedIdentifiers: Set<string>;\n}\n\n/**\n * Extract parameter names from arrow function expressions in template strings.\n * Used to exclude event handler params (e.g., `ev`) from the hoisted context object.\n * @param s - The expression string to scan for arrow functions\n * @returns Set of parameter names found\n */\n/** @codexApi {\"parent\":\"pithy.babel.html-context-plugin\",\"name\":\"extractArrowParamNames\",\"stability\":\"internal\",\"signature\":\"(s: string) => Set<string>\"} */\nfunction extractArrowParamNames(s: string): Set<string> {\n // Very conservative matcher:\n // - \"(ev) =>\", \"(ev: Event) =>\", \"ev =>\"\n // - avoids destructuring/complex params on purpose (we don't want those in ctx anyway)\n const out = new Set<string>();\n const re =\n /(?:\\(\\s*([A-Za-z_$][\\w$]*)\\s*(?::[^)]*)?\\s*\\)|\\b([A-Za-z_$][\\w$]*)\\b)\\s*=>/g;\n let m: RegExpExecArray | null;\n while ((m = re.exec(s))) {\n const name = m[1] || m[2];\n if (name) out.add(name);\n }\n return out;\n}\n\nfunction stringLikeNames(node: t.Expression): string[] | null {\n if (t.isIdentifier(node)) return [node.name];\n if (t.isNumericLiteral(node)) return [];\n if (\n t.isBinaryExpression(node) &&\n (node.operator === '-' || node.operator === '/')\n ) {\n const left = t.isExpression(node.left) ? stringLikeNames(node.left) : null;\n const right = stringLikeNames(node.right);\n return left && right ? [...left, ...right] : null;\n }\n if (\n t.isNewExpression(node) &&\n t.isIdentifier(node.callee) &&\n node.arguments.length === 0\n ) {\n return [node.callee.name];\n }\n if (\n t.isUnaryExpression(node) &&\n (node.operator === 'typeof' || node.operator === 'void')\n ) {\n return stringLikeNames(node.argument);\n }\n if (t.isSequenceExpression(node)) {\n const parts = node.expressions.map(stringLikeNames);\n return parts.every(p => p !== null) ? parts.flat() : null;\n }\n if (t.isMemberExpression(node)) {\n let root: t.Expression = node;\n while (\n t.isMemberExpression(root) &&\n !root.computed &&\n t.isIdentifier(root.property)\n ) {\n root = root.object;\n }\n if (!t.isIdentifier(root)) return null;\n return HOST_ROOTS.has(root.name) ? [] : [root.name];\n }\n return null;\n}\n\nconst HOST_ROOTS = new Set([\n 'window',\n 'document',\n 'location',\n 'navigator',\n 'history',\n 'localStorage',\n 'sessionStorage',\n 'console',\n 'performance',\n 'crypto',\n 'screen',\n]);\n\nconst typeScopedNames = new WeakMap<t.Node, Set<string>>();\n\nfunction scopeStatements(block: t.Node): t.Statement[] {\n if (\n t.isProgram(block) ||\n t.isBlockStatement(block) ||\n t.isStaticBlock(block) ||\n t.isTSModuleBlock(block)\n )\n return block.body;\n if (t.isFunction(block) && t.isBlockStatement(block.body))\n return block.body.body;\n if (t.isSwitchStatement(block)) return block.cases.flatMap(c => c.consequent);\n return [];\n}\n\nfunction declaredTsValueNames(path: NodePath): Set<string> {\n const names = new Set<string>();\n for (let scope = path.scope; scope; scope = scope.parent) {\n let declared = typeScopedNames.get(scope.block);\n if (!declared) {\n declared = new Set();\n for (const stmt of scopeStatements(scope.block)) {\n const decl =\n t.isExportNamedDeclaration(stmt) && stmt.declaration\n ? stmt.declaration\n : stmt;\n if (\n (t.isTSEnumDeclaration(decl) || t.isTSModuleDeclaration(decl)) &&\n t.isIdentifier(decl.id)\n ) {\n declared.add(decl.id.name);\n }\n }\n typeScopedNames.set(scope.block, declared);\n }\n declared.forEach(name => names.add(name));\n }\n return names;\n}\n\nfunction quoteForTemplateSource(value: string): string {\n return `'${value\n .replace(/\\\\/g, '\\\\\\\\\\\\\\\\')\n .replace(/'/g, \"\\\\\\\\'\")\n .replace(/\\r/g, '\\\\\\\\r')\n .replace(/\\n/g, '\\\\\\\\n')\n .replace(/`/g, '\\\\`')\n .replace(/\\$\\{/g, '\\\\${')\n .replace(/&/g, '&')\n .replace(/\"/g, '"')}'`;\n}\n\n// Names that should never be hoisted into ctx even if seen in expressions\nconst RESERVED_LOCAL_EVENT_NAMES = new Set([\n '$event',\n 'event',\n 'ev',\n 'e',\n 'evt',\n]);\n\n/**\n * Configuration options for the Pithy Babel HTML context injection plugin.\n */\n/** @codexApi {\"parent\":\"pithy.babel.html-context-plugin\",\"name\":\"PithyBabelPluginOptions\",\"stability\":\"stable\",\"signature\":\"interface PithyBabelPluginOptions\"} */\nexport interface PithyBabelPluginOptions {\n componentScopes?: ComponentScopesMap;\n /** Enable AOT template compilation. Default: false. */\n aot?: boolean;\n /** Fail the build if any template falls back to JIT, i.e. any `[pithy:aot:jit-fallback]` report. Default: false. */\n strictAot?: boolean;\n /** File path for deterministic scope ID generation (typically the Vite module id). */\n filename?: string;\n}\n\n/**\n * Generate a deterministic scope ID from a file path.\n * Uses base64url-safe encoding (only [A-Za-z0-9_-]) since the ID is\n * interpolated into attribute names like data-scope-{id}.\n * Note: pithyPlugin uses raw base64 slicing — the two will diverge for\n * paths containing characters that produce +/= in base64.\n */\nfunction generateScopeId(filepath: string): string {\n const base64 = Buffer.from(filepath).toString('base64');\n // Convert to base64url-safe variant: only [A-Za-z0-9_-] allowed\n // (scopeId is interpolated into attribute names like data-scope-{id})\n const safe = base64\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=+$/, '');\n return 'pithy-' + safe.slice(0, 6);\n}\n\n/**\n * Babel plugin that transforms `html\\`...\\`` tagged template expressions.\n * In non-AOT mode, rewrites to `html(str, ctx)`. In AOT mode, pre-compiles\n * both the tagged form and `html(literal, context)` calls to a DOM factory\n * function eliminating runtime HTML parsing.\n * @param options - Plugin configuration (AOT mode, component scopes, filename)\n * @returns Babel plugin object\n */\n/** @codexApi {\"parent\":\"pithy.babel.html-context-plugin\",\"name\":\"pithyBabelPlugin\",\"stability\":\"stable\",\"signature\":\"(options?: PithyBabelPluginOptions) => PluginObj<PluginState>\"} */\nexport default function pithyBabelPlugin(\n options?: PithyBabelPluginOptions\n): PluginObj<PluginState> {\n const componentScopes = options?.componentScopes;\n const enableAot = options?.aot ?? false;\n const templateComponents = new Set(Object.keys(componentScopes ?? {}));\n let importedIdentifiers: Set<string>;\n\n // AOT state — accumulated per file, injected in Program.exit\n let aotFactoryBlocks: string[];\n let aotNeedsApplyBindings: boolean;\n let aotHashCounter: Map<string, number>;\n let aotDisabledByCollision: boolean;\n // Track html`` usage for dead import stripping\n let totalHtmlTagsFound: number;\n let totalHtmlTagsAotCompiled: number;\n // Local names of html imported from @pithyjs/core (handles aliased imports like `import { html as h }`)\n let pithyCoreHtmlLocalNames: Set<string>;\n // Set of local names of html imported from non-@pithyjs/core packages (e.g., lit)\n let foreignHtmlLocalNames: Set<string>;\n let rewrittenCalls: WeakSet<t.Node>;\n\n return {\n name: 'pithy:html-context-inject',\n\n pre() {\n importedIdentifiers = new Set<string>();\n aotFactoryBlocks = [];\n aotNeedsApplyBindings = false;\n aotHashCounter = new Map();\n aotDisabledByCollision = false;\n totalHtmlTagsFound = 0;\n totalHtmlTagsAotCompiled = 0;\n pithyCoreHtmlLocalNames = new Set();\n foreignHtmlLocalNames = new Set();\n rewrittenCalls = new WeakSet();\n },\n\n visitor: {\n Program: {\n enter(path, _state) {\n for (const node of path.node.body) {\n if (t.isImportDeclaration(node) && node.importKind !== 'type') {\n for (const spec of node.specifiers) {\n // Skip type-only specifiers — they don't exist at runtime\n if (t.isImportSpecifier(spec) && spec.importKind === 'type')\n continue;\n if (\n t.isImportSpecifier(spec) ||\n t.isImportDefaultSpecifier(spec) ||\n t.isImportNamespaceSpecifier(spec)\n ) {\n importedIdentifiers.add(spec.local.name);\n }\n // Detect html imports and track their source package\n if (\n t.isImportSpecifier(spec) &&\n spec.importKind !== 'type' &&\n t.isIdentifier(spec.imported) &&\n spec.imported.name === 'html'\n ) {\n if (node.source.value === '@pithyjs/core') {\n pithyCoreHtmlLocalNames.add(spec.local.name);\n } else {\n foreignHtmlLocalNames.add(spec.local.name);\n }\n }\n }\n }\n }\n\n // Check for __applyBindings binding collision early — if a user-defined\n // binding exists, AOT factories would reference the wrong symbol.\n if (enableAot && path.scope.hasBinding('__applyBindings')) {\n aotDisabledByCollision = true;\n console.warn(\n `[pithy:aot] Disabling AOT — existing binding \"__applyBindings\" ` +\n `would shadow the runtime import.`\n );\n }\n },\n\n exit(path) {\n if (aotFactoryBlocks.length === 0) return;\n\n // 1. Add __applyBindings import (only if needed)\n if (aotNeedsApplyBindings) {\n const hasImport = path.node.body.some(\n stmt =>\n t.isImportDeclaration(stmt) &&\n stmt.importKind !== 'type' &&\n stmt.source.value === '@pithyjs/core/runtime/applyBindings' &&\n stmt.specifiers.some(\n s =>\n t.isImportSpecifier(s) &&\n s.importKind !== 'type' &&\n t.isIdentifier(s.local) &&\n s.local.name === '__applyBindings'\n )\n );\n\n if (!hasImport) {\n const importDecl = t.importDeclaration(\n [\n t.importSpecifier(\n t.identifier('__applyBindings'),\n t.identifier('__applyBindings')\n ),\n ],\n t.stringLiteral('@pithyjs/core/runtime/applyBindings')\n );\n // Insert after directive prologues and existing imports.\n // Two-phase scan: first skip all consecutive directives, then all imports.\n let importInsertIndex = 0;\n const body = path.node.body;\n while (\n importInsertIndex < body.length &&\n t.isExpressionStatement(body[importInsertIndex]) &&\n t.isStringLiteral(\n (body[importInsertIndex] as t.ExpressionStatement).expression\n )\n ) {\n importInsertIndex++;\n }\n while (\n importInsertIndex < body.length &&\n t.isImportDeclaration(body[importInsertIndex])\n ) {\n importInsertIndex++;\n }\n path.node.body.splice(importInsertIndex, 0, importDecl);\n }\n }\n\n // 2. Parse factory code blocks into AST and inject after last import\n const statementsToInject: t.Program['body'] = [];\n\n for (const block of aotFactoryBlocks) {\n const ast = babelParse(block, {\n sourceType: 'module',\n plugins: [],\n });\n if (ast.program?.body) {\n statementsToInject.push(...ast.program.body);\n }\n }\n\n if (statementsToInject.length === 0) return;\n\n // Find insertion point: after directive prologues and import declarations.\n // Two-phase scan: first skip all consecutive directives, then all imports.\n let insertIndex = 0;\n const bodyForFactory = path.node.body;\n while (\n insertIndex < bodyForFactory.length &&\n t.isExpressionStatement(bodyForFactory[insertIndex]) &&\n t.isStringLiteral(\n (bodyForFactory[insertIndex] as t.ExpressionStatement).expression\n )\n ) {\n insertIndex++;\n }\n while (\n insertIndex < bodyForFactory.length &&\n t.isImportDeclaration(bodyForFactory[insertIndex])\n ) {\n insertIndex++;\n }\n\n path.node.body.splice(insertIndex, 0, ...statementsToInject);\n\n // 3. Strip unused `html` import when all html`` tags were AOT-compiled.\n // This enables Rollup to tree-shake html() → parseHtml → parse5 entirely.\n // Safety: use Babel binding analysis (scope.crawl + getBinding) to verify\n // the html identifier has no remaining references after AOT transforms.\n // This covers all non-tagged-template usages: html(), const t = html, etc.\n if (\n enableAot &&\n totalHtmlTagsFound > 0 &&\n totalHtmlTagsFound === totalHtmlTagsAotCompiled &&\n pithyCoreHtmlLocalNames.size > 0\n ) {\n // Re-crawl scope to get accurate reference counts after AOT transforms\n path.scope.crawl();\n const unreferenced = new Set(\n [...pithyCoreHtmlLocalNames].filter(\n name => !(path.scope.getBinding(name)?.references ?? 0)\n )\n );\n\n for (let i = path.node.body.length - 1; i >= 0; i--) {\n const stmt = path.node.body[i];\n if (!t.isImportDeclaration(stmt) || stmt.importKind === 'type')\n continue;\n\n // Only strip html from @pithyjs/core — never touch other packages (e.g., lit)\n if (stmt.source.value !== '@pithyjs/core') continue;\n\n const kept = stmt.specifiers.filter(\n s =>\n !(\n t.isImportSpecifier(s) &&\n s.importKind !== 'type' &&\n t.isIdentifier(s.imported) &&\n s.imported.name === 'html' &&\n unreferenced.has(s.local.name)\n )\n );\n if (kept.length === stmt.specifiers.length) continue;\n stmt.specifiers = kept;\n // If no specifiers remain, remove the entire import declaration\n if (kept.length === 0) {\n path.node.body.splice(i, 1);\n }\n }\n }\n },\n },\n\n TaggedTemplateExpression(path) {\n // Only transform html`` from @pithyjs/core — leave other packages' html (e.g., lit) untouched.\n // When we detected a @pithyjs/core html import, match its local name (handles aliases).\n // When no @pithyjs/core import was found, fall back to matching literal \"html\" (bare usage),\n // but skip if \"html\" is known to come from a foreign package.\n const tagName = t.isIdentifier(path.node.tag)\n ? path.node.tag.name\n : null;\n if (!tagName) return;\n if (foreignHtmlLocalNames.has(tagName)) return;\n if (\n pithyCoreHtmlLocalNames.size > 0\n ? !pithyCoreHtmlLocalNames.has(tagName)\n : tagName !== 'html'\n )\n return;\n\n totalHtmlTagsFound++;\n\n const quasi = path.node.quasi;\n const templateStr = quasi.quasis\n .map(q => q.value.cooked ?? q.value.raw)\n .join('');\n\n // Warn about lowercase component tags used for imported components\n if (importedIdentifiers.size > 0) {\n warnOnLowercaseComponentTags(templateStr, importedIdentifiers);\n }\n\n const trees = parseComponentTemplate(templateStr, importedIdentifiers);\n if (trees.length === 0) return;\n\n const contextObject = buildContextObject(\n path,\n trees,\n templateStr,\n quasi.expressions.length === 0\n );\n\n // ── AOT codegen path ──────────────────────────────────────────────\n if (enableAot && !aotDisabledByCollision) {\n // Templates with ${expr} expressions can't be AOT-compiled safely.\n // PithyJS uses {{ expr }} syntax, not ${}, so this is an edge case guard.\n if (quasi.expressions.length > 0) {\n // Fall through to non-AOT path below\n reportJitFallback(\n path,\n `Template contains \\${expr} expressions — skipping AOT. ` +\n `Refactor to {{ expr }} syntax for AOT compilation.`\n );\n } else if (emitFactory(path, trees, templateStr, contextObject)) {\n return;\n }\n }\n\n // ── Non-AOT path (original behavior) ─────────────────────────────\n const runtimeCall = t.callExpression(path.node.tag, [\n quasi,\n contextObject,\n ]);\n rewrittenCalls.add(runtimeCall);\n path.replaceWith(runtimeCall);\n },\n\n CallExpression(path) {\n if (!enableAot || aotDisabledByCollision) return;\n if (rewrittenCalls.has(path.node)) return;\n const callee = path.node.callee;\n if (\n !t.isIdentifier(callee) ||\n !pithyCoreHtmlLocalNames.has(callee.name)\n )\n return;\n if (path.scope.getBinding(callee.name)?.kind !== 'module') return;\n\n totalHtmlTagsFound++;\n\n const [templateArg, contextArg, cssArg] = path.node.arguments;\n const templateStr = t.isStringLiteral(templateArg)\n ? templateArg.value\n : t.isTemplateLiteral(templateArg) &&\n templateArg.expressions.length === 0\n ? templateArg.quasis\n .map(q => q.value.cooked ?? q.value.raw)\n .join('')\n : null;\n\n if (templateStr === null) {\n reportJitFallback(\n path,\n `html() is called with a template that is not a string literal — skipping AOT. ` +\n `Pass the template as a literal.`\n );\n return;\n }\n\n if (cssArg !== undefined && !isAbsentCss(cssArg)) {\n reportJitFallback(\n path,\n `html() is called with a css argument — skipping AOT.`\n );\n return;\n }\n\n const context = contextLiteral(path, contextArg);\n if (contextArg && !context) {\n reportJitFallback(\n path,\n `html() is called with a second argument that is not an object literal, so it may be a css string or a context the build cannot read — skipping AOT. ` +\n `Pass the context as an object literal, inline or bound by const.`\n );\n return;\n }\n\n const componentNames = declaredComponents(context);\n\n try {\n warnOnLowercaseComponentTags(templateStr, componentNames);\n } catch (err) {\n reportJitFallback(\n path,\n `html() template has a tag that cannot be resolved to a component at build time — skipping AOT. ` +\n `Name the component in a literal \\`__importedIdentifiers: new Set([...])\\` in the context. ` +\n (err instanceof Error ? err.message : String(err))\n );\n return;\n }\n\n emitFactory(\n path,\n parseComponentTemplate(templateStr, componentNames),\n templateStr,\n t.isExpression(contextArg) ? contextArg : t.objectExpression([])\n );\n },\n },\n };\n\n function unwrapTs(node: t.Node | null | undefined): t.Node | null {\n let current = node ?? null;\n while (\n t.isTSAsExpression(current) ||\n t.isTSSatisfiesExpression(current) ||\n t.isTSTypeAssertion(current) ||\n t.isTSNonNullExpression(current) ||\n t.isParenthesizedExpression(current)\n ) {\n current = current.expression;\n }\n return current;\n }\n\n function isAbsentCss(cssArg: t.Node): boolean {\n const css = unwrapTs(cssArg);\n return (\n t.isIdentifier(css, { name: 'undefined' }) ||\n t.isNullLiteral(css) ||\n t.isStringLiteral(css, { value: '' }) ||\n t.isUnaryExpression(css, { operator: 'void' })\n );\n }\n\n function contextLiteral(\n path: NodePath,\n contextArg: t.Node | undefined\n ): t.ObjectExpression | null {\n const arg = unwrapTs(contextArg);\n if (t.isObjectExpression(arg)) return arg;\n if (!t.isIdentifier(arg)) return null;\n const binding = path.scope.getBinding(arg.name);\n if (binding?.kind !== 'const' || !binding.path.isVariableDeclarator())\n return null;\n if (!t.isIdentifier(binding.path.node.id)) return null;\n const init = unwrapTs(binding.path.node.init);\n return t.isObjectExpression(init) ? init : null;\n }\n\n function declaredComponents(literal: t.ObjectExpression | null): Set<string> {\n const names = new Set<string>();\n if (!literal) return names;\n for (const prop of literal.properties) {\n if (t.isSpreadElement(prop)) {\n names.clear();\n continue;\n }\n if (prop.computed) continue;\n const key = t.isIdentifier(prop.key)\n ? prop.key.name\n : t.isStringLiteral(prop.key)\n ? prop.key.value\n : null;\n if (key !== '__importedIdentifiers') continue;\n names.clear();\n if (!t.isObjectProperty(prop)) continue;\n const value = unwrapTs(prop.value);\n if (\n !t.isNewExpression(value) ||\n !t.isIdentifier(value.callee, { name: 'Set' })\n )\n continue;\n const list = unwrapTs(value.arguments[0]);\n if (!t.isArrayExpression(list)) continue;\n for (const element of list.elements) {\n if (t.isStringLiteral(element)) names.add(element.value);\n }\n }\n return names;\n }\n\n function parseComponentTemplate(\n templateStr: string,\n componentNames: Set<string>\n ): PithyNode[] {\n // `importedIdentifiers` is what makes component tags components at all;\n // `withSource: false` keeps interpolation scanning on parse5's decoded\n // text, because codegen locates interpolations with indexOf(interp.raw)\n // against decoded textContent and a raw source slice would carry entities.\n return parseTemplate(templateStr, parseFragment, {\n importedIdentifiers: componentNames,\n withSource: false,\n }).nodes;\n }\n\n function buildContextObject(\n path: NodePath,\n trees: PithyNode[],\n templateStr: string,\n reportComponentAttrs: boolean\n ): t.ObjectExpression {\n // Collect identifiers referenced by expressions in the template\n const usedIdentifiers = new Set<string>();\n const attrReports: ComponentAttrReport[] = [];\n for (const tree of trees) {\n const ids = extractUsedIdentifiers(tree, componentScopes, report =>\n attrReports.push(report)\n );\n ids.forEach(id => usedIdentifiers.add(id));\n }\n\n // Also collect arrow-function param names appearing in attribute expressions\n // so we can remove them from usedIdentifiers (e.g., \"(ev) => ...\" or \"ev => ...\").\n const arrowParams = extractArrowParamNames(templateStr);\n\n for (const report of attrReports) {\n if (reportComponentAttrs) {\n warnOnStringLikeComponentAttr(path, report);\n } else if (!report.parsed) {\n console.warn(\n '[pithy] Failed to parse expression:',\n report.value,\n report.error\n );\n }\n }\n\n // Compute which imported identifiers are actually used as components\n const usedComponents = new Set<string>();\n const collectComponents = (node: PithyNode) => {\n if (node.type === 'element' && node.isComponent && node.originalTagName) {\n usedComponents.add(node.originalTagName);\n }\n for (const child of node.children ?? []) collectComponents(child);\n };\n for (const tree of trees) collectComponents(tree);\n\n // Final filter:\n // - drop arrow params (local to inline handlers)\n // - drop common event aliases ($event, event, ev, e, evt)\n const filteredUsed = [...usedIdentifiers].filter(\n id => !arrowParams.has(id) && !RESERVED_LOCAL_EVENT_NAMES.has(id)\n );\n\n return t.objectExpression([\n // Only hoist filtered used identifiers\n ...filteredUsed.map(id =>\n t.objectProperty(t.identifier(id), t.identifier(id), false, true)\n ),\n // Add only the components that are actually used in the template\n ...[...usedComponents].map(id =>\n t.objectProperty(t.identifier(id), t.identifier(id), false, true)\n ),\n // Add imported identifiers as a special property for downstream checks\n t.objectProperty(\n t.identifier('__importedIdentifiers'),\n t.newExpression(t.identifier('Set'), [\n t.arrayExpression(\n [...importedIdentifiers].map(id => t.stringLiteral(id))\n ),\n ])\n ),\n ]);\n }\n\n function warnOnStringLikeComponentAttr(\n path: NodePath,\n { tag, attr, value, names, parsed, expression, error }: ComponentAttrReport\n ): void {\n let outcome = `does not parse (Failed to parse expression: ${error}), so the attribute is dropped`;\n if (parsed) {\n const collected = new Set(names);\n const tsNames = declaredTsValueNames(path);\n const candidates = expression ? stringLikeNames(expression) : null;\n const unbound = [...new Set(candidates ?? [])].filter(\n name =>\n collected.has(name) &&\n !path.scope.hasBinding(name) &&\n !tsNames.has(name)\n );\n if (unbound.length === 0) return;\n outcome = `reads ${unbound.map(n => `\\`${n}\\``).join(', ')}, which ${unbound.length === 1 ? 'has' : 'have'} no binding in this module, so it throws or reads a browser global at runtime`;\n }\n\n let advice = '';\n if (value.includes('{{')) {\n advice =\n ' `{{ }}` is not interpolated in a component attribute: write the expression itself, without the braces.';\n } else if (parsed || !/[()[\\]{};=]/.test(value)) {\n advice = ` To pass a string, quote it: ${attr}=\"${quoteForTemplateSource(value)}\".`;\n }\n\n const file =\n options?.filename ??\n (path.hub as { file?: { opts?: { filename?: string } } })?.file?.opts\n ?.filename;\n const loc = path.node.loc?.start;\n const where = file\n ? ` (${file}${loc ? `:${loc.line}:${loc.column + 1}` : ''})`\n : '';\n console.warn(\n `[pithy] <${tag} ${attr}=\"${value}\">: a component attribute is a JavaScript expression, and this one ${outcome}.${advice}${where}`\n );\n }\n\n function reportJitFallback(path: NodePath, reason: string): void {\n const where = options?.filename ? ` (${options.filename})` : '';\n if (options?.strictAot) {\n throw path.buildCodeFrameError(\n `[pithy:aot:jit-fallback] ${reason}${where}`\n );\n }\n console.warn(\n `[pithy:aot:jit-fallback] ${reason} ` +\n `The template will throw at runtime unless the app calls loadJITCompiler() at startup.${where}`\n );\n }\n\n function emitFactory(\n path: NodePath,\n trees: PithyNode[],\n templateStr: string,\n context: t.Expression\n ): boolean {\n try {\n // Generate deterministic hash from template content\n const rawHash = createHash('sha256')\n .update(templateStr)\n .digest('hex')\n .slice(0, 8);\n const count = aotHashCounter.get(rawHash) ?? 0;\n const hash = count > 0 ? `${rawHash}_${count}` : rawHash;\n\n // Generate scope ID from filename (or fall back to hash)\n const filename =\n options?.filename ??\n (path.hub as { file?: { opts?: { filename?: string } } })?.file?.opts\n ?.filename ??\n '';\n const scopeId = filename\n ? generateScopeId(filename)\n : `pithy-${rawHash.slice(0, 6)}`;\n\n // Call AOT codegen\n const aotResult = generateDomFactory(trees, hash, scopeId, {\n templateComponents,\n });\n\n // Only increment counter after successful codegen — if codegen\n // throws, the hash slot stays available for the next attempt.\n aotHashCounter.set(rawHash, count + 1);\n\n // Accumulate factory code for Program.exit injection\n aotFactoryBlocks.push(aotResult.code);\n // Detect actual applyBindings call sites rather than any occurrence of the\n // identifier name. This avoids false positives from template text that may\n // contain the string \"__applyBindings\" inside HTML or attribute values.\n if (aotResult.code.includes('return __applyBindings(')) {\n aotNeedsApplyBindings = true;\n }\n\n totalHtmlTagsAotCompiled++;\n\n path.replaceWith(\n t.callExpression(t.identifier(aotResult.factoryName), [context])\n );\n return true;\n } catch (err) {\n reportJitFallback(\n path,\n `Codegen failed — skipping AOT. ` +\n (err instanceof Error ? err.message : String(err))\n );\n return false;\n }\n }\n}\n"]}
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
16
|
+
import * as t from '@babel/types';
|
|
17
|
+
import { PithyNode } from '@pithyjs/compiler';
|
|
17
18
|
/** Richer config: default scope vars + optional attribute-based aliases */
|
|
18
19
|
export type ComponentScopeConfig = {
|
|
19
20
|
vars: string[];
|
|
@@ -21,6 +22,15 @@ export type ComponentScopeConfig = {
|
|
|
21
22
|
};
|
|
22
23
|
/** Map of component names to the variables they inject into children's scope */
|
|
23
24
|
export type ComponentScopesMap = Record<string, ComponentScopeConfig>;
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
export type ComponentAttrReport = {
|
|
26
|
+
tag: string;
|
|
27
|
+
attr: string;
|
|
28
|
+
value: string;
|
|
29
|
+
names: string[];
|
|
30
|
+
parsed: boolean;
|
|
31
|
+
expression: t.Expression | null;
|
|
32
|
+
error?: string;
|
|
33
|
+
};
|
|
34
|
+
/** @codexApi {"parent":"pithy.babel.identifier-extractor","name":"extractUsedIdentifiers","stability":"stable","signature":"(root: PithyNode, componentScopes?: ComponentScopesMap, onComponentAttr?: (report: ComponentAttrReport) => void) => Set<string>"} */
|
|
35
|
+
export declare function extractUsedIdentifiers(root: PithyNode, componentScopes?: ComponentScopesMap, onComponentAttr?: (report: ComponentAttrReport) => void): Set<string>;
|
|
26
36
|
//# sourceMappingURL=extractUsedIdentifiers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractUsedIdentifiers.d.ts","sourceRoot":"","sources":["../../src/babelPlugin/extractUsedIdentifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;
|
|
1
|
+
{"version":3,"file":"extractUsedIdentifiers.d.ts","sourceRoot":"","sources":["../../src/babelPlugin/extractUsedIdentifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAGF,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,2EAA2E;AAC3E,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAEtE,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,iQAAiQ;AACjQ,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,SAAS,EACf,eAAe,CAAC,EAAE,kBAAkB,EACpC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,GACtD,GAAG,CAAC,MAAM,CAAC,CAiTb"}
|