@memoized-dom/compiler 0.0.1

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.
Files changed (135) hide show
  1. package/README.md +28 -0
  2. package/dist/analysis/access-table.d.ts +5 -0
  3. package/dist/analysis/access-table.d.ts.map +1 -0
  4. package/dist/analysis/component-graph.d.ts +10 -0
  5. package/dist/analysis/component-graph.d.ts.map +1 -0
  6. package/dist/analysis/component-reads.d.ts +10 -0
  7. package/dist/analysis/component-reads.d.ts.map +1 -0
  8. package/dist/analysis/computed.d.ts +11 -0
  9. package/dist/analysis/computed.d.ts.map +1 -0
  10. package/dist/analysis/instance-control-flow.d.ts +9 -0
  11. package/dist/analysis/instance-control-flow.d.ts.map +1 -0
  12. package/dist/analysis/instance.d.ts +9 -0
  13. package/dist/analysis/instance.d.ts.map +1 -0
  14. package/dist/analysis/runtime-pattern.d.ts +9 -0
  15. package/dist/analysis/runtime-pattern.d.ts.map +1 -0
  16. package/dist/analysis/slot-paths.d.ts +11 -0
  17. package/dist/analysis/slot-paths.d.ts.map +1 -0
  18. package/dist/analysis/type-candidates.d.ts +14 -0
  19. package/dist/analysis/type-candidates.d.ts.map +1 -0
  20. package/dist/analysis.d.ts +52 -0
  21. package/dist/analysis.d.ts.map +1 -0
  22. package/dist/compile.d.ts +17 -0
  23. package/dist/compile.d.ts.map +1 -0
  24. package/dist/component-linker.d.ts +32 -0
  25. package/dist/component-linker.d.ts.map +1 -0
  26. package/dist/components/callback-props.d.ts +14 -0
  27. package/dist/components/callback-props.d.ts.map +1 -0
  28. package/dist/components/calls.d.ts +17 -0
  29. package/dist/components/calls.d.ts.map +1 -0
  30. package/dist/components/children.d.ts +43 -0
  31. package/dist/components/children.d.ts.map +1 -0
  32. package/dist/components/declarations.d.ts +16 -0
  33. package/dist/components/declarations.d.ts.map +1 -0
  34. package/dist/components/jsx-values.d.ts +7 -0
  35. package/dist/components/jsx-values.d.ts.map +1 -0
  36. package/dist/components/local-derived.d.ts +6 -0
  37. package/dist/components/local-derived.d.ts.map +1 -0
  38. package/dist/components/manifest.d.ts +31 -0
  39. package/dist/components/manifest.d.ts.map +1 -0
  40. package/dist/components/prop-effects.d.ts +11 -0
  41. package/dist/components/prop-effects.d.ts.map +1 -0
  42. package/dist/components/prop-linker.d.ts +8 -0
  43. package/dist/components/prop-linker.d.ts.map +1 -0
  44. package/dist/components/prop-origins.d.ts +17 -0
  45. package/dist/components/prop-origins.d.ts.map +1 -0
  46. package/dist/components/prop-projections.d.ts +5 -0
  47. package/dist/components/prop-projections.d.ts.map +1 -0
  48. package/dist/components/props.d.ts +73 -0
  49. package/dist/components/props.d.ts.map +1 -0
  50. package/dist/components/ref-props.d.ts +11 -0
  51. package/dist/components/ref-props.d.ts.map +1 -0
  52. package/dist/components/render-callbacks.d.ts +19 -0
  53. package/dist/components/render-callbacks.d.ts.map +1 -0
  54. package/dist/components/render-functions.d.ts +4 -0
  55. package/dist/components/render-functions.d.ts.map +1 -0
  56. package/dist/components/render-prelude.d.ts +13 -0
  57. package/dist/components/render-prelude.d.ts.map +1 -0
  58. package/dist/components/return-plan.d.ts +27 -0
  59. package/dist/components/return-plan.d.ts.map +1 -0
  60. package/dist/conds.d.ts +21 -0
  61. package/dist/conds.d.ts.map +1 -0
  62. package/dist/context/ast.d.ts +51 -0
  63. package/dist/context/ast.d.ts.map +1 -0
  64. package/dist/context/model.d.ts +309 -0
  65. package/dist/context/model.d.ts.map +1 -0
  66. package/dist/context.d.ts +9 -0
  67. package/dist/context.d.ts.map +1 -0
  68. package/dist/effects.d.ts +26 -0
  69. package/dist/effects.d.ts.map +1 -0
  70. package/dist/emission/component.d.ts +12 -0
  71. package/dist/emission/component.d.ts.map +1 -0
  72. package/dist/emission/conditional-region.d.ts +13 -0
  73. package/dist/emission/conditional-region.d.ts.map +1 -0
  74. package/dist/emission/dom-template.d.ts +11 -0
  75. package/dist/emission/dom-template.d.ts.map +1 -0
  76. package/dist/emission/list-region.d.ts +10 -0
  77. package/dist/emission/list-region.d.ts.map +1 -0
  78. package/dist/emission/node-emitter.d.ts +8 -0
  79. package/dist/emission/node-emitter.d.ts.map +1 -0
  80. package/dist/emission/render-callback.d.ts +14 -0
  81. package/dist/emission/render-callback.d.ts.map +1 -0
  82. package/dist/emission/scope.d.ts +47 -0
  83. package/dist/emission/scope.d.ts.map +1 -0
  84. package/dist/emit.d.ts +29 -0
  85. package/dist/emit.d.ts.map +1 -0
  86. package/dist/handler-commits.d.ts +30 -0
  87. package/dist/handler-commits.d.ts.map +1 -0
  88. package/dist/handler-origin.d.ts +13 -0
  89. package/dist/handler-origin.d.ts.map +1 -0
  90. package/dist/handlers/analyze.d.ts +4 -0
  91. package/dist/handlers/analyze.d.ts.map +1 -0
  92. package/dist/handlers/local-calls.d.ts +11 -0
  93. package/dist/handlers/local-calls.d.ts.map +1 -0
  94. package/dist/handlers.d.ts +40 -0
  95. package/dist/handlers.d.ts.map +1 -0
  96. package/dist/helper-summaries.d.ts +12 -0
  97. package/dist/helper-summaries.d.ts.map +1 -0
  98. package/dist/identifiers.d.ts +29 -0
  99. package/dist/identifiers.d.ts.map +1 -0
  100. package/dist/index.d.ts +4 -0
  101. package/dist/index.d.ts.map +1 -0
  102. package/dist/index.js +1 -0
  103. package/dist/jsx/attributes.d.ts +24 -0
  104. package/dist/jsx/attributes.d.ts.map +1 -0
  105. package/dist/jsx/children.d.ts +32 -0
  106. package/dist/jsx/children.d.ts.map +1 -0
  107. package/dist/jsx/dom-attributes.d.ts +13 -0
  108. package/dist/jsx/dom-attributes.d.ts.map +1 -0
  109. package/dist/jsx/dynamic-tags.d.ts +20 -0
  110. package/dist/jsx/dynamic-tags.d.ts.map +1 -0
  111. package/dist/jsx/events.d.ts +4 -0
  112. package/dist/jsx/events.d.ts.map +1 -0
  113. package/dist/jsx/refs.d.ts +15 -0
  114. package/dist/jsx/refs.d.ts.map +1 -0
  115. package/dist/jsx/svg.d.ts +11 -0
  116. package/dist/jsx/svg.d.ts.map +1 -0
  117. package/dist/lifecycle.d.ts +31 -0
  118. package/dist/lifecycle.d.ts.map +1 -0
  119. package/dist/linker.d.ts +19 -0
  120. package/dist/linker.d.ts.map +1 -0
  121. package/dist/lists/calculated-sources.d.ts +8 -0
  122. package/dist/lists/calculated-sources.d.ts.map +1 -0
  123. package/dist/lists/map-site.d.ts +50 -0
  124. package/dist/lists/map-site.d.ts.map +1 -0
  125. package/dist/lists/source-shapes.d.ts +6 -0
  126. package/dist/lists/source-shapes.d.ts.map +1 -0
  127. package/dist/lists.d.ts +7 -0
  128. package/dist/lists.d.ts.map +1 -0
  129. package/dist/module-control-flow.d.ts +8 -0
  130. package/dist/module-control-flow.d.ts.map +1 -0
  131. package/dist/mutation-analysis.d.ts +42 -0
  132. package/dist/mutation-analysis.d.ts.map +1 -0
  133. package/dist/plugin.d.ts +27 -0
  134. package/dist/plugin.d.ts.map +1 -0
  135. package/package.json +30 -0
@@ -0,0 +1,8 @@
1
+ import type { NodePath } from '@babel/traverse';
2
+ import type * as t from '@babel/types';
3
+ import type { Ctx, RowCtx } from '../context';
4
+ import type { JsxNode } from '../jsx/children';
5
+ import type { EmitScope } from './scope';
6
+ /** Shared callback shape used by structural-region emitters. */
7
+ export type NodeEmitter = (ctx: Ctx, scope: EmitScope, node: JsxNode, componentName: string, componentPath: NodePath<t.FunctionDeclaration>, nestedIn?: 'row' | 'cond' | null, rowContext?: RowCtx, eventOriginId?: t.Expression, inSvg?: boolean, ownerId?: t.Expression) => string;
8
+ //# sourceMappingURL=node-emitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-emitter.d.ts","sourceRoot":"","sources":["../../src/emission/node-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,KAAK,CAAC,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,gEAAgE;AAChE,MAAM,MAAM,WAAW,GAAG,CACxB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,OAAO,EACb,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,EAC9C,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,EAChC,UAAU,CAAC,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,EAC5B,KAAK,CAAC,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,CAAC,CAAC,UAAU,KACnB,MAAM,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { NodePath } from '@babel/traverse';
2
+ import * as t from '@babel/types';
3
+ import { type Ctx } from '../context';
4
+ import { type EmitScope } from './scope';
5
+ import type { NodeEmitter } from './node-emitter';
6
+ /**
7
+ * Compile one caller-authored render callback into a row-factory adapter.
8
+ *
9
+ * The adapter is plain generated JavaScript, not a runtime JSX value. Its
10
+ * live row update closures remain indexed by the lexical caller so caller
11
+ * state can update rows mounted inside another component's list.
12
+ */
13
+ export declare function buildRenderCallbackAdapter(ctx: Ctx, ownerScope: EmitScope, source: t.Expression, componentName: string, componentPath: NodePath<t.FunctionDeclaration>, emitNode: NodeEmitter, inSvg: boolean, ownerId: t.Expression): t.Identifier;
14
+ //# sourceMappingURL=render-callback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-callback.d.ts","sourceRoot":"","sources":["../../src/emission/render-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAGL,KAAK,GAAG,EAET,MAAM,YAAY,CAAC;AAEpB,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAkBlD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,SAAS,EACrB,MAAM,EAAE,CAAC,CAAC,UAAU,EACpB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,EAC9C,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,CAAC,CAAC,UAAU,GACpB,CAAC,CAAC,UAAU,CAiPd"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * emission/scope.ts - generated bindings and statements shared by emitters.
3
+ *
4
+ * Owns per-factory slots, updater declarations, guarded writes, and entity
5
+ * registration so emit.ts can focus on component and JSX structure.
6
+ */
7
+ import * as t from '@babel/types';
8
+ import type { Ctx } from '../context';
9
+ export interface EmitScope {
10
+ slots: string[];
11
+ tempVar: string;
12
+ updateVar: string;
13
+ /** Optional dependency reasons accepted by the owner updater. */
14
+ reasonVar: string | null;
15
+ /** Caller-owned root used for repeated-row delegated host events. */
16
+ delegatedEventRootVar: string | null;
17
+ creation: t.Statement[];
18
+ /** Lifecycle setup that runs only after this scope's full DOM is created. */
19
+ mounts: t.Statement[];
20
+ updaters: Array<() => t.Statement>;
21
+ tagCounters: Map<string, number>;
22
+ childCounts: Map<string, number>;
23
+ usedPrefixes: Map<string, number>;
24
+ usedConds: {
25
+ count: number;
26
+ };
27
+ textCounter: number;
28
+ regionCounter: number;
29
+ /** Structural regions whose retained entries drain with this scope. */
30
+ disposableRegions: string[];
31
+ /** Component entity ids created lexically inside this scope. */
32
+ disposableEntities: t.Expression[];
33
+ /** Lazy content-slot mounts disposed when this structural scope swaps. */
34
+ disposableCallbacks: t.Identifier[];
35
+ /** Source-order identity for forwarded slot mounts in this scope. */
36
+ forwardedSlotCounter: number;
37
+ /** Branch/slot scopes drain callbacks directly instead of by entity owner. */
38
+ manualDisposal: boolean;
39
+ }
40
+ export declare function newEmitScope(ctx: Ctx, manualDisposal?: boolean): EmitScope;
41
+ export declare function cacheDecl(scope: EmitScope): t.Statement;
42
+ export declare function freshSlot(ctx: Ctx, scope: EmitScope): string;
43
+ export declare function freshNodeName(ctx: Ctx, scope: EmitScope, tag: string): string;
44
+ export declare function slotGuard(scope: EmitScope, slot: string, expression: t.Expression, write: (value: t.Identifier) => t.Statement): t.Statement;
45
+ export declare function updateDecl(scope: EmitScope): t.Statement;
46
+ export declare function registerStmt(ctx: Ctx, id: t.Expression, parent: t.Expression, render: t.Expression): t.Statement;
47
+ //# sourceMappingURL=scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/emission/scope.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGtC,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,qEAAqE;IACrE,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;IACxB,6EAA6E;IAC7E,MAAM,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;IACnC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gEAAgE;IAChE,kBAAkB,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC;IACnC,0EAA0E;IAC1E,mBAAmB,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC;IACpC,qEAAqE;IACrE,oBAAoB,EAAE,MAAM,CAAC;IAC7B,8EAA8E;IAC9E,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,cAAc,UAAQ,GAAG,SAAS,CAsBxE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,CAAC,CAAC,SAAS,CAKvD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAI5D;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAIR;AAED,wBAAgB,SAAS,CACvB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,CAAC,CAAC,UAAU,EACxB,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,SAAS,GAC1C,CAAC,CAAC,SAAS,CAcb;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,CAAC,CAAC,SAAS,CAiBxD;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,CAAC,CAAC,UAAU,EAChB,MAAM,EAAE,CAAC,CAAC,UAAU,EACpB,MAAM,EAAE,CAAC,CAAC,UAAU,GACnB,CAAC,CAAC,SAAS,CAUb"}
package/dist/emit.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * emit.ts - JSX DOM nodes and structural-region emission.
3
+ *
4
+ * R2 JSX → creation branch with cached node variables (post-order)
5
+ * R3 dynamic expressions → numbered slots with guarded setters
6
+ * R4 creation runs the same guarded setters (null cache → first write)
7
+ * R7 {items.map(item => …)} → createListRegion + row factories
8
+ *
9
+ * Component factory ABI and registration live in emission/component.ts.
10
+ * Emission state is explicit (EmitScope) rather than closure-local so that
11
+ * inline list rows can emit into a NESTED scope: an inline row is a small
12
+ * entity factory of its own (own slots, own update, register parent=id),
13
+ * created per item by the region.
14
+ */
15
+ import type { NodePath } from '@babel/traverse';
16
+ import * as t from '@babel/types';
17
+ import { type Ctx, type RowCtx } from './context';
18
+ import { type EmitScope } from './emission/scope';
19
+ import { type JsxNode } from './jsx/children';
20
+ export declare function emitNode(ctx: Ctx, scope: EmitScope, node: JsxNode, compName: string, compPath: NodePath<t.FunctionDeclaration>, nestedIn?: 'row' | 'cond' | null, rowCtx?: RowCtx, eventOriginId?: t.Expression, inSvg?: boolean, ownerId?: t.Expression): string;
21
+ /**
22
+ * A branch is a small factory: own slot cache, own guarded update closure,
23
+ * NO register (branches are not entities — a swap just removes their nodes).
24
+ * Emitted into a fresh EmitScope so variables and slots never collide.
25
+ */
26
+ export declare function buildBranchCreate(ctx: Ctx, jsx: JsxNode, compName: string, compPath: NodePath<t.FunctionDeclaration>, regionId: t.Expression, inSvg?: boolean, ownerId?: t.Expression, allowConditions?: boolean, usedConds?: {
27
+ count: number;
28
+ }): t.ArrowFunctionExpression;
29
+ //# sourceMappingURL=emit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../src/emit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAIL,KAAK,GAAG,EACR,KAAK,MAAM,EACZ,MAAM,WAAW,CAAC;AAMnB,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAC;AAc1B,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAC;AAkIxB,wBAAgB,QAAQ,CACtB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,EACzC,QAAQ,GAAE,KAAK,GAAG,MAAM,GAAG,IAAW,EACtC,MAAM,CAAC,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,EAC5B,KAAK,UAAQ,EACb,OAAO,GAAE,CAAC,CAAC,UAAuC,GACjD,MAAM,CA0BR;AAm9BD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,EACzC,QAAQ,EAAE,CAAC,CAAC,UAAU,EACtB,KAAK,UAAQ,EACb,OAAO,GAAE,CAAC,CAAC,UAAqB,EAChC,eAAe,UAAQ,EACvB,SAAS,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5B,CAAC,CAAC,uBAAuB,CAa3B"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * handler-commits.ts - write-scope commit construction and insertion.
3
+ *
4
+ * Converts analyzed scope effects into local, routed, or unbounded
5
+ * invalidation statements and inserts them on every normal function exit.
6
+ */
7
+ import * as t from '@babel/types';
8
+ import { type Ctx, type RowCtx } from './context';
9
+ export interface ScopeWrites {
10
+ writes: Set<string>;
11
+ rootFallback: boolean;
12
+ /** This scope writes fields observed by one keyed row. */
13
+ rowLocal: boolean;
14
+ /** This scope may affect the instance-owned collection backing the row. */
15
+ rowOwnerLocal: boolean;
16
+ /** This scope writes state owned by one component instance. */
17
+ instanceLocal: boolean;
18
+ /** Exact instance or prop roots written by this scope. */
19
+ instanceWrites: Set<string>;
20
+ /** Scoped event fallback when a handler has no recognized write. */
21
+ eventOrigin: t.Statement | null;
22
+ }
23
+ export declare function createScopeWrites(): ScopeWrites;
24
+ /** Record an exact write to state owned by one component instance. */
25
+ export declare function recordInstanceWrite(scope: ScopeWrites, source: string): void;
26
+ /** Build the static commit form for one analyzed function scope. */
27
+ export declare function buildScopeCommit(ctx: Ctx, scope: ScopeWrites, compName: string | null, rowCtx?: RowCtx): t.Statement | null;
28
+ /** Insert a commit on every normal exit while preserving arrow return values. */
29
+ export declare function appendScopeCommit(ctx: Ctx, fn: t.ArrowFunctionExpression | t.FunctionExpression | t.FunctionDeclaration, commit: t.Statement): void;
30
+ //# sourceMappingURL=handler-commits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler-commits.d.ts","sourceRoot":"","sources":["../src/handler-commits.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAGL,KAAK,GAAG,EACR,KAAK,MAAM,EACZ,MAAM,WAAW,CAAC;AAOnB,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,aAAa,EAAE,OAAO,CAAC;IACvB,+DAA+D;IAC/D,aAAa,EAAE,OAAO,CAAC;IACvB,0DAA0D;IAC1D,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,oEAAoE;IACpE,WAAW,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;CACjC;AAED,wBAAgB,iBAAiB,IAAI,WAAW,CAU/C;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,GACb,IAAI,CAGN;AAED,oEAAoE;AACpE,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,CAAC,EAAE,MAAM,GACd,CAAC,CAAC,SAAS,GAAG,IAAI,CAyEpB;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,CAAC,CAAC,uBAAuB,GAAG,CAAC,CAAC,kBAAkB,GAAG,CAAC,CAAC,mBAAmB,EAC5E,MAAM,EAAE,CAAC,CAAC,SAAS,GAClB,IAAI,CAcN"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * handler-origin.ts - event-origin invalidation lowering.
3
+ *
4
+ * Produces the nearest entity refresh for write-free event handlers and wraps
5
+ * shared module handlers when their declaration cannot close over a site ID.
6
+ */
7
+ import * as t from '@babel/types';
8
+ import type { Ctx, RowCtx } from './context';
9
+ /** The nearest update unit from which an event-triggered render starts. */
10
+ export declare function buildEventOriginCommit(ctx: Ctx, compName: string | null, rowCtx?: RowCtx, eventOriginId?: t.Expression): t.Statement;
11
+ /** A shared module handler needs a closure over its call site's entity ID. */
12
+ export declare function wrapSharedHandlerWithOrigin(ctx: Ctx, handler: t.Expression, originCommit: t.Statement): t.ArrowFunctionExpression;
13
+ //# sourceMappingURL=handler-origin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler-origin.d.ts","sourceRoot":"","sources":["../src/handler-origin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAO7C,2EAA2E;AAC3E,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,CAAC,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,GAC3B,CAAC,CAAC,SAAS,CAgBb;AAED,8EAA8E;AAC9E,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,CAAC,CAAC,UAAU,EACrB,YAAY,EAAE,CAAC,CAAC,SAAS,GACxB,CAAC,CAAC,uBAAuB,CAgB3B"}
@@ -0,0 +1,4 @@
1
+ import * as t from '@babel/types';
2
+ import { type Ctx, type RowCtx } from '../context';
3
+ export declare function analyzeHandler(ctx: Ctx, rootFn: t.ArrowFunctionExpression | t.FunctionExpression | t.FunctionDeclaration, compName: string | null, rowCtx?: RowCtx, eventBoundary?: boolean, eventOriginId?: t.Expression, executionAwareRoot?: boolean): void;
4
+ //# sourceMappingURL=analyze.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/handlers/analyze.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAIL,KAAK,GAAG,EACR,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AAsEpB,wBAAgB,cAAc,CAC5B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,CAAC,CAAC,uBAAuB,GAAG,CAAC,CAAC,kBAAkB,GAAG,CAAC,CAAC,mBAAmB,EAChF,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,CAAC,EAAE,MAAM,EACf,aAAa,UAAQ,EACrB,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,EAC5B,kBAAkB,UAAQ,GACzB,IAAI,CAmwBN"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Direct-call classification for event handlers.
3
+ *
4
+ * A handler that only delegates to component-local helpers which already
5
+ * own a synchronous commit does not need a second event-origin invalidation.
6
+ * Calls inside nested callbacks are deliberately ignored: those callbacks
7
+ * have their own execution boundary and are instrumented separately.
8
+ */
9
+ import type { HandlerFn } from '../handlers';
10
+ export declare function callsOnlyCommittedLocalHelpers(root: HandlerFn, isCommittedHelper: (name: string) => boolean): boolean;
11
+ //# sourceMappingURL=local-calls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-calls.d.ts","sourceRoot":"","sources":["../../src/handlers/local-calls.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,SAAS,EACf,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAC3C,OAAO,CAoCT"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * handlers.ts — R5: event-handler write analysis and commit emission.
3
+ *
4
+ * Writes are grouped by their INNERMOST enclosing function scope, and each
5
+ * scope gets its own commit appended to its own body (M5.1):
6
+ * - handler body → commit at the end; async handlers commit in
7
+ * the continuation, after every `await`
8
+ * - fire-and-forget nested callback (setTimeout / .then / subscription)
9
+ * → commit at the end of THAT callback
10
+ *
11
+ * Commit form per scope:
12
+ * unbounded shared effect → markDirtySubtree(rootId)
13
+ * exact or receiver-bounded state effect → commitWrites(WRITES_n)
14
+ * component instance / keyed-row effect → direct local invalidation
15
+ *
16
+ * A method call on a reactive receiver is conservatively bounded to that
17
+ * receiver. The compiler does not maintain built-in method semantics:
18
+ * `items.push()` and `items.filter()` invalidate the same readers, whose
19
+ * memoized update guards absorb unchanged values.
20
+ */
21
+ import type { NodePath } from '@babel/traverse';
22
+ import * as t from '@babel/types';
23
+ import { type Ctx, type RowCtx } from './context';
24
+ export type HandlerFn = t.ArrowFunctionExpression | t.FunctionExpression | t.FunctionDeclaration;
25
+ /** Resolve a component-local helper declared directly in the factory body. */
26
+ export declare function resolveLocalHelper(compPath: NodePath<t.FunctionDeclaration>, name: string): HandlerFn | null;
27
+ /**
28
+ * Instrument a callback that executes outside the component's synchronous
29
+ * factory call. The callback owns its normal-exit commit; no event boundary
30
+ * or exception wrapper is introduced.
31
+ */
32
+ export declare function instrumentComponentCallback(ctx: Ctx, compPath: NodePath<t.FunctionDeclaration>, target: HandlerFn, compName: string, rowCtx?: RowCtx, executionAwareRoot?: boolean): void;
33
+ /** Instrument a module-owned callback through canonical access-table writes. */
34
+ export declare function instrumentSharedCallback(ctx: Ctx, target: HandlerFn, executionAwareRoot?: boolean): void;
35
+ /**
36
+ * Resolve a JSX handler attribute to an analyzable function, augmenting
37
+ * named `const` handlers in place. Returns the expression to assign.
38
+ */
39
+ export declare function buildHandler(ctx: Ctx, compPath: NodePath<t.FunctionDeclaration>, value: t.Expression, attrName: string, compName: string, rowCtx?: RowCtx, eventOriginId?: t.Expression): t.Expression;
40
+ //# sourceMappingURL=handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAGL,KAAK,GAAG,EACR,KAAK,MAAM,EACZ,MAAM,WAAW,CAAC;AAiBnB,MAAM,MAAM,SAAS,GACjB,CAAC,CAAC,uBAAuB,GACzB,CAAC,CAAC,kBAAkB,GACpB,CAAC,CAAC,mBAAmB,CAAC;AAE1B,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,EACzC,IAAI,EAAE,MAAM,GACX,SAAS,GAAG,IAAI,CAUlB;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,EACzC,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,kBAAkB,UAAQ,GACzB,IAAI,CAaN;AAED,gFAAgF;AAChF,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,SAAS,EACjB,kBAAkB,UAAQ,GACzB,IAAI,CAYN;AA8BD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,EACzC,KAAK,EAAE,CAAC,CAAC,UAAU,EACnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,GAC3B,CAAC,CAAC,UAAU,CA2Jd"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * helper-summaries.ts - interprocedural effects for module-local helpers.
3
+ *
4
+ * Summaries distinguish exact writes from effects conservatively bounded to
5
+ * a receiver. Parameter receiver effects are retained by argument position,
6
+ * so callers can map them back to their own state. Only effects with no
7
+ * finite receiver/argument boundary are unbounded.
8
+ */
9
+ import { type Ctx, type FnSummary } from './context';
10
+ /** Read/write summary of a module-level helper, memoized and cycle-safe. */
11
+ export declare function summarizeHelper(ctx: Ctx, name: string, visiting?: Set<string>): FnSummary;
12
+ //# sourceMappingURL=helper-summaries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper-summaries.d.ts","sourceRoot":"","sources":["../src/helper-summaries.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAEL,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,WAAW,CAAC;AAWnB,4EAA4E;AAC5E,wBAAgB,eAAe,CAC7B,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,GAAG,CAAC,MAAM,CAAa,GAChC,SAAS,CA2RX"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * identifiers.ts - compiler-wide lexical binding allocation.
3
+ *
4
+ * Every compiler-owned binding is reserved through one Babel Program scope.
5
+ * Source identifiers from descendant scopes are also reserved so generated
6
+ * outer bindings cannot be shadowed inside user callbacks.
7
+ */
8
+ import type { NodePath, Scope } from '@babel/traverse';
9
+ import * as t from '@babel/types';
10
+ export declare class GeneratedIdentifiers {
11
+ private readonly scope;
12
+ readonly runtimeId: string;
13
+ private readonly reserved;
14
+ private readonly componentIds;
15
+ constructor(scope: Scope, programPath: NodePath<t.Program>);
16
+ generate(hint: string): t.Identifier;
17
+ registerComponentId(component: string, id: string): void;
18
+ componentId(component: string): t.Identifier;
19
+ runtimeMember(name: string): t.MemberExpression;
20
+ }
21
+ export interface IdentifierOwner {
22
+ identifiers: GeneratedIdentifiers | null;
23
+ }
24
+ export declare function initializeGeneratedIdentifiers(owner: IdentifierOwner, programPath: NodePath<t.Program>): GeneratedIdentifiers;
25
+ export declare function generatedIdentifier(owner: IdentifierOwner, hint: string): t.Identifier;
26
+ export declare function componentId(owner: IdentifierOwner, component: string): t.Identifier;
27
+ export declare function md(owner: IdentifierOwner, name: string): t.MemberExpression;
28
+ export declare function requireIdentifiers(owner: IdentifierOwner): GeneratedIdentifiers;
29
+ //# sourceMappingURL=identifiers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identifiers.d.ts","sourceRoot":"","sources":["../src/identifiers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,qBAAa,oBAAoB;IAKnB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJlC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;gBAE7B,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;IAK3E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU;IASpC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAIxD,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU;IAQ5C,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,gBAAgB;CAMhD;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAC;CAC1C;AAED,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,eAAe,EACtB,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAC/B,oBAAoB,CAItB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,MAAM,GACX,CAAC,CAAC,UAAU,CAEd;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,eAAe,EACtB,SAAS,EAAE,MAAM,GAChB,CAAC,CAAC,UAAU,CAEd;AAED,wBAAgB,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,gBAAgB,CAE3E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,oBAAoB,CAK/E"}
@@ -0,0 +1,4 @@
1
+ /** Public compiler package entry. */
2
+ export { compile, type MemoDomOptions } from './compile';
3
+ export { compileModules, type CompileModulesOptions, } from './linker';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,GAC3B,MAAM,UAAU,CAAC"}