marko 6.4.4 → 6.4.6

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 (133) hide show
  1. package/dist/common/errors.d.ts +2 -1
  2. package/dist/common/helpers.d.ts +7 -7
  3. package/dist/debug/dom/catch.feat.js +3 -3
  4. package/dist/debug/dom/catch.feat.mjs +3 -3
  5. package/dist/debug/dom/controllable-input.feat.js +1 -1
  6. package/dist/debug/dom/controllable-input.feat.mjs +1 -1
  7. package/dist/debug/dom/controllable-open.feat.js +1 -1
  8. package/dist/debug/dom/controllable-open.feat.mjs +1 -1
  9. package/dist/debug/dom/controllable-select.feat.js +1 -1
  10. package/dist/debug/dom/controllable-select.feat.mjs +1 -1
  11. package/dist/debug/dom/controllable-textarea.feat.js +1 -1
  12. package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
  13. package/dist/debug/dom/controllable.feat.js +5 -5
  14. package/dist/debug/dom/controllable.feat.mjs +5 -5
  15. package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
  16. package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
  17. package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
  18. package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
  19. package/dist/debug/dom/lazy.feat.js +1 -1
  20. package/dist/debug/dom/lazy.feat.mjs +1 -1
  21. package/dist/debug/dom/placeholder.feat.js +1 -1
  22. package/dist/debug/dom/placeholder.feat.mjs +1 -1
  23. package/dist/debug/{dom-CUxvM4i9.js → dom-CNgQ6lj9.js} +52 -52
  24. package/dist/debug/{dom-BeY1nGUb.mjs → dom-o9jQjchF.mjs} +43 -43
  25. package/dist/debug/dom.js +4 -4
  26. package/dist/debug/dom.mjs +4 -4
  27. package/dist/debug/html.js +721 -654
  28. package/dist/debug/html.mjs +721 -654
  29. package/dist/dom/catch.feat.js +4 -4
  30. package/dist/dom/catch.feat.mjs +3 -3
  31. package/dist/dom/control-flow.d.ts +2 -2
  32. package/dist/dom/controllable-input.feat.js +2 -2
  33. package/dist/dom/controllable-input.feat.mjs +1 -1
  34. package/dist/dom/controllable-open.feat.js +2 -2
  35. package/dist/dom/controllable-open.feat.mjs +1 -1
  36. package/dist/dom/controllable-select.feat.js +2 -2
  37. package/dist/dom/controllable-select.feat.mjs +1 -1
  38. package/dist/dom/controllable-textarea.feat.js +2 -2
  39. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  40. package/dist/dom/controllable.d.ts +4 -4
  41. package/dist/dom/controllable.feat.js +2 -2
  42. package/dist/dom/controllable.feat.mjs +2 -2
  43. package/dist/dom/dom.d.ts +5 -5
  44. package/dist/dom/dynamic-tag-script.feat.js +2 -2
  45. package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
  46. package/dist/dom/dynamic-tag-var.feat.js +2 -2
  47. package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
  48. package/dist/dom/lazy.feat.js +1 -1
  49. package/dist/dom/lazy.feat.mjs +1 -1
  50. package/dist/dom/placeholder.feat.js +1 -1
  51. package/dist/dom/placeholder.feat.mjs +1 -1
  52. package/dist/dom/signals.d.ts +4 -1
  53. package/dist/{dom-Diu8MpmL.js → dom-60R4bRWD.js} +40 -40
  54. package/dist/{dom-DefWmvQB.mjs → dom-Ci2W4l1P.mjs} +33 -33
  55. package/dist/dom.js +6 -6
  56. package/dist/dom.mjs +4 -4
  57. package/dist/html/assets.d.ts +1 -1
  58. package/dist/html/compat.d.ts +2 -1
  59. package/dist/html/control-flow.d.ts +20 -0
  60. package/dist/html/serializer.d.ts +63 -16
  61. package/dist/html/writer.d.ts +47 -35
  62. package/dist/html.d.ts +2 -1
  63. package/dist/html.js +517 -466
  64. package/dist/html.mjs +517 -466
  65. package/dist/translator/core/for.d.ts +0 -4
  66. package/dist/translator/core/return.d.ts +0 -3
  67. package/dist/translator/core/style.d.ts +2 -2
  68. package/dist/translator/index.js +8104 -8108
  69. package/dist/translator/util/analyze-errors.d.ts +2 -1
  70. package/dist/translator/util/assert.d.ts +8 -1
  71. package/dist/translator/util/bindings.d.ts +13 -9
  72. package/dist/translator/util/body-to-text.d.ts +9 -0
  73. package/dist/translator/util/branch-tag.d.ts +10 -3
  74. package/dist/translator/util/build-string-expression.d.ts +4 -0
  75. package/dist/translator/util/content-derives.d.ts +7 -0
  76. package/dist/translator/util/entry-builder.d.ts +16 -5
  77. package/dist/translator/util/finalize-references.d.ts +3 -2
  78. package/dist/translator/util/generate-uid.d.ts +3 -2
  79. package/dist/translator/util/get-root.d.ts +3 -3
  80. package/dist/translator/util/get-tag-name.d.ts +1 -1
  81. package/dist/translator/util/known-tag.d.ts +10 -8
  82. package/dist/translator/util/module-read.d.ts +0 -3
  83. package/dist/translator/util/module-registrations.d.ts +44 -0
  84. package/dist/translator/util/nested-attribute-tags.d.ts +1 -1
  85. package/dist/translator/util/optional.d.ts +6 -1
  86. package/dist/translator/util/params-tree.d.ts +18 -0
  87. package/dist/translator/util/reasons.d.ts +10 -8
  88. package/dist/translator/util/references.d.ts +23 -28
  89. package/dist/translator/util/runtime.d.ts +0 -12
  90. package/dist/translator/util/scope-accessor.d.ts +0 -1
  91. package/dist/translator/util/scope-read.d.ts +3 -0
  92. package/dist/translator/util/section-renderer.d.ts +4 -0
  93. package/dist/translator/util/sections.d.ts +16 -16
  94. package/dist/translator/util/setup-work.d.ts +2 -1
  95. package/dist/translator/util/signals.d.ts +22 -11
  96. package/dist/translator/util/simplify-fn.d.ts +1 -0
  97. package/dist/translator/util/slots.d.ts +2 -2
  98. package/dist/translator/util/solve-reasons.d.ts +1 -3
  99. package/dist/translator/util/sources.d.ts +2 -1
  100. package/dist/translator/util/statement-tag.d.ts +2 -0
  101. package/dist/translator/util/static-text.d.ts +2 -1
  102. package/dist/translator/util/structure.d.ts +0 -10
  103. package/dist/translator/util/tag-facts.d.ts +8 -1
  104. package/dist/translator/util/tag-import.d.ts +20 -0
  105. package/dist/translator/util/tag-name-type.d.ts +9 -2
  106. package/dist/translator/util/to-only-or-block.d.ts +3 -0
  107. package/dist/translator/util/to-property-name.d.ts +2 -0
  108. package/dist/translator/util/translate-attrs.d.ts +7 -5
  109. package/dist/translator/util/translate-var.d.ts +2 -0
  110. package/dist/translator/util/traverse.d.ts +1 -2
  111. package/dist/translator/util/visitors.d.ts +4 -1
  112. package/dist/translator/util/with-previous-location.d.ts +1 -1
  113. package/dist/translator/util/write-guard.d.ts +6 -2
  114. package/dist/translator/util/writer.d.ts +1 -2
  115. package/dist/translator/visitors/export-declaration.d.ts +2 -3
  116. package/dist/translator/visitors/function.d.ts +0 -35
  117. package/dist/translator/visitors/import-declaration.d.ts +0 -16
  118. package/dist/translator/visitors/placeholder.d.ts +2 -1
  119. package/dist/translator/visitors/program/html.d.ts +0 -1
  120. package/dist/translator/visitors/program/index.d.ts +4 -5
  121. package/dist/translator/visitors/tag/custom-tag.d.ts +0 -14
  122. package/dist/translator/visitors/tag/native-tag.d.ts +3 -12
  123. package/package.json +4 -4
  124. package/dist/translator/util/binding-has-prop.d.ts +0 -8
  125. package/dist/translator/util/binding-prop-tree.d.ts +0 -18
  126. package/dist/translator/util/body-to-text-literal.d.ts +0 -9
  127. package/dist/translator/util/import-reference.d.ts +0 -3
  128. package/dist/translator/util/normalize-string-expression.d.ts +0 -4
  129. package/dist/translator/util/plugin-hooks.d.ts +0 -4
  130. package/dist/translator/util/resolve-relative-to-entry.d.ts +0 -2
  131. package/dist/translator/util/set-tag-derived-from.d.ts +0 -7
  132. package/dist/translator/util/to-first-expression-or-block.d.ts +0 -2
  133. package/dist/translator/util/to-first-statement-or-block.d.ts +0 -2
@@ -1,3 +1,4 @@
1
1
  import type { types as t } from "@marko/compiler";
2
+ declare const hasAnalyzeErrors: () => boolean;
3
+ export { hasAnalyzeErrors };
2
4
  export declare function reportAnalyzeError(path: t.NodePath<t.Node>, error: unknown): void;
3
- export declare function hasAnalyzeErrors(): boolean;
@@ -1,4 +1,11 @@
1
- import type { types as t } from "@marko/compiler";
1
+ import { types as t } from "@marko/compiler";
2
2
  export declare function assertNoSpreadAttrs(tag: t.NodePath<t.MarkoTag>): void;
3
+ export declare function assertOnlyValueAttr(tag: t.NodePath<t.MarkoTag>, required: true, change?: boolean, hint?: (attr: t.MarkoAttribute) => string | undefined): t.MarkoAttribute;
4
+ export declare function assertOnlyValueAttr(tag: t.NodePath<t.MarkoTag>, required?: boolean, change?: boolean, hint?: (attr: t.MarkoAttribute) => string | undefined): t.MarkoAttribute | undefined;
5
+ export declare function assertHasVar(tag: t.NodePath<t.MarkoTag>, hint?: string | ((tag: t.NodePath<t.MarkoTag>) => string)): void;
6
+ export declare function assertIdentifierVar(tag: t.NodePath<t.MarkoTag>): void;
3
7
  export declare function assertNoTagVarMutation(tag: t.NodePath<t.MarkoTag>): void;
8
+ export declare function assertHasBody(tag: t.NodePath<t.MarkoTag>): void;
4
9
  export declare function assertNoBodyContent(tag: t.NodePath<t.MarkoTag>): void;
10
+ export declare function buildAttrsError(tag: t.NodePath<t.MarkoTag>, attrs: t.MarkoTag["attributes"], msg: string): Error;
11
+ export declare function buildAttrNameError(tag: t.NodePath<t.MarkoTag>, attr: t.MarkoAttribute, msg: string): Error;
@@ -29,11 +29,12 @@ export interface Binding {
29
29
  /** The expressions its value is computed from, `false` for none; unset when
30
30
  * analysis cannot see them, which makes it its own source. */
31
31
  derivedFrom: Opt<t.NodeExtra> | false;
32
- /** Complete only once `finalizeReferences` runs at program analyze exit. */
33
- /** Its reads, by the expression each is in; pruning hands an expression's reads
34
- * to the nearest ancestor it also reads, which they then resolve to. */
32
+ /** Its reads by expression, complete once `finalizeReferences` runs: pruning
33
+ * hands an expression's reads to the nearest ancestor it also reads. */
35
34
  reads: Map<ReferencedExtra, Opt<Read>>;
36
35
  aliases: Set<Binding>;
36
+ /** The sections reading it through a hoist: its own or its ancestors, so
37
+ * the first is the outermost. */
37
38
  hoists: SortedOpt<Section>;
38
39
  getters: Map<Getter["hoisted"], boolean>;
39
40
  property: string | undefined;
@@ -75,7 +76,7 @@ export interface Binding {
75
76
  /** In a template's or `<define>`'s params tree, which known call sites set
76
77
  * directly. */
77
78
  exposed: boolean;
78
- /** Read on invocation from its own scope slot, which must persist. */
79
+ /** Read on invocation from its own scope slot, so its signal stores it. */
79
80
  hasLazyReads: boolean;
80
81
  }
81
82
  /** A param of a template or of a tag body, which its caller supplies. */
@@ -102,26 +103,28 @@ export interface Getter {
102
103
  export declare const getBindings: () => Set<Binding>;
103
104
  export declare function createBinding(name: string, type: Binding["type"], refSection: Section, aliased?: Binding["aliasOf"], property?: string, excludeProperties?: SortedOpt<string>, loc?: t.SourceLocation | null, refDeclared?: boolean, restOffset?: number): Binding;
104
105
  export declare function reserveId(binding: Binding, offset: ReservedId): void;
105
- export declare function getOrCreatePropertyAlias(binding: Binding, property: string): Binding;
106
+ export declare function ensurePropertyAlias(binding: Binding, property: string): Binding;
106
107
  export declare function addAssignedProperty(binding: Binding, property: string | undefined): void;
107
108
  export declare function getAssignedObject(binding: Binding): Binding | undefined;
108
- export declare function getPropertyAlias(binding: Binding | undefined, properties: Opt<string>): Binding | undefined;
109
+ export declare function getPropertyAlias(binding: Binding, properties: Opt<string>): Binding | undefined;
110
+ export declare function getDeepestPropertyAlias(binding: Binding, properties: Opt<string>): Binding;
109
111
  export declare function compareReferences(a: ReferencedBindings, b: ReferencedBindings): number;
110
112
  /**
111
113
  * reference group priority is sorted by number of references,
112
114
  * then if needed by reference order.
113
115
  */
114
116
  export declare function compareIntersections(a: Intersection, b: Intersection): number;
115
- export declare function getAliasRoot(binding: Binding): Binding | undefined;
117
+ export declare function getAliasRoot(binding: Binding): Binding;
116
118
  export declare const bindingUtil: Sorted<Binding>;
117
119
  export declare const propsUtil: Sorted<string>;
118
120
  export declare function getCanonicalBinding(binding: Binding): Binding;
119
121
  export declare function someAlias<A>(binding: Binding, test: (binding: Binding, arg: A) => boolean, arg: A, directOnly?: boolean): boolean;
120
- export declare function someAliased<A>(binding: Binding | undefined, test: (binding: Binding, arg: A) => boolean, arg: A): boolean;
122
+ export declare function someUpToAliasRoot<A>(binding: Binding | undefined, test: (binding: Binding, arg: A) => boolean, arg: A): boolean;
121
123
  export declare function getNearestDeclared(binding: Binding): Binding | undefined;
124
+ export declare function getDeclaredAlias(binding: Binding): false | Binding | undefined;
122
125
  export declare function isDirectAlias(binding: Binding): boolean;
123
126
  export declare function isRest(binding: Binding): boolean;
124
- export declare function getDebugScopeAccess(binding: Binding): {
127
+ export declare function getDebugAccess(binding: Binding, toParam: boolean, formatProperty: (property: string) => string): {
125
128
  root: Binding;
126
129
  access: string;
127
130
  };
@@ -130,6 +133,7 @@ export declare function getDebugName(binding: Binding): string;
130
133
  export declare function getDebugNames(refs: ReferencedBindings): string;
131
134
  export declare function getDebugNamesAsIdentifier(refs: ReferencedBindings): string;
132
135
  export declare function isInvokeOnlyBinding(binding: Binding): boolean;
136
+ export declare function isOwnBinding(binding: Binding): boolean;
133
137
  export declare function hasNonConstantPropertyAlias(ref: Binding): boolean;
134
138
  export declare function getPropertyPath(binding: Binding, ancestor: Binding): Opt<string>;
135
139
  export declare function isIndexProperty(property: string): boolean;
@@ -0,0 +1,9 @@
1
+ import { types as t } from "@marko/compiler";
2
+ declare module "@marko/compiler/dist/types" {
3
+ interface MarkoPlaceholderExtra {
4
+ needsTextCoercion?: true;
5
+ }
6
+ }
7
+ export declare function bodyToText(body: t.MarkoTagBody, decodeEntities?: boolean): t.ArrayExpression | t.ArrowFunctionExpression | t.AssignmentExpression | t.AwaitExpression | t.BigIntLiteral | t.BinaryExpression | t.BindExpression | t.BooleanLiteral | t.CallExpression | t.ClassExpression | t.ConditionalExpression | t.DecimalLiteral | t.DoExpression | t.FunctionExpression | t.Identifier | t.Import | t.ImportExpression | t.JSXElement | t.JSXFragment | t.LogicalExpression | t.MarkoParseError | t.MemberExpression | t.MetaProperty | t.ModuleExpression | t.NewExpression | t.NullLiteral | t.NumericLiteral | t.ObjectExpression | t.OptionalCallExpression | t.OptionalMemberExpression | t.ParenthesizedExpression | t.PipelineBareFunction | t.PipelinePrimaryTopicReference | t.PipelineTopicExpression | t.RecordExpression | t.RegExpLiteral | t.SequenceExpression | t.StringLiteral | t.Super | t.TSAsExpression | t.TSInstantiationExpression | t.TSNonNullExpression | t.TSSatisfiesExpression | t.TSTypeAssertion | t.TaggedTemplateExpression | t.TemplateLiteral | t.ThisExpression | t.TopicReference | t.TupleExpression | t.TypeCastExpression | t.UnaryExpression | t.UpdateExpression | t.YieldExpression;
8
+ export declare function bodyToUncoercedText(body: t.MarkoTagBody): t.ArrayExpression | t.ArrowFunctionExpression | t.AssignmentExpression | t.AwaitExpression | t.BigIntLiteral | t.BinaryExpression | t.BindExpression | t.BooleanLiteral | t.CallExpression | t.ClassExpression | t.ConditionalExpression | t.DecimalLiteral | t.DoExpression | t.FunctionExpression | t.Identifier | t.Import | t.ImportExpression | t.JSXElement | t.JSXFragment | t.LogicalExpression | t.MarkoParseError | t.MemberExpression | t.MetaProperty | t.ModuleExpression | t.NewExpression | t.NullLiteral | t.NumericLiteral | t.ObjectExpression | t.OptionalCallExpression | t.OptionalMemberExpression | t.ParenthesizedExpression | t.PipelineBareFunction | t.PipelinePrimaryTopicReference | t.PipelineTopicExpression | t.RecordExpression | t.RegExpLiteral | t.SequenceExpression | t.StringLiteral | t.Super | t.TSAsExpression | t.TSInstantiationExpression | t.TSNonNullExpression | t.TSSatisfiesExpression | t.TSTypeAssertion | t.TaggedTemplateExpression | t.TemplateLiteral | t.ThisExpression | t.TopicReference | t.TupleExpression | t.TypeCastExpression | t.UnaryExpression | t.UpdateExpression | t.YieldExpression;
9
+ export declare function injectTextCoercion(expr: t.Expression): void;
@@ -3,8 +3,15 @@ import { type Binding } from "./bindings";
3
3
  import { type Reasons } from "./reasons";
4
4
  import { type Section } from "./sections";
5
5
  export declare function initBranchSection(bodySection: Section, branchExpr: Section["branchExpr"], branch: NonNullable<Section["branch"]>): void;
6
- export declare function resumeOwnerByMarkerWhenStatic(bodySection: Section, nodeBinding: Binding): void;
7
- export declare function getBranchResumeArgs(tagSection: Section, nodeBinding: Binding, branchReasons: Reasons, onlyChildParentTagName: string | false | undefined, singleNode: boolean): (t.Expression | undefined)[];
8
- export declare function getBranchEndArgs(tagSection: Section, nodeBinding: Binding, onlyChildParentTagName: string | false | undefined, singleNode: boolean | undefined): (t.Expression | undefined)[];
6
+ export declare function resumeOwnerByMarkerWhenUnconditional(bodySection: Section, nodeBinding: Binding): void;
7
+ export declare function getBranchResumeArgs(tag: t.NodePath<t.MarkoTag>, branchReasons: Reasons, singleNode: boolean): (t.Expression | undefined)[];
8
+ export declare function buildBranchEndArgs(tagSection: Section, nodeBinding: Binding, onlyChildParentTagName: string | false | undefined, singleNode: boolean | undefined): (t.Expression | undefined)[];
9
9
  export declare function isEndTagWrittenByBranch(nodeBinding: Binding | undefined): boolean;
10
10
  export declare function isSingleNodeBranch(bodySection: Section | undefined): boolean;
11
+ export type ForType = "in" | "of" | "to" | "until";
12
+ export declare function buildForRuntimeCall(type: ForType, attrs: Record<string, t.Expression>, params: t.ArrowFunctionExpression["params"], statements: t.Statement[]): t.ExpressionStatement;
13
+ export declare function getForType(tag: t.MarkoTag): ForType | undefined;
14
+ export declare function forTypeToRuntime(type: ForType): "forIn" | "forOf" | "forTo" | "forUntil";
15
+ export declare function forTypeToBranchRuntime(type: ForType): "_for_in" | "_for_of" | "_for_to" | "_for_until";
16
+ export declare function forTypeToUnkeyedBranchRuntime(type: ForType): "_for_of_unkeyed" | "_for_to_unkeyed" | "_for_until_unkeyed";
17
+ export declare function getBaseArgsInForTag(type: ForType, attrs: Record<string, t.Expression>): t.Expression[];
@@ -0,0 +1,4 @@
1
+ import { types as t } from "@marko/compiler";
2
+ export default function buildStringExpression(parts: (string | t.Expression)[], useIife?: boolean): t.Expression | undefined;
3
+ export declare function appendLiteral(arr: unknown[], str: string): void;
4
+ export declare function toTemplateElement(value: string, tail?: boolean): t.TemplateElement;
@@ -0,0 +1,7 @@
1
+ import { types as t } from "@marko/compiler";
2
+ import { type Binding } from "./bindings";
3
+ import { type Opt } from "./optional";
4
+ import { type KnownExprs } from "./reasons";
5
+ import { type Section } from "./sections";
6
+ export declare function setTagContentDerives(tag: t.NodePath<t.MarkoTag>, binding: Opt<Binding>, exprs?: KnownExprs): void;
7
+ export declare function finalizeContentDerives(section: Section): void;
@@ -9,29 +9,40 @@ declare module "@marko/compiler/dist/types" {
9
9
  }
10
10
  interface EntryState {
11
11
  init: boolean;
12
- load: boolean;
12
+ hasClientStatement: boolean;
13
13
  /** Whether a reached template lazily imports another. */
14
14
  lazy: boolean;
15
15
  /** Depth of enclosing templates whose modules the bundle already loads:
16
16
  * below a root everything arrives through its imports, and a lazy subtree
17
17
  * is loaded by its own load entry. */
18
- bundled: number;
18
+ bundledDepth: number;
19
+ /** Depth of enclosing lazy imports, whose load entries bring their assets. */
20
+ lazyDepth: number;
19
21
  roots: string[];
20
22
  /** Assets of templates the bundle never loads; the entry imports them. */
21
23
  assets: Set<string>;
22
24
  /** Assets that arrive through a bundled template's imports; the entry
23
25
  * imports them itself only when it links nothing (a server only page). */
24
26
  bundledAssets: Set<string>;
25
- /** Whether each reached file was only ever seen below a bundled template. */
26
- visited: Map<string, boolean>;
27
+ /** The most eager way each file has been reached. */
28
+ visited: Map<string, Reach>;
27
29
  }
30
+ /** How a file was reached: 0 eagerly, 1 below a bundled template, 2 only
31
+ * within a lazy subtree. Lower is more eager, so `seen <= reach` means it was
32
+ * already visited at least as eagerly and is skipped; a file reached more
33
+ * eagerly than before is re-visited, since it may then own assets or a root. */
34
+ export type Reach = 0 | 1 | 2;
28
35
  type EntryFile = t.BabelFile & {
29
36
  [kState]?: EntryState;
30
37
  };
31
- type VisitChild = (id: string, bundled?: boolean) => void;
38
+ type VisitChild = (id: string, reach?: Reach) => void;
32
39
  declare const kState: unique symbol;
33
40
  declare const builder: {
34
41
  build(entryFile: EntryFile, exportInit?: boolean): t.Statement[];
35
42
  visit(file: t.BabelFile, entryFile: EntryFile, visitChild?: VisitChild): void;
36
43
  };
37
44
  export default builder;
45
+ export declare function assertVisited<S>(entryFile: t.BabelFile, state: S | undefined): asserts state is S;
46
+ export declare function createVisited(entryFile: t.BabelFile): Map<string, Reach>;
47
+ export declare function resolveRelativeToEntry(entryFile: t.BabelFile, file: t.BabelFile, req: string): string;
48
+ export declare function markReached(visited: Map<string, Reach>, resolved: string, reach: Reach): boolean;
@@ -1,4 +1,5 @@
1
- import { type Binding, type ReferencedBindings } from "./bindings";
1
+ import { types as t } from "@marko/compiler";
2
+ import { type Binding } from "./bindings";
2
3
  export declare function finalizeReferences(): void;
3
- export declare function getValueInputs(binding: Binding): ReferencedBindings;
4
+ export declare function readsValuesOnResume(expr: t.NodeExtra): boolean;
4
5
  export declare function hasEmittedAssignment(binding: Binding): boolean;
@@ -8,6 +8,7 @@ declare module "@marko/compiler/dist/types" {
8
8
  }
9
9
  export declare function generateUid(name?: string): string;
10
10
  export declare function generateUidIdentifier(name?: string): t.Identifier;
11
- export declare function getSharedUid(name: string, section?: Section): string;
12
- export declare function usedSharedUid(name: string): boolean;
11
+ export declare function declareConstBefore(tag: t.NodePath<t.MarkoTag>, name: string, expr: t.Expression): t.Identifier;
12
+ export declare function ensureSharedUid(name: string, section?: Section): string;
13
+ export declare function hasSharedUid(name: string): boolean;
13
14
  export {};
@@ -1,8 +1,8 @@
1
1
  import type { types as t } from "@marko/compiler";
2
- export type MarkoExprRootPath = t.NodePath<t.MarkoTag | t.MarkoTagBody | t.MarkoAttribute | t.MarkoSpreadAttribute | t.MarkoScriptlet | t.MarkoPlaceholder | t.ExportNamedDeclaration | t.ExportDefaultDeclaration>;
3
- export declare function getMarkoRoot(path: t.NodePath<t.Node>): MarkoExprRootPath | null;
2
+ export type MarkoRootPath = t.NodePath<t.MarkoTag | t.MarkoTagBody | t.MarkoAttribute | t.MarkoSpreadAttribute | t.MarkoScriptlet | t.MarkoPlaceholder | t.ExportNamedDeclaration | t.ExportDefaultDeclaration>;
3
+ export declare function getMarkoRoot(path: t.NodePath<t.Node>): MarkoRootPath | null;
4
4
  export declare function getExprRoot(path: t.NodePath<t.Node>): t.NodePath<t.Node>;
5
5
  export declare function getFnRoot(path: t.NodePath<t.Node>): t.NodePath<t.ArrowFunctionExpression | t.FunctionDeclaration | t.FunctionExpression | t.ObjectMember> | undefined;
6
6
  export declare function getFnParent(path: t.NodePath<t.Node>): t.NodePath<t.ArrowFunctionExpression | t.FunctionDeclaration | t.FunctionExpression | t.ObjectMember> | undefined;
7
7
  export declare function getDeclarationRoot(path: t.NodePath<t.Node>): t.NodePath<t.FunctionDeclaration | t.VariableDeclaration> | undefined;
8
- export declare function isMarko(path: t.NodePath<any>): path is MarkoExprRootPath;
8
+ export declare function isMarkoRoot(path: t.NodePath<any>): path is MarkoRootPath;
@@ -1,3 +1,3 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  export declare function getTagName<T extends t.MarkoTag>(tag: t.NodePath<T>): T["name"] extends t.StringLiteral ? string : string | undefined;
3
- export declare function getStaticTagName(node: t.MarkoTag): string;
3
+ export declare function getTagNameHint(node: t.MarkoTag): string;
@@ -1,23 +1,25 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type BindingPropTree } from "./binding-prop-tree";
3
2
  import { type Binding } from "./bindings";
4
- import { type KnownExprs } from "./references";
3
+ import { type ParamsTree } from "./params-tree";
4
+ import { type KnownExprs } from "./reasons";
5
5
  import { type Section } from "./sections";
6
- declare const kContentSection: unique symbol;
7
- declare const kPropTree: unique symbol;
6
+ declare const kChildSection: unique symbol;
7
+ declare const kParamsTree: unique symbol;
8
8
  declare const kKnownExprs: unique symbol;
9
9
  declare module "@marko/compiler/dist/types" {
10
10
  interface MarkoTagExtra {
11
- [kContentSection]?: Section;
11
+ /** The dom binding a known tag holds its child's scope in. */
12
+ childScopeBinding?: Binding;
13
+ [kChildSection]?: Section;
12
14
  /** The child's params tree the call site was analyzed against. */
13
- [kPropTree]?: BindingPropTree;
15
+ [kParamsTree]?: ParamsTree;
14
16
  [kKnownExprs]?: KnownExprs;
15
17
  }
16
18
  }
17
- export declare function knownTagAnalyze(tag: t.NodePath<t.MarkoTag>, contentSection: Section, childParamsTree?: BindingPropTree): void;
19
+ export declare function knownTagAnalyze(tag: t.NodePath<t.MarkoTag>, childSection: Section, childParamsTree?: ParamsTree): void;
18
20
  export declare function analyzeRecursiveTags(): void;
19
21
  export declare function knownTagTranslateHTML(tag: t.NodePath<t.MarkoTag>, tagIdentifier: t.Expression): void;
20
22
  export declare function knownTagTranslateDOM(tag: t.NodePath<t.MarkoTag>, getBindingIdentifier: (binding: Binding, preferredName?: string, directContent?: boolean) => t.Identifier, callSetup: ((section: Section, childBinding: Binding) => void) | undefined): void;
21
- export declare function finalizeKnownTags(section: Section): void;
23
+ export declare function addKnownTagReasons(section: Section): void;
22
24
  export declare function callsOtherTemplateSetup(section: Section): boolean;
23
25
  export {};
@@ -12,9 +12,6 @@ export interface ModuleRead {
12
12
  /** The import's source; none for a `<style/name>` tag's own stylesheet module. */
13
13
  request: string | undefined;
14
14
  }
15
- /** The module read an expression is, resolved on first use: translate replaces
16
- * a `<style/name>` tag. */
17
- export declare function getModuleRead(path: t.NodePath, expr: t.Expression): ModuleRead | undefined;
18
15
  /** A module read of a stylesheet module, whose reads are class name strings. */
19
16
  export declare function getStyleImportRead(path: t.NodePath, expr: t.Expression): string[] | undefined;
20
17
  export declare function toModuleReadExpression([name, ...members]: string[]): t.Identifier | t.MemberExpression;
@@ -1,7 +1,51 @@
1
1
  import { types as t } from "@marko/compiler";
2
+ import { type MarkoRootPath } from "./get-root";
3
+ import { type RegisteredFnExtra } from "./references";
4
+ declare const kRegisteredExports: unique symbol;
5
+ declare module "@marko/compiler/dist/types" {
6
+ interface ProgramExtra {
7
+ [kRegisteredExports]?: Map<string, RegisteredExport>;
8
+ }
9
+ interface ImportDeclarationExtra {
10
+ /** Each local binding the template registers -> the export it imports. */
11
+ registeredImports?: Map<string, RegisteredExport>;
12
+ }
13
+ }
14
+ /**
15
+ * An export registered under an id: the template that declares it, and the
16
+ * canonical name it is exported under.
17
+ */
18
+ export interface RegisteredExport {
19
+ registerId: string;
20
+ exportName: string;
21
+ filename: string;
22
+ }
23
+ export declare function trackFunction(fn: t.NodePath<t.Function>, fnExtra: RegisteredFnExtra, markoRoot: MarkoRootPath): void;
24
+ export declare function canIgnoreRegister(markoRoot: MarkoRootPath, exprRoot: t.NodePath<t.Node>): boolean;
25
+ export declare function addFunctionReasons(): void;
26
+ export declare function finalizeRegistrations(): void;
27
+ /**
28
+ * Tracks a template imported as a default export. The server writes a template
29
+ * only as a binding's value, so the importing template registers it when one may.
30
+ */
31
+ export declare function trackImportedTemplate(importDecl: t.NodePath<t.ImportDeclaration>, local: string, templateFile: t.BabelFile): void;
32
+ /**
33
+ * Tracks an export imported from another template that registers under an id,
34
+ * if it does. The importing template registers it (under that id) when client
35
+ * code reads its own references.
36
+ */
37
+ export declare function trackImport(importDecl: t.NodePath<t.ImportDeclaration>, local: string, registered: RegisteredExport | undefined, fnRoots?: Set<t.NodeExtra>): void;
38
+ /**
39
+ * Finds the id reserved for an export, following `export ... from` hops. Each
40
+ * template only records the exports it declares, so this resolves on demand:
41
+ * a template in an import cycle is read while it is still analyzing, and would
42
+ * hand out an incomplete map if the ids were pushed ahead of time.
43
+ */
44
+ export declare function resolveRegisteredExport(file: t.BabelFile, exportName: string, seen?: Set<string>): RegisteredExport | undefined;
2
45
  /**
3
46
  * Writes the registrations for module scoped functions: the ones this template
4
47
  * exports and registers itself, and the ones it imports from a template that
5
48
  * reserved a register id without registering it; and for templates it imports.
6
49
  */
7
50
  export declare function writeModuleRegistrations(program: t.NodePath<t.Program>): void;
51
+ export {};
@@ -9,7 +9,7 @@ export type AttrTagLookup = Record<string, AttrTagMeta>;
9
9
  type AttrTagNames = string[];
10
10
  declare module "@marko/compiler/dist/types" {
11
11
  interface MarkoTagExtra {
12
- attributeTags?: AttrTagLookup;
12
+ attrTagLookup?: AttrTagLookup;
13
13
  attributeTagGroup?: AttrTagLookup[string]["group"];
14
14
  }
15
15
  }
@@ -14,10 +14,13 @@ export declare class Sorted<T> {
14
14
  add<U extends NonNullable<T>>(data: SortedOpt<U>, item: U): SortedOneMany<U>;
15
15
  union<U extends NonNullable<T>>(a: SortedOpt<U>, b: SortedOpt<U>): SortedOpt<U>;
16
16
  filter<U extends NonNullable<T>>(data: SortedOpt<U>, cb: (item: U) => boolean): SortedOpt<U>;
17
+ leadingRun<U extends NonNullable<T>, K>(data: SortedOpt<U>, key: (item: U) => K, compareKeys: Compare<K>, bound: K): SortedOpt<U>;
18
+ range<U extends NonNullable<T>, K>(data: SortedOpt<U>, key: (item: U) => K, compareKeys: Compare<K>, bound: K): SortedOpt<U>;
19
+ forEachRun<U extends NonNullable<T>, K>(data: SortedOpt<U>, key: (item: U) => K, compareKeys: Compare<K>, fn: (key: K, run: SortedOneMany<U>) => void): void;
20
+ reduceRuns<U extends NonNullable<T>, K, R>(data: SortedOpt<U>, key: (item: U) => K, compareKeys: Compare<K>, fn: (acc: R, key: K, run: SortedOneMany<U>) => R, initial: R): R;
17
21
  find<U extends NonNullable<T>>(data: SortedOpt<U>, item: U): U | undefined;
18
22
  has<U extends NonNullable<T>>(data: SortedOpt<U>, item: U): boolean;
19
23
  findIndex<U extends NonNullable<T>>(data: SortedOpt<U>, item: U): number;
20
- groupBy<U extends NonNullable<T>, K>(data: SortedOpt<U>, cb: (item: U) => K): Map<K, SortedOneMany<U>>;
21
24
  intersects<U extends NonNullable<T>>(a: SortedOpt<U>, b: SortedOpt<U>): boolean;
22
25
  difference<U extends NonNullable<T>>(a: SortedOpt<U>, b: SortedOpt<U>): SortedOpt<U>;
23
26
  isSuperset<U extends NonNullable<T>>(superset: SortedOpt<U>, subset: SortedOpt<U>): boolean;
@@ -33,6 +36,7 @@ export declare function some<T>(data: Opt<T>, cb: (item: T, index: number) => bo
33
36
  export declare function every<T>(data: Opt<T>, cb: (item: T, index: number) => boolean): boolean;
34
37
  export declare function reduce<T, R>(data: Opt<T>, cb: (acc: R | undefined, item: T, index: number) => R | undefined): R | undefined;
35
38
  export declare function reduce<T, R>(data: Opt<T>, cb: (acc: R, item: T, index: number) => R, initial: R): R;
39
+ export declare function reduceWhile<T, R>(data: Opt<T>, cb: (acc: R, item: T) => R | undefined, initial: R): R | undefined;
36
40
  export declare function toArray<T, R>(data: Opt<T>, cb: (item: T, index: number) => R): R[];
37
41
  export declare function toSet<T>(data: Opt<T>): Set<T>;
38
42
  export declare function mapToString<T>(data: Opt<T>, sep: string, cb: (item: T, index: number) => string): string;
@@ -41,5 +45,6 @@ export declare function findIndexSorted<T>(compare: Compare<T>, data: T[], item:
41
45
  export declare function addSorted<T, U extends T[]>(compare: Compare<T>, data: U, item: T): U;
42
46
  export declare function at<T>(data: Opt<T>, index: number): T | undefined;
43
47
  export declare function first<T>(data: OneMany<T>): T;
48
+ export declare function last<T>(data: OneMany<T>): T;
44
49
  export declare function rest<T>(data: OneMany<T>): Opt<T>;
45
50
  export {};
@@ -0,0 +1,18 @@
1
+ import { type Binding } from "./bindings";
2
+ export type ParamsTree = {
3
+ binding: Binding;
4
+ props: {
5
+ [prop: string]: ParamsTree;
6
+ } | undefined;
7
+ rest: ParamsTree | undefined;
8
+ };
9
+ declare module "@marko/compiler/dist/types" {
10
+ interface NodeExtra {
11
+ nameOnly?: true;
12
+ }
13
+ }
14
+ export declare function exposeParamsTree(binding: Binding, bodyAnalyzed?: boolean): ParamsTree;
15
+ export declare function getSettledParamsTree(paramsTree: ParamsTree | undefined): ParamsTree | undefined;
16
+ export declare function getParamsTreeAt(paramsTree: ParamsTree | true, name: string): ParamsTree | true | undefined;
17
+ export declare function getAllKnownPropNames(paramsTree: ParamsTree): string[];
18
+ export declare function hasAllKnownProps(paramsTree: ParamsTree): boolean | undefined;
@@ -1,14 +1,13 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type ReferencedBindings } from "./bindings";
3
- import { type Opt, Sorted, type SortedOneMany } from "./optional";
4
- import { type KnownExprs } from "./references";
2
+ import { type Binding, type ParamBinding, type ReferencedBindings } from "./bindings";
3
+ import { type Opt, type SortedOneMany } from "./optional";
5
4
  import { type ParamReasonGroups, type Section } from "./sections";
6
5
  import { type Slot } from "./slots";
7
6
  import { type Sources } from "./sources";
8
7
  export type Reasons = SortedOneMany<Sources>;
9
- export declare const sourcesUtil: Sorted<Sources>;
10
8
  export type Reason = Sources;
11
9
  export declare function addReason(slot: Slot, reason: undefined | false | Reason): void;
10
+ export declare function addAlwaysReason(binding: Binding): void;
12
11
  export declare function addReasonExprs(slot: Slot, expr: Opt<t.NodeExtra>): void;
13
12
  export declare function addOwnerReason(from: Section, to: Section, reason: undefined | false | Reason): void;
14
13
  export declare function isConditionalReason(reason: undefined | Reason): reason is Sources & {
@@ -22,11 +21,14 @@ export declare function getSourcesForExprs(exprs: Opt<t.NodeExtra> | boolean): S
22
21
  export declare function getSourcesForRef(ref: ReferencedBindings): Sources | undefined;
23
22
  export declare function getSourcesForDerived({ binding, exprs, properties, }: NonNullable<Section["derives"]>): Sources | undefined;
24
23
  export declare function mapParamReason(program: Section, reason: Sources, exprs: KnownExprs | undefined, ownParams: boolean): Reason | undefined;
25
- export declare function mergeReasons(a: Reason, b: undefined | Reason): Reason;
26
- export declare function mergeReasons(a: undefined | Reason, b: Reason): Reason;
27
- export declare function mergeReasons(a: undefined | Reason, b: undefined | Reason): Reason | undefined;
24
+ export interface KnownExprs {
25
+ known?: Record<string, KnownExprs>;
26
+ value?: t.NodeExtra;
27
+ }
28
+ export declare function mapParamReasonToExpr(exprs: KnownExprs, reason: boolean | Opt<ParamBinding>): true | import("./optional").Many<t.NodeExtra> | t.NodeExtra | undefined;
29
+ export declare function mapParamBindingToExpr(exprs: KnownExprs, binding: ParamBinding): Opt<t.NodeExtra>;
28
30
  export declare function applyReasonExprs(section: Section): void;
29
- export declare function finalizeReason(section: Section): void;
31
+ export declare function mergeSlotReasons(section: Section): void;
30
32
  export declare function getNodeReasons(section: Section): Sources | import("./optional").SortedMany<Sources> | undefined;
31
33
  export declare function getReasonsVersion(): number;
32
34
  export declare function setParamReasonGroups(section: Section, groups: ParamReasonGroups): void;
@@ -1,30 +1,30 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type Binding, BindingType, type Getter, type ParamBinding, type ReferencedBindings } from "./bindings";
2
+ import { type Binding, BindingType, type Getter, type ReferencedBindings } from "./bindings";
3
3
  import { type OneMany, type Opt, type SortedOpt } from "./optional";
4
- import { type Reason } from "./reasons";
4
+ import { type KnownExprs, type Reason } from "./reasons";
5
5
  import { type Section } from "./sections";
6
6
  interface ReferencedFunctionExtra extends t.FunctionExtra, ReferencedExtra {
7
7
  }
8
8
  export interface Read {
9
9
  binding: Binding;
10
10
  extra: t.NodeExtra;
11
- ownVar: boolean;
11
+ inOwnBody: boolean;
12
12
  getter: Getter | undefined;
13
13
  comparedTo: t.Node | undefined;
14
14
  deferred: boolean;
15
- inFunction: boolean;
15
+ /** The outermost function holding it; none when that escapes into a call. */
16
+ fnRoot: ReferencedFunctionExtra | undefined;
16
17
  }
17
- export interface ExtraRead {
18
+ export interface ResolvedRead {
18
19
  binding: Binding;
19
20
  props: Opt<string>;
20
- ownVar: boolean;
21
+ inOwnBody: boolean;
21
22
  getter: Getter | undefined;
22
23
  /** Set for same-section local reads: the function root that owns the read. */
23
24
  localFn?: ReferencedFunctionExtra;
24
25
  }
25
26
  declare const kReferencedBindings: unique symbol;
26
27
  declare const kLazyBindings: unique symbol;
27
- declare const kGlobalBindings: unique symbol;
28
28
  declare const kReferencedBindingsInFunction: unique symbol;
29
29
  declare const kConstantBindingsInFunction: unique symbol;
30
30
  declare module "@marko/compiler/dist/types" {
@@ -33,8 +33,8 @@ declare module "@marko/compiler/dist/types" {
33
33
  hasGlobalRead?: true;
34
34
  }
35
35
  interface MarkoTagExtra {
36
- /** The dom binding the tag is addressed by: its node, marker or child
37
- * scope; an only child control flow tag shares its parent's. */
36
+ /** The dom binding the tag is addressed by: its node or marker; an only
37
+ * child control flow tag shares its parent's. */
38
38
  nodeBinding?: Binding;
39
39
  }
40
40
  interface MarkoPlaceholderExtra {
@@ -45,11 +45,10 @@ declare module "@marko/compiler/dist/types" {
45
45
  section?: Section;
46
46
  [kReferencedBindings]?: ReferencedBindings;
47
47
  [kLazyBindings]?: ReferencedBindings;
48
- [kGlobalBindings]?: ReferencedBindings;
49
- /** The bindings it feeds, in the order it feeds them: a call site's
50
- * values feed the child template's, so no one template's order sorts them. */
48
+ /** The bindings it derives, in the order it derives them: call sites
49
+ * derive a child template's, so no one template's order sorts them. */
51
50
  derives?: Opt<Binding>;
52
- /** The initial value of the binding it feeds, which keeps it rather than
51
+ /** The initial value of the binding it derives, which keeps it rather than
53
52
  * following it, so the binding derives no sources from it. */
54
53
  initialValue?: true;
55
54
  /** Its value has no side effect to evaluate, so an unread one can go: an
@@ -61,8 +60,8 @@ declare module "@marko/compiler/dist/types" {
61
60
  binding?: Binding;
62
61
  assignment?: Binding;
63
62
  assignmentTo?: Binding;
64
- read?: ExtraRead;
65
- pruned?: true;
63
+ read?: ResolvedRead;
64
+ dropped?: true;
66
65
  /** The expression this node sits in: dropped or merged as one. */
67
66
  exprRoot?: NodeExtra;
68
67
  isEffect?: true;
@@ -104,12 +103,12 @@ export declare function isTagVarUsed(tag: t.NodePath<t.MarkoTag>): boolean;
104
103
  export declare function trackDomVarReferences(tag: t.NodePath<t.MarkoTag>, binding: Binding): Binding | undefined;
105
104
  export declare function trackVarReferences(tag: t.NodePath<t.MarkoTag>, type: BindingType, aliased?: Binding["aliasOf"]): Binding | undefined;
106
105
  export declare function trackParamsReferences(body: t.NodePath<t.MarkoTagBody | t.Program>, type: BindingType): Binding | undefined;
107
- export declare function isReferenceInOwnBody(bindingPath: t.NodePath, reference: t.NodePath): boolean;
108
106
  export declare function isReferenceHoisted(bindingPath: t.NodePath, reference: t.NodePath): boolean;
109
- export declare function assertReferencedInRender(ref: t.NodePath, name: string, markoRoot?: import("./get-root").MarkoExprRootPath | null): void;
107
+ export declare function assertReferencedInRender(ref: t.NodePath, name: string, markoRoot?: import("./get-root").MarkoRootPath | null): void;
110
108
  export declare function setReferencesScope(path: t.NodePath<any>): void;
111
109
  export declare function trackGlobalReference(path: t.NodePath<t.Identifier>): void;
112
110
  export declare function mergeReferences<T extends t.Node>(section: Section, target: T, nodes: (t.Node | undefined)[]): NonNullable<T["extra"]> & ReferencedExtra;
111
+ export declare function mergeTagReferences(section: Section, tag: t.MarkoTag): t.MarkoTagExtra & t.NodeExtra & ReferencedExtra;
113
112
  export declare function mergeReferenceGroup(section: Section, nodes: (t.Node | undefined)[]): ReferencedExtra;
114
113
  export declare function setDerivedFrom(binding: Binding, expr: boolean | Opt<t.NodeExtra>, exprs?: KnownExprs): void;
115
114
  export declare const getAssignments: () => AssignedBindingExtra[];
@@ -122,8 +121,8 @@ export declare function dropNodes(node: t.Node | t.Node[]): void;
122
121
  export declare function dropExtra(exprExtra: ReferencedExtra): void;
123
122
  export declare function dropContent(body: t.MarkoTagBody): void;
124
123
  export declare function getAllTagReferenceNodes(tag: t.MarkoTag, referenceNodes?: t.Node[], collectAttrTag?: (attrTag: t.MarkoTag) => void): t.Node[];
125
- export declare function createRead(binding: Binding, props: Opt<string>, ownVar?: boolean): ExtraRead;
126
- export declare function createGetterRead(binding: Binding, props: Opt<string>, getter: Getter): ExtraRead;
124
+ export declare function createResolvedRead(binding: Binding, props: Opt<string>, inOwnBody?: boolean): ResolvedRead;
125
+ export declare function createResolvedGetterRead(binding: Binding, props: Opt<string>, getter: Getter): ResolvedRead;
127
126
  export interface ReferencedExtra extends t.NodeExtra {
128
127
  section: Section;
129
128
  }
@@ -134,26 +133,22 @@ export interface AssignedBindingExtra extends ReferencedExtra {
134
133
  /** The outermost function holding it; none when that escapes into a call. */
135
134
  fnRoot: ReferencedFunctionExtra | undefined;
136
135
  }
137
- export declare function hasResumableWriter(binding: Binding): boolean;
136
+ export declare function hasResumableAssignment(binding: Binding): boolean;
138
137
  export declare function isAssignedBindingExtra(extra: t.NodeExtra | undefined): extra is AssignedBindingExtra;
139
138
  export interface RegisteredFnExtra extends ReferencedExtra, t.FunctionExtra {
139
+ exprRoot: t.NodeExtra;
140
140
  name: string;
141
141
  registerId: string;
142
142
  reason: Reason;
143
143
  }
144
144
  export declare function isRegisteredFnExtra(extra: t.NodeExtra | undefined): extra is RegisteredFnExtra;
145
145
  export declare function getReferencedBindings(extra: t.NodeExtra | undefined): ReferencedBindings;
146
+ export declare function getBindingsDerivedFrom(binding: Binding): ReferencedBindings;
147
+ export declare function getValueReferences(exprs: Opt<t.NodeExtra>): ReferencedBindings;
146
148
  export declare function getLazyBindings(extra: t.NodeExtra | undefined): ReferencedBindings;
147
- export declare function getGlobalBindings(extra: t.NodeExtra | undefined): ReferencedBindings;
148
149
  export declare function getReferencedBindingsInFunction(extra: t.FunctionExtra): ReferencedBindings;
149
150
  export declare function getConstantBindingsInFunction(extra: t.FunctionExtra): ReferencedBindings;
150
151
  export declare function setResolvedFunctionReads(extra: t.FunctionExtra, referencedBindings: ReferencedBindings, constantBindings: ReferencedBindings): void;
151
- export declare function setResolvedReads(extra: ReferencedExtra, referencedBindings: ReferencedBindings, lazyBindings: ReferencedBindings, globalBindings: ReferencedBindings): void;
152
+ export declare function setResolvedReads(extra: ReferencedExtra, referencedBindings: ReferencedBindings, lazyBindings: ReferencedBindings): void;
152
153
  export declare function getCanonicalExtra<T extends t.NodeExtra>(extra: T): T;
153
- export interface KnownExprs {
154
- known?: Record<string, KnownExprs>;
155
- value?: t.NodeExtra;
156
- }
157
- export declare function mapParamReasonToExpr(exprs: KnownExprs, reason: boolean | Opt<ParamBinding>): true | import("./optional").Many<t.NodeExtra> | t.NodeExtra | undefined;
158
- export declare function mapParamBindingToExpr(exprs: KnownExprs, binding: ParamBinding): Opt<t.NodeExtra>;
159
154
  export {};
@@ -1,7 +1,5 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  import type { Falsy } from "../../common/types";
3
- import { _attr, _attr_class, _attr_style, _escape, _escape_script, _escape_style, _unescaped } from "../../html";
4
- import { escapeDoubleQuotedAttrValue } from "../../html/attrs";
5
3
  export type DOMRuntimeHelpers = keyof typeof import("../../dom");
6
4
  export type HTMLRuntimeHelpers = keyof typeof import("../../html");
7
5
  export declare function importRuntime(name: DOMRuntimeHelpers | HTMLRuntimeHelpers): t.Identifier;
@@ -12,15 +10,5 @@ export declare const domRuntimeFeatures: readonly ["catch", "controllable", "con
12
10
  export type DOMRuntimeFeature = (typeof domRuntimeFeatures)[number];
13
11
  export declare function importRuntimeFeature(feature: DOMRuntimeFeature): void;
14
12
  export declare function getRuntimeFeatureImport(feature: DOMRuntimeFeature): t.ImportDeclaration;
15
- export declare function getHTMLRuntime(): {
16
- _escape: typeof _escape;
17
- _unescaped: typeof _unescaped;
18
- _attr: typeof _attr;
19
- _attr_class: typeof _attr_class;
20
- _attr_style: typeof _attr_style;
21
- _escape_script: typeof _escape_script;
22
- _escape_style: typeof _escape_style;
23
- escapeDoubleQuotedAttrValue: typeof escapeDoubleQuotedAttrValue;
24
- };
25
13
  export declare function getRuntimePath(output: string): string;
26
14
  export declare function getCompatRuntimeFile(): string;
@@ -10,5 +10,4 @@ export declare function getScopeAccessor(binding: Binding, encoded?: boolean, in
10
10
  export declare function getLocalsScopeAccessor(binding: Binding): string;
11
11
  export declare function getPrefixedScopeAccessor(binding: Binding, prefix: AccessorPrefix): string;
12
12
  export declare function getClosureAccessorLiteral(binding: Binding): t.NumericLiteral | t.StringLiteral;
13
- export declare function getSectionInstancesAccessor(section: Section): string;
14
13
  export declare function getSectionInstancesAccessorLiteral(section: Section): t.StringLiteral;
@@ -1,5 +1,8 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  import { type Binding } from "./bindings";
3
3
  import type { Section } from "./sections";
4
+ export declare let scopeIdentifier: t.Identifier;
5
+ export declare let localsIdentifier: t.Identifier;
6
+ export declare function createScopeIdentifiers(): void;
4
7
  export declare function getScopeExpression(section: Section, targetSection: Section): t.Identifier | t.MemberExpression;
5
8
  export declare function createScopeReadExpression(reference: Binding, section?: Section): t.MemberExpression;
@@ -0,0 +1,4 @@
1
+ import { types as t } from "@marko/compiler";
2
+ import type { Section } from "./sections";
3
+ export declare function getSectionRendererIdentifier(section: Section): t.Identifier | undefined;
4
+ export declare function isSectionRendererElided(section: Section): boolean;