marko 6.4.5 → 6.4.7

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 (145) hide show
  1. package/cheatsheet.md +2 -1
  2. package/dist/common/errors.d.ts +3 -1
  3. package/dist/common/helpers.d.ts +7 -7
  4. package/dist/debug/dom/catch.feat.js +4 -4
  5. package/dist/debug/dom/catch.feat.mjs +4 -4
  6. package/dist/debug/dom/controllable-input.feat.js +1 -1
  7. package/dist/debug/dom/controllable-input.feat.mjs +1 -1
  8. package/dist/debug/dom/controllable-open.feat.js +1 -1
  9. package/dist/debug/dom/controllable-open.feat.mjs +1 -1
  10. package/dist/debug/dom/controllable-select.feat.js +1 -1
  11. package/dist/debug/dom/controllable-select.feat.mjs +1 -1
  12. package/dist/debug/dom/controllable-textarea.feat.js +1 -1
  13. package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
  14. package/dist/debug/dom/controllable.feat.js +5 -5
  15. package/dist/debug/dom/controllable.feat.mjs +5 -5
  16. package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
  17. package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
  18. package/dist/debug/dom/dynamic-tag-var.feat.js +2 -2
  19. package/dist/debug/dom/dynamic-tag-var.feat.mjs +2 -2
  20. package/dist/debug/dom/lazy.feat.js +1 -1
  21. package/dist/debug/dom/lazy.feat.mjs +1 -1
  22. package/dist/debug/dom/placeholder.feat.js +1 -1
  23. package/dist/debug/dom/placeholder.feat.mjs +1 -1
  24. package/dist/debug/{dom-BeY1nGUb.mjs → dom-CFCBDift.mjs} +133 -135
  25. package/dist/debug/{dom-CUxvM4i9.js → dom-D8znnhpf.js} +148 -150
  26. package/dist/debug/dom.js +21 -22
  27. package/dist/debug/dom.mjs +22 -22
  28. package/dist/debug/html.js +736 -664
  29. package/dist/debug/html.mjs +736 -665
  30. package/dist/dom/catch.feat.js +5 -5
  31. package/dist/dom/catch.feat.mjs +4 -4
  32. package/dist/dom/control-flow.d.ts +3 -3
  33. package/dist/dom/controllable-input.feat.js +2 -2
  34. package/dist/dom/controllable-input.feat.mjs +1 -1
  35. package/dist/dom/controllable-open.feat.js +2 -2
  36. package/dist/dom/controllable-open.feat.mjs +1 -1
  37. package/dist/dom/controllable-select.feat.js +2 -2
  38. package/dist/dom/controllable-select.feat.mjs +1 -1
  39. package/dist/dom/controllable-textarea.feat.js +2 -2
  40. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  41. package/dist/dom/controllable.d.ts +4 -4
  42. package/dist/dom/controllable.feat.js +2 -2
  43. package/dist/dom/controllable.feat.mjs +2 -2
  44. package/dist/dom/dom.d.ts +5 -5
  45. package/dist/dom/dynamic-tag-script.feat.js +2 -2
  46. package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
  47. package/dist/dom/dynamic-tag-var.feat.js +3 -3
  48. package/dist/dom/dynamic-tag-var.feat.mjs +2 -2
  49. package/dist/dom/lazy.feat.js +1 -1
  50. package/dist/dom/lazy.feat.mjs +1 -1
  51. package/dist/dom/placeholder.feat.js +2 -2
  52. package/dist/dom/placeholder.feat.mjs +1 -1
  53. package/dist/dom/renderer.d.ts +1 -3
  54. package/dist/dom/resume.d.ts +2 -3
  55. package/dist/dom/signals.d.ts +6 -8
  56. package/dist/{dom-Diu8MpmL.js → dom-Bpkm72vV.js} +157 -166
  57. package/dist/{dom-DefWmvQB.mjs → dom-CVAevsbz.mjs} +103 -107
  58. package/dist/dom.d.ts +1 -1
  59. package/dist/dom.js +37 -37
  60. package/dist/dom.mjs +22 -22
  61. package/dist/html/assets.d.ts +2 -2
  62. package/dist/html/compat.d.ts +2 -1
  63. package/dist/html/control-flow.d.ts +20 -0
  64. package/dist/html/inlined-runtimes.d.ts +2 -2
  65. package/dist/html/inlined-runtimes.debug.d.ts +2 -2
  66. package/dist/html/serializer.d.ts +63 -16
  67. package/dist/html/template.d.ts +1 -1
  68. package/dist/html/writer.d.ts +47 -35
  69. package/dist/html.d.ts +3 -2
  70. package/dist/html.js +531 -484
  71. package/dist/html.mjs +531 -484
  72. package/dist/translator/core/for.d.ts +0 -4
  73. package/dist/translator/core/return.d.ts +0 -3
  74. package/dist/translator/core/style.d.ts +2 -2
  75. package/dist/translator/index.js +8093 -8021
  76. package/dist/translator/util/analyze-errors.d.ts +2 -1
  77. package/dist/translator/util/assert.d.ts +15 -1
  78. package/dist/translator/util/bindings.d.ts +24 -12
  79. package/dist/translator/util/body-to-text.d.ts +9 -0
  80. package/dist/translator/util/branch-tag.d.ts +10 -3
  81. package/dist/translator/util/build-string-expression.d.ts +4 -0
  82. package/dist/translator/util/content-derives.d.ts +7 -0
  83. package/dist/translator/util/cyclic-memo.d.ts +6 -2
  84. package/dist/translator/util/entry-builder.d.ts +6 -3
  85. package/dist/translator/util/finalize-references.d.ts +6 -3
  86. package/dist/translator/util/for-selector.d.ts +1 -1
  87. package/dist/translator/util/generate-uid.d.ts +4 -2
  88. package/dist/translator/util/get-root.d.ts +3 -3
  89. package/dist/translator/util/get-tag-name.d.ts +1 -1
  90. package/dist/translator/util/known-tag.d.ts +14 -9
  91. package/dist/translator/util/module-read.d.ts +0 -3
  92. package/dist/translator/util/module-registrations.d.ts +44 -0
  93. package/dist/translator/util/nested-attribute-tags.d.ts +1 -1
  94. package/dist/translator/util/optional.d.ts +7 -2
  95. package/dist/translator/util/params-tree.d.ts +18 -0
  96. package/dist/translator/util/reasons.d.ts +13 -8
  97. package/dist/translator/util/references.d.ts +23 -27
  98. package/dist/translator/util/runtime.d.ts +0 -12
  99. package/dist/translator/util/scope-accessor.d.ts +0 -1
  100. package/dist/translator/util/scope-read.d.ts +3 -0
  101. package/dist/translator/util/section-renderer.d.ts +4 -0
  102. package/dist/translator/util/sections.d.ts +21 -21
  103. package/dist/translator/util/setup-work.d.ts +2 -1
  104. package/dist/translator/util/signals.d.ts +16 -14
  105. package/dist/translator/util/simplify-fn.d.ts +1 -0
  106. package/dist/translator/util/slots.d.ts +4 -4
  107. package/dist/translator/util/solve-reasons.d.ts +1 -3
  108. package/dist/translator/util/sources.d.ts +2 -1
  109. package/dist/translator/util/state.d.ts +4 -2
  110. package/dist/translator/util/statement-tag.d.ts +2 -0
  111. package/dist/translator/util/static-text.d.ts +2 -1
  112. package/dist/translator/util/structure.d.ts +0 -10
  113. package/dist/translator/util/tag-facts.d.ts +8 -1
  114. package/dist/translator/util/tag-import.d.ts +20 -0
  115. package/dist/translator/util/tag-name-type.d.ts +9 -2
  116. package/dist/translator/util/to-only-or-block.d.ts +3 -0
  117. package/dist/translator/util/to-property-name.d.ts +2 -0
  118. package/dist/translator/util/translate-attrs.d.ts +7 -5
  119. package/dist/translator/util/translate-var.d.ts +2 -0
  120. package/dist/translator/util/traverse.d.ts +1 -2
  121. package/dist/translator/util/visitors.d.ts +4 -1
  122. package/dist/translator/util/with-previous-location.d.ts +1 -1
  123. package/dist/translator/util/write-guard.d.ts +2 -2
  124. package/dist/translator/util/writer.d.ts +1 -2
  125. package/dist/translator/visitors/export-declaration.d.ts +2 -3
  126. package/dist/translator/visitors/function.d.ts +0 -35
  127. package/dist/translator/visitors/import-declaration.d.ts +1 -15
  128. package/dist/translator/visitors/placeholder.d.ts +2 -1
  129. package/dist/translator/visitors/program/html.d.ts +0 -1
  130. package/dist/translator/visitors/program/index.d.ts +4 -5
  131. package/dist/translator/visitors/program/pre-analyze.d.ts +2 -0
  132. package/dist/translator/visitors/tag/custom-tag.d.ts +0 -14
  133. package/dist/translator/visitors/tag/dynamic-tag.d.ts +1 -0
  134. package/dist/translator/visitors/tag/native-tag.d.ts +3 -12
  135. package/package.json +4 -4
  136. package/dist/translator/util/binding-has-prop.d.ts +0 -8
  137. package/dist/translator/util/binding-prop-tree.d.ts +0 -18
  138. package/dist/translator/util/body-to-text-literal.d.ts +0 -9
  139. package/dist/translator/util/import-reference.d.ts +0 -3
  140. package/dist/translator/util/normalize-string-expression.d.ts +0 -4
  141. package/dist/translator/util/plugin-hooks.d.ts +0 -4
  142. package/dist/translator/util/resolve-relative-to-entry.d.ts +0 -2
  143. package/dist/translator/util/set-tag-derived-from.d.ts +0 -7
  144. package/dist/translator/util/to-first-expression-or-block.d.ts +0 -2
  145. package/dist/translator/util/to-first-statement-or-block.d.ts +0 -2
@@ -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;
@@ -4,8 +4,7 @@ import * as ContentType from "./constants/content-type";
4
4
  import type * as Step from "./constants/step";
5
5
  import * as StructureKind from "./constants/structure-kind";
6
6
  import { type OneMany, type Opt, Sorted, type SortedOpt } from "./optional";
7
- import { type Reason } from "./reasons";
8
- import { type KnownExprs } from "./references";
7
+ import { type KnownExprs, type Reason } from "./reasons";
9
8
  import { type Slot } from "./slots";
10
9
  import { type Sources } from "./sources";
11
10
  export type ParamReasonGroup = NonNullable<Sources["param"]>;
@@ -60,10 +59,7 @@ export interface Section {
60
59
  hoisted: ReferencedBindings;
61
60
  /** The closures its `<for>` rows read only by comparing them to the row's
62
61
  * key, which a row selector updates. */
63
- selector: {
64
- key: Binding;
65
- closures: Set<Binding>;
66
- } | undefined;
62
+ selector: Set<Binding> | undefined;
67
63
  /** The canonical intersections its work waits on, once ids allocate. */
68
64
  intersections: Map<Intersection, IntersectionMeta> | undefined;
69
65
  /** The slots of its scope, its own and its bindings'. */
@@ -77,8 +73,10 @@ export interface Section {
77
73
  /** For a `<define>` body or a template rendering itself, the sections whose
78
74
  * direct calls render it. */
79
75
  callSections: SortedOpt<Section>;
80
- /** The content's rendering tag (its extra), and each child binding the
81
- * content feeds, at `properties`. */
76
+ /** The known tags rendering in it, in analyze order. */
77
+ knownTags: t.MarkoTagExtra[] | undefined;
78
+ /** The content's rendering tag (its extra), and each child binding that
79
+ * derives from the content, at `properties`. */
82
80
  derives: {
83
81
  tag: t.MarkoTagExtra;
84
82
  binding: OneMany<Binding>;
@@ -86,7 +84,7 @@ export interface Section {
86
84
  exprs: KnownExprs | undefined;
87
85
  } | undefined;
88
86
  /** Content a known child never reads, which no output renders. */
89
- pruned: boolean;
87
+ dropped: boolean;
90
88
  hasAbortSignal: boolean;
91
89
  /** Count of distinct `$signal` expression roots; analyze allocates each
92
90
  * root's abort id from this so translates read, never re-derive. */
@@ -102,6 +100,8 @@ export interface Section {
102
100
  optional: boolean;
103
101
  /** An `<if>` branch's place in its chain, the renderer index it renders as. */
104
102
  index?: number;
103
+ /** An `<await>` body, made with its owner: its promise settles into it. */
104
+ await?: true;
105
105
  } | undefined;
106
106
  content: null | {
107
107
  startType: ContentType;
@@ -120,31 +120,31 @@ declare module "@marko/compiler/dist/types" {
120
120
  }
121
121
  }
122
122
  export declare const sectionUtil: Sorted<Section>;
123
- export declare function startSection(path: t.NodePath<t.MarkoTagBody | t.Program>): Section | undefined;
124
- export declare function getOrCreateSection(path: t.NodePath<any>): Section;
123
+ export declare function ensureBodySection(path: t.NodePath<t.MarkoTagBody | t.Program>): Section | undefined;
124
+ export declare function ensureSection(path: t.NodePath<any>): Section;
125
125
  export declare function getSectionForBody(body: t.NodePath<t.MarkoTagBody | t.Program>): Section | undefined;
126
- export declare function removePrunedContent(tag: t.NodePath<t.MarkoTag>): void;
126
+ export declare function removeDroppedContent(tag: t.NodePath<t.MarkoTag>): void;
127
127
  export declare function getSection(path: t.NodePath): Section;
128
128
  export declare const getScopeIdIdentifier: (section: Section) => t.Identifier;
129
129
  export declare const getBranchRendererArgs: (section: Section) => [template?: t.Expression | undefined, walks?: t.Expression | undefined, setup?: t.Expression | undefined, params?: t.Expression | undefined], setBranchRendererArgs: (section: Section, value: [template?: t.Expression | undefined, walks?: t.Expression | undefined, setup?: t.Expression | undefined, params?: t.Expression | undefined]) => void;
130
130
  export declare function forEachSection(fn: (section: Section) => void): void;
131
- export declare function getContentClosures(section: Section): ReferencedBindings;
131
+ export declare function getDynamicTagContentClosures(section: Section): ReferencedBindings;
132
132
  export declare function forEachAncestorSection<A>(from: Section, to: Section, fn: (section: Section, arg: A) => void, arg: A): void;
133
133
  export declare function forEachSectionReverse(fn: (section: Section) => void): void;
134
- export declare function getNodeContentType(path: t.NodePath<t.Statement>, extraMember: "startType" | "endType", contentInfo?: Section["content"]): ContentType.Value | null;
135
- export declare function getRendererReason(section: Section): boolean | Sources;
136
- export declare function isResumedBranch(section: Section): section is Section & {
134
+ export declare function getNodeContentType(path: t.NodePath<t.Statement>, edge: "startType" | "endType"): ContentType.Value | null;
135
+ export declare function getRendererReason(section: Section): false | Sources;
136
+ export declare function isOptionalBranch(section: Section): section is Section & {
137
137
  branch: NonNullable<Section["branch"]>;
138
138
  };
139
- export declare function isImmediateOwner(section: Section, binding: Binding): boolean;
139
+ export declare function isInParentSection(binding: Binding, section: Section): boolean;
140
140
  export declare function isDirectClosure(section: Section, closure: Binding): boolean;
141
141
  export declare function isDynamicClosure(section: Section, closure: Binding): boolean;
142
142
  export declare function getDynamicClosureIndex(closure: Binding, closureSection: Section): number;
143
143
  export declare function getDirectClosures(section: Section): SortedOpt<Binding>;
144
- export declare function isSameOrChildSection(section: Section, other: Section): boolean;
144
+ export declare function isSameOrAncestorSection(section: Section, other: Section): boolean;
145
145
  export declare function getCommonSection(section: Section, other: Section): Section;
146
- export declare function finalizeParamReasonGroups(section: Section): void;
147
- export declare function ensureReasonGroups(reason: Section["reason"]): void;
146
+ export declare function ensureSectionReasonGroups(section: Section): void;
148
147
  export declare function getParamReasonGroupIndex(section: Section, group: ParamReasonGroup): number;
149
- export declare function groupParamsBySection(params: Sources["param"]): Map<Section, import("./optional").SortedOneMany<ParamBinding>>;
148
+ export declare function forEachParamGroup(params: Sources["param"], fn: (section: Section, group: ParamReasonGroup) => void): void;
149
+ export declare function reduceParamGroups<R>(params: Sources["param"], fn: (acc: R, section: Section, group: ParamReasonGroup) => R, initial: R): R;
150
150
  export declare function setReadsOwner(from: Section, to: Section): void;
@@ -1,4 +1,5 @@
1
1
  import type { types as t } from "@marko/compiler";
2
2
  import { type Section } from "./sections";
3
- export declare function addSetupExpr(section: Section, node?: t.Node): void;
3
+ export declare function addSetupExpr(section: Section, node: t.Node): void;
4
+ export declare function addSetupWork(section: Section): void;
4
5
  export declare function finalizeSetupWork(): void;
@@ -15,15 +15,15 @@ export interface Signal {
15
15
  /** None for a signal that runs on the scope alone. */
16
16
  value: t.Expression | undefined;
17
17
  }>;
18
- intersection: Opt<Signal>;
18
+ intersections: Opt<Signal>;
19
19
  /** Signals this one forwards into: they must declare first when the
20
20
  * forward simplifies to a bare, eagerly evaluated reference. */
21
21
  forwards: Opt<Signal>;
22
22
  render: t.Statement[];
23
23
  effect: t.Statement[];
24
24
  hasHTMLEffect: boolean;
25
- hasSideEffect: boolean;
26
- forcePersist: boolean;
25
+ storesValue: boolean;
26
+ forceStore: boolean;
27
27
  inline: {
28
28
  value: t.Expression | undefined;
29
29
  } | undefined;
@@ -35,11 +35,11 @@ export interface Signal {
35
35
  type closureSignalBuilder = (closure: Binding, render: t.Expression) => t.Expression;
36
36
  export type ClosureHop = {
37
37
  kind: "if";
38
- ref: Binding;
38
+ nodeBinding: Binding;
39
39
  index: number;
40
40
  } | {
41
41
  kind: "for";
42
- ref: Binding;
42
+ nodeBinding: Binding;
43
43
  };
44
44
  export declare const getSignals: (section: Section) => Map<unknown, Signal>;
45
45
  export declare function setClosureSignalBuilder(tag: t.NodePath<t.MarkoTag>, hop: ClosureHop, build?: closureSignalBuilder): void;
@@ -49,24 +49,26 @@ export declare function getContentClosureValues(bodySection: Section): {
49
49
  scope: t.Identifier;
50
50
  levels: t.Expression[];
51
51
  } | undefined;
52
- export declare function setScopeProperty(found: PlaceSlot | undefined, expression: t.Expression): string | undefined;
52
+ export declare function writeSlot(slot: PlaceSlot | undefined, expression: t.Expression): string | undefined;
53
53
  export declare function setSectionDebugVar(section: Section, accessor: string, name: string, loc: t.SourceLocation | null | undefined): void;
54
54
  export declare function addWriteScopeBuilder(section: Section, builder: (writeCall: t.Expression) => t.Expression): void;
55
55
  export declare const getHTMLSectionStatements: (section: Section) => t.Statement[];
56
+ declare const setReturnValueIdentifier: (section: Section, value: t.Identifier | undefined) => void;
57
+ export { setReturnValueIdentifier };
56
58
  export declare function getBindingGetterIdentifier(binding: Binding, getterSection: Getter["hoisted"]): t.Identifier;
57
59
  export declare function getSignal(section: Section, referencedBindings: ReferencedBindings, name?: string): Signal;
58
60
  export declare function initValue(binding: Binding, isLet?: boolean): Signal;
59
- export declare function signalHasStatements(signal: Signal): boolean;
60
- export declare function getSignalFn(signal: Signal): t.Expression;
61
+ export declare function signalHasWork(signal: Signal): boolean;
62
+ export declare function buildSignalFn(signal: Signal): t.Expression;
61
63
  export declare function getSignalValueIdentifier(signal: Signal): t.Identifier;
62
- export declare function replaceNullishAndEmptyFunctionsWith0(args: (t.Expression | undefined | false)[]): t.Expression[];
63
- export declare function addStatement(type: "render" | "effect", targetSection: Section, referencedBindings: ReferencedBindings, statement: t.Statement | t.Statement[], isPure?: boolean): void;
64
- export declare function addValue(targetSection: Section, referencedBindings: ReferencedBindings, signal: Signal, value?: t.Expression): void;
64
+ export declare function trimEmptyArgs(args: (t.Expression | undefined | false)[]): t.Expression[];
65
+ export declare function addStatement(type: "render" | "effect", targetSection: Section, expr: t.NodeExtra | undefined, statement: t.Statement | t.Statement[] | t.Expression, isPure?: boolean): void;
66
+ export declare function addTagStatement(tag: t.NodePath<t.MarkoTag>, statement: t.Statement): void;
67
+ export declare function addValue(targetSection: Section, expr: t.NodeExtra | undefined, signal: Signal, value?: t.Expression): void;
65
68
  export declare function getResumeRegisterId(section: Section, referencedBindings: string | ReferencedBindings, type?: string): string;
66
69
  export declare function writeSignals(section: Section): Set<Signal>;
67
70
  export declare function writeRegisteredFns(): void;
68
- export declare function addHTMLEffectCall(section: Section, referencedBindings?: ReferencedBindings): void;
69
- export declare function writeHTMLResumeStatements(path: t.NodePath<t.MarkoTagBody | t.Program>): void;
71
+ export declare function addHTMLEffectCall(section: Section, expr?: t.NodeExtra): void;
72
+ export declare function writeHTMLResumeStatements(path: t.NodePath<t.MarkoTag> | t.NodePath<t.Program>): void;
70
73
  export declare function getSetup(section: Section): Signal | undefined;
71
74
  export declare function replaceRegisteredFunctionNode(node: t.Node): t.CallExpression | t.ClassPrivateProperty | t.ClassProperty | t.Identifier | t.ObjectProperty | t.VariableDeclaration | undefined;
72
- export {};
@@ -1,4 +1,5 @@
1
1
  import { types as t } from "@marko/compiler";
2
+ export declare function replaceMethodNode(node: t.ClassMethod | t.ClassPrivateMethod | t.ObjectMethod, replacement: t.Expression): t.ClassPrivateProperty | t.ClassProperty | t.ObjectProperty;
2
3
  /**
3
4
  * Given any arbitrary function type will normalize method like functions into expressions.
4
5
  */
@@ -21,8 +21,8 @@ interface BaseSlot {
21
21
  /** The sources whose changes lead client code to read it after resume,
22
22
  * unset while nothing does. */
23
23
  reason: Reason | undefined;
24
- /** The expressions it holds or renders, whose sources its reason takes once
25
- * references finalize. */
24
+ /** The expressions it holds or renders (a param group's: what its call site
25
+ * passes the group), whose sources its reason takes. */
26
26
  reasonExprs: Opt<t.NodeExtra>;
27
27
  }
28
28
  export interface BindingSlot extends BaseSlot {
@@ -37,14 +37,14 @@ export interface SectionSlot extends BaseSlot {
37
37
  owner: Section;
38
38
  group: undefined;
39
39
  }
40
- export declare function getSlot(binding: Binding, kind?: BindingSlotKind, section?: Section, group?: ParamReasonGroup): Slot;
40
+ export declare function ensureSlot(binding: Binding, kind?: BindingSlotKind, section?: Section, group?: ParamReasonGroup): Slot;
41
41
  export declare function findSlot(binding: Binding): (BindingSlot & {
42
42
  kind: typeof SlotKind.Value;
43
43
  }) | undefined;
44
44
  export declare function findSlot<K extends BindingSlotKind>(binding: Binding, kind: K, section?: Section, group?: ParamReasonGroup): (BindingSlot & {
45
45
  kind: K;
46
46
  }) | undefined;
47
- export declare function getSectionSlot(owner: Section, kind: SectionSlotKind, section?: Section): Slot;
47
+ export declare function ensureSectionSlot(owner: Section, kind: SectionSlotKind, section?: Section): Slot;
48
48
  export declare function findSectionSlot<K extends SectionSlotKind>(owner: Section, kind: K, section?: Section): (SectionSlot & {
49
49
  kind: K;
50
50
  }) | undefined;
@@ -5,7 +5,5 @@ import { type Reason } from "./reasons";
5
5
  import { type Section } from "./sections";
6
6
  export declare function solveReasons(intersectionsBySection: Map<Section, Intersection[]>): void;
7
7
  export declare function getReasonForBinding(binding: Binding, properties?: Opt<string> | true): undefined | Reason;
8
- export declare function getValueReason(extra: t.NodeExtra): undefined | Reason;
9
8
  export declare function getReasonForExpr(extra: t.NodeExtra): undefined | Reason;
10
- export declare function readsValuesOnResume(expr: t.NodeExtra): boolean;
11
- export declare function addAlwaysRead(binding: Binding): void;
9
+ export declare function landsRetained(extra: t.NodeExtra): boolean;
@@ -1,5 +1,5 @@
1
1
  import { type Binding, type ParamBinding } from "./bindings";
2
- import { type SortedOpt } from "./optional";
2
+ import { Sorted, type SortedOpt } from "./optional";
3
3
  export interface Sources {
4
4
  state: SortedOpt<Binding>;
5
5
  param: SortedOpt<ParamBinding>;
@@ -13,6 +13,7 @@ export declare const globalSources: Sources;
13
13
  export declare function sharesSources(a: Binding, b: Binding): boolean;
14
14
  export declare function createSources(state: Sources["state"], param: Sources["param"], global?: Sources["global"], always?: Sources["always"]): Sources;
15
15
  export declare function withSources(sources: Sources, state: Sources["state"], param: Sources["param"]): Sources | undefined;
16
+ export declare const sourcesUtil: Sorted<Sources>;
16
17
  export declare function compareSources(a: Sources, b: Sources): number;
17
18
  export declare function mergeSources(a: Sources, b: undefined | Sources): Sources;
18
19
  export declare function mergeSources(a: undefined | Sources, b: Sources): Sources;
@@ -1,3 +1,5 @@
1
1
  import type { Section } from "./sections";
2
- export declare function createProgramState<T>(init: () => T): readonly [() => T, (value: T) => void];
3
- export declare function createSectionState<T = unknown>(key: string, init?: ((section: Section) => T) | (() => T)): readonly [(section: Section) => T, (section: Section, value: T) => void];
2
+ export declare function createOutputState<T>(init: () => T): readonly [() => T, (value: T) => void];
3
+ export declare function createAnalysisState<T>(init: () => T): readonly [() => T, (value: T) => void];
4
+ export declare function createOutputSectionState<T = unknown>(init?: ((section: Section) => T) | (() => T)): readonly [(section: Section) => T, (section: Section, value: T) => void];
5
+ export declare function createAnalysisSectionState<T = unknown>(init?: ((section: Section) => T) | (() => T)): readonly [(section: Section) => T, (section: Section, value: T) => void];
@@ -1,2 +1,4 @@
1
+ import { types as t } from "@marko/compiler";
1
2
  import { type Tag } from "@marko/compiler/babel-utils";
3
+ export declare function parseSingleStatement(tag: t.NodePath<t.MarkoTag>, msg: string): t.Statement;
2
4
  export declare function createStatementTag(keyword: "client" | "server" | "static"): Tag;
@@ -1,3 +1,4 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  export declare function isStaticText(node?: t.Node): boolean | undefined;
3
- export declare function getPrevStaticSibling(path: t.NodePath): t.Node;
3
+ export declare function followsStaticText(path: t.NodePath): boolean | undefined;
4
+ export declare function getStaticPlaceholderText(placeholder: t.MarkoPlaceholder): string | undefined;
@@ -1,6 +1,5 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  import { type Binding } from "./bindings";
3
- import * as Step from "./constants/step";
4
3
  import { type Section, type StructureNode, type StructureRef } from "./sections";
5
4
  export declare function enter(path: t.NodePath<any>): void;
6
5
  export declare function exit(path: t.NodePath<any>): void;
@@ -12,21 +11,12 @@ export declare function writeTextTo(path: t.NodePath<any>, value: string): void;
12
11
  export declare function node(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, binding?: Binding): StructureNode | undefined;
13
12
  export declare function marker(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, binding: Binding): void;
14
13
  export declare function controlFlowNode(tag: t.NodePath<t.MarkoTag>, section: Section): Binding;
15
- type ResolvedPart = string | t.Expression;
16
- interface ResolvedStructure {
17
- writes: ResolvedPart[];
18
- walks: ResolvedPart[];
19
- walkComment: string[];
20
- steps: Step.Value[];
21
- }
22
- export declare function resolveStructure(section: Section): ResolvedStructure;
23
14
  interface SectionMeta {
24
15
  walks: t.Expression | undefined;
25
16
  writes: t.Expression | undefined;
26
17
  }
27
18
  export declare const getSectionMeta: (section: Section) => SectionMeta;
28
19
  export declare function writeStructureExports(program: t.NodePath<t.Program>): void;
29
- export declare function getSectionMetaIdentifiers(section: Section): SectionMeta;
30
20
  /** `_content` strips trailing exit codes before it walks, so a renderer that
31
21
  * reaches the runtime through it never needs them on the wire. */
32
22
  export declare function trimTrailingExits(walks: t.Expression | undefined): 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 | undefined;
@@ -1,5 +1,6 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  import * as ContentType from "./constants/content-type";
3
+ import type { DOMRuntimeFeature, DOMRuntimeHelpers } from "./runtime";
3
4
  export interface TagFacts {
4
5
  /** What renders at its edges, `null` for nothing. */
5
6
  content: ContentType.Value | null | ((tag: t.MarkoTag) => ContentType.Value | null);
@@ -16,6 +17,12 @@ export interface TagFacts {
16
17
  * wrapper around content inside it is discarded. */
17
18
  discardsWrapperChildren?: true;
18
19
  }
20
+ export declare const controllableElements: Map<string, {
21
+ attrs: string[];
22
+ spreadHelper: DOMRuntimeHelpers;
23
+ feature: DOMRuntimeFeature;
24
+ }>;
19
25
  export declare function getTagFacts(tag: t.NodePath<t.MarkoTag>): TagFacts;
20
26
  export declare function getTagContentType(tag: t.NodePath<t.MarkoTag>): ContentType.Value | null;
21
- export declare function isNonHTMLText(child: t.NodePath<t.MarkoPlaceholder | t.MarkoText>): boolean;
27
+ export declare function isInTextBody(child: t.NodePath<t.MarkoPlaceholder | t.MarkoText>): boolean;
28
+ export declare function isControllableAttr(name: string): boolean;
@@ -0,0 +1,20 @@
1
+ import { types as t } from "@marko/compiler";
2
+ import type { LoadTrigger } from "../../html/assets";
3
+ declare module "@marko/compiler/dist/types" {
4
+ interface ImportDeclarationExtra {
5
+ tagImport?: string;
6
+ loadImport?: LoadImportConfig;
7
+ }
8
+ }
9
+ export type LoadImportConfig = {
10
+ render: true;
11
+ triggers?: never;
12
+ } | {
13
+ render: false;
14
+ triggers: LoadTrigger[];
15
+ };
16
+ export declare function importOrSelfReferenceName(file: t.BabelFile, request: string, name: string, nameHint?: string): t.Identifier;
17
+ export declare function isCircularRequest(file: t.BabelFile, request: string): boolean;
18
+ export declare function trackTagImport(tagImport: string): void;
19
+ export declare function getImportFacts(importDecl: t.NodePath<t.ImportDeclaration>): t.ImportDeclarationExtra & t.NodeExtra;
20
+ export declare function getLoadAttr(importDecl: t.NodePath<t.ImportDeclaration>): t.NodePath<t.ImportAttribute> | undefined;
@@ -1,6 +1,6 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type LoadImportConfig } from "../visitors/import-declaration";
3
2
  import * as TagNameType from "./constants/tag-name-type";
3
+ import { type LoadImportConfig } from "./tag-import";
4
4
  declare const kTagNameDynamic: unique symbol;
5
5
  declare module "@marko/compiler/dist/types" {
6
6
  interface ProgramExtra {
@@ -27,4 +27,11 @@ declare module "@marko/compiler/dist/types" {
27
27
  }
28
28
  type TagNameType = TagNameType.Value;
29
29
  export { TagNameType };
30
- export default function analyzeTagNameType(tag: t.NodePath<t.MarkoTag>, allowDynamic?: boolean): TagNameType.Value;
30
+ export default function analyzeTagNameType(tag: t.NodePath<t.MarkoTag>): TagNameType.Value;
31
+ export declare function getTagRelativePath(tag: t.NodePath<t.MarkoTag>): string;
32
+ /**
33
+ * A known wrong tag that resolves to nothing, eg `interface P { id: number }`,
34
+ * whose body lands in attribute position before tag resolution would run.
35
+ */
36
+ export declare function isUnresolvedKnownWrongTag(tag: t.NodePath<t.MarkoTag>): boolean;
37
+ export declare function tagNotFoundError(tag: t.NodePath<t.MarkoTag>): Error;
@@ -0,0 +1,3 @@
1
+ import { types as t } from "@marko/compiler";
2
+ export declare function toOnlyExpressionOrBlock(stmts: t.Statement[]): t.BlockStatement | t.Expression;
3
+ export declare function toOnlyStatementOrBlock(body: t.Statement[]): t.Statement;
@@ -1,5 +1,7 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  export declare function getMemberExpressionPropString(expr: t.MemberExpression | t.OptionalMemberExpression): string | undefined;
3
+ export declare function getLiteralName(node: t.Identifier | t.StringLiteral): string;
4
+ export declare function getLiteralName(node: t.Node): string | undefined;
3
5
  export declare function isValidPropertyIdentifier(name: string): boolean;
4
6
  export declare function toPropertyName(name: string): t.Identifier | t.NumericLiteral | t.StringLiteral;
5
7
  export declare function toObjectProperty(name: string, value: t.Expression): t.ObjectProperty;
@@ -1,19 +1,21 @@
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 AttrTagLookup } from "./nested-attribute-tags";
3
+ import { type AttrTagMeta, type AttrTagLookup } from "./nested-attribute-tags";
5
4
  import { type SortedOpt } from "./optional";
5
+ import { type ParamsTree } from "./params-tree";
6
6
  type ContentKey = "renderBody" | "content";
7
- export declare function translateAttrs(tag: t.NodePath<t.MarkoTag>, propTree?: BindingPropTree | true, skip?: SortedOpt<string>, statements?: t.Statement[], contentKey?: ContentKey): {
7
+ export declare function translateAttrs(tag: t.NodePath<t.MarkoTag>, paramsTree?: ParamsTree | true, skip?: SortedOpt<string>, statements?: t.Statement[], contentKey?: ContentKey): {
8
8
  properties: (t.ObjectMethod | t.ObjectProperty | t.SpreadElement)[];
9
9
  statements: t.Statement[];
10
10
  };
11
11
  export declare function getTranslatedBodyContentProperty(props: t.ObjectExpression["properties"]): (t.ObjectProperty & {
12
12
  value: t.Expression;
13
13
  }) | undefined;
14
- export declare function addDynamicAttrTagStatements(attrTags: t.NodePath<t.MarkoTag["attributeTags"][number]>[], index: number, attrTagLookup: AttrTagLookup, statements: t.Statement[], propTree: BindingPropTree | true, contentKey?: ContentKey): number;
14
+ export declare function addDynamicAttrTagStatements(attrTags: t.NodePath<t.MarkoTag["attributeTags"][number]>[], index: number, attrTagLookup: AttrTagLookup, statements: t.Statement[], paramsTree: ParamsTree | true, contentKey?: ContentKey): number;
15
+ export declare function addAttrTag(properties: t.ObjectExpression["properties"], { name, repeated }: AttrTagMeta, props: t.ObjectExpression): void;
16
+ export declare function appendAttrTag(prev: t.Expression | undefined | false, props: t.ObjectExpression): t.CallExpression;
15
17
  /** Unwraps a lone spread to the spread argument itself, so the result may alias
16
18
  * a caller binding; anything the runtime writes to needs its own object. */
17
19
  export declare function propsToExpression(props: t.ObjectExpression["properties"]): t.Expression;
18
- export declare function getSingleKnownSpread(attributes: (t.MarkoAttribute | t.MarkoSpreadAttribute)[]): Binding | undefined;
20
+ export declare function getSingleKnownSpread(paramsTree: ParamsTree | true, attributes: (t.MarkoAttribute | t.MarkoSpreadAttribute)[]): Binding | undefined;
19
21
  export {};
@@ -1,5 +1,7 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  import { type Binding } from "./bindings";
3
3
  export default function translateVar(tag: t.NodePath<t.MarkoTag>, initialValue: t.Expression, kind?: "let" | "const", statements?: t.Statement[]): void;
4
+ export declare function isTagVarAssigned(tag: t.NodePath<t.MarkoTag>): boolean;
5
+ export declare function buildVarChange(target: t.Expression, value: t.Expression, varBinding: Binding): t.CallExpression;
4
6
  export declare function getRestPattern(rest: Binding, id: t.Identifier, from: Binding, shorthand: boolean): t.ArrayPattern | t.ObjectPattern;
5
7
  export declare function withRestFallback(rest: Binding, from: Binding, value: t.Expression): t.Expression;
@@ -4,9 +4,8 @@ type VisitValue = null | void | t.Node | t.Node[];
4
4
  type VisitKeys<T> = (string | number) & (T extends T ? {
5
5
  [K in keyof T]: T[K] extends VisitValue ? K : never;
6
6
  }[keyof T] : never);
7
- export declare function traverseReplace<T, K extends VisitKeys<T>, S>(container: T, key: K, enter: (node: t.Node, state?: S) => t.Node | void, state?: S): void;
7
+ export declare function traverseReplace<T, K extends VisitKeys<T>, S>(container: T, key: K, exit: (node: t.Node, state?: S) => t.Node | void, state?: S): void;
8
8
  export declare function traverseContains(node: undefined | null | t.Node | t.Node[], check: (node: t.Node) => void | boolean | typeof skip): boolean;
9
- export declare function traverseFind(node: undefined | null | t.Node | t.Node[], check: (node: t.Node) => void | boolean | typeof skip): t.Node | undefined;
10
9
  export declare function traverseFindAwait(node: undefined | null | t.Node | t.Node[]): t.Node | undefined;
11
10
  export declare function traverse(visit: (node: t.Node, parent?: t.Node, grandParent?: t.Node) => void | typeof skip, node: undefined | t.Node | t.Node[], parent?: t.Node, grandParent?: t.Node): void;
12
11
  export {};
@@ -1,4 +1,5 @@
1
- import type { types as t } from "@marko/compiler";
1
+ import { types as t } from "@marko/compiler";
2
+ import type { Plugin } from "@marko/compiler/babel-utils";
2
3
  export type VisitorType = "migrate" | "transform" | "analyze" | "translate";
3
4
  export type TemplateVisitor<T extends t.Node> = Partial<Record<VisitorType, t.VisitNode<unknown, T>>>;
4
5
  export declare function extractVisitors<Visitors extends Partial<Record<keyof t.Visitor, TemplateVisitor<any>>>>(visitors: Visitors): Record<VisitorType, t.Visitor<unknown>>;
@@ -9,3 +10,5 @@ export declare function translateByTarget<T extends t.Node>({ html, dom, }: {
9
10
  readonly enter: (path: t.NodePath<T>) => void;
10
11
  readonly exit: (path: t.NodePath<T>) => void;
11
12
  };
13
+ export declare function enterHook<T extends t.Node>(modulePlugin: Plugin | void, path: t.NodePath<T>): void;
14
+ export declare function exitHook<T extends t.Node>(modulePlugin: Plugin | void, path: t.NodePath<T>): void;
@@ -1,2 +1,2 @@
1
1
  import type { types as t } from "@marko/compiler";
2
- export default function withPreviousLocation<T extends t.Node>(newNode: T, originalNode: t.Node): T;
2
+ export declare function withPreviousLocation<T extends t.Node>(newNode: T, originalNode: t.Node): T;
@@ -11,6 +11,6 @@ export declare function buildGroupMask(groups: {
11
11
  export declare function getScopeReasonStatement(section: Section): t.Statement;
12
12
  export declare function getWriteReason(binding: Binding): Sources | undefined;
13
13
  export declare function getBranchWriteReason(section: Section): Sources | undefined;
14
- export declare function getWriteGuard(section: Section, reason: undefined | Reason, optional: boolean): t.Expression | undefined;
15
- export declare function getWriteGuardForAny(section: Section, reasons: undefined | Reasons, optional: boolean): t.Expression | undefined;
14
+ export declare function getWriteGuard(section: Section, reason: undefined | Reason, omitUnconditional: boolean): t.Expression | undefined;
15
+ export declare function getWriteGuardForAny(section: Section, reasons: undefined | Reasons, omitUnconditional: boolean): t.Expression | undefined;
16
16
  export declare function getExprIfWritten<T extends undefined | Reason, R extends (T extends {} ? t.Expression : undefined)>(section: Section, reason: T, expr: t.Expression): R;
@@ -3,8 +3,7 @@ import { type Binding } from "./bindings";
3
3
  import type { Reason } from "./reasons";
4
4
  type Write = string | t.Expression | (() => undefined | string | t.Expression);
5
5
  export declare function writeTo(path: t.NodePath<any>, trailer?: boolean): (strs: TemplateStringsArray, ...exprs: Write[]) => void;
6
- export declare function consumeHTML(path: t.NodePath<any>): t.ExpressionStatement | undefined;
7
6
  export declare function flushBefore(path: t.NodePath<any>): void;
8
- export declare function flushInto(path: t.NodePath<t.MarkoTag> | t.NodePath<t.Program>): void;
7
+ export declare function flushInto(path: t.NodePath<t.MarkoTag> | t.NodePath<t.Program>): t.NodePath<t.MarkoTagBody | t.Program>;
9
8
  export declare function markNode(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, nodeBinding: Binding, reason: undefined | false | Reason, deferred?: boolean): void;
10
9
  export {};
@@ -1,11 +1,10 @@
1
1
  import { types as t } from "@marko/compiler";
2
- declare const kTagImport: unique symbol;
3
2
  declare module "@marko/compiler/dist/types" {
4
3
  interface ExportNamedDeclarationExtra {
5
- [kTagImport]?: string;
4
+ tagImport?: string;
6
5
  }
7
6
  interface ExportAllDeclarationExtra {
8
- [kTagImport]?: string;
7
+ tagImport?: string;
9
8
  }
10
9
  }
11
10
  declare const _default: {
@@ -1,40 +1,5 @@
1
1
  import { types as t } from "@marko/compiler";
2
- declare const kRegisteredExports: unique symbol;
3
- declare module "@marko/compiler/dist/types" {
4
- interface ProgramExtra {
5
- [kRegisteredExports]?: Map<string, RegisteredExport>;
6
- }
7
- }
8
- /**
9
- * An export registered under an id: the template that declares it, and the
10
- * canonical name it is exported under.
11
- */
12
- export interface RegisteredExport {
13
- registerId: string;
14
- exportName: string;
15
- filename: string;
16
- }
17
2
  declare const _default: {
18
3
  analyze(this: unknown, fn: t.NodePath<t.Function>): void;
19
4
  };
20
5
  export default _default;
21
- export declare function resolveFunctionReason(): void;
22
- export declare function finalizeFunctionRegistry(): void;
23
- /**
24
- * Tracks a template imported as a default export. The server writes a template
25
- * only as a binding's value, so the importing template registers it when one may.
26
- */
27
- export declare function trackImportedTemplate(importDecl: t.NodePath<t.ImportDeclaration>, local: string, templateFile: t.BabelFile): void;
28
- /**
29
- * Tracks an export imported from another template that registers under an id,
30
- * if it does. The importing template registers it (under that id) when client
31
- * code reads its own references.
32
- */
33
- export declare function trackImport(importDecl: t.NodePath<t.ImportDeclaration>, local: string, registered: RegisteredExport | undefined, fnRoots?: Set<t.NodeExtra>): void;
34
- /**
35
- * Finds the id reserved for an export, following `export ... from` hops. Each
36
- * template only records the exports it declares, so this resolves on demand:
37
- * a template in an import cycle is read while it is still analyzing, and would
38
- * hand out an incomplete map if the ids were pushed ahead of time.
39
- */
40
- export declare function resolveRegisteredExport(file: t.BabelFile, exportName: string, seen?: Set<string>): RegisteredExport | undefined;
@@ -1,25 +1,11 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  import type { LoadTrigger } from "../../html/assets";
3
- import { type RegisteredExport } from "./function";
4
3
  declare module "@marko/compiler/dist/types" {
5
4
  interface ProgramExtra {
6
5
  /** Absolute filenames of templates this one imports with `load`. */
7
6
  loadImports?: Set<string>;
8
7
  }
9
- interface ImportDeclarationExtra {
10
- tagImport?: string;
11
- loadImport?: LoadImportConfig;
12
- /** Each local binding the template registers -> the export it imports. */
13
- registeredImports?: Map<string, RegisteredExport>;
14
- }
15
8
  }
16
- export type LoadImportConfig = {
17
- render: true;
18
- triggers?: never;
19
- } | {
20
- render: false;
21
- triggers: LoadTrigger[];
22
- };
23
9
  declare const _default: {
24
10
  analyze(this: unknown, importDecl: t.NodePath<t.ImportDeclaration>): void;
25
11
  translate: {
@@ -27,4 +13,4 @@ declare const _default: {
27
13
  };
28
14
  };
29
15
  export default _default;
30
- export declare function getImportFacts(importDecl: t.NodePath<t.ImportDeclaration>): t.ImportDeclarationExtra & t.NodeExtra;
16
+ export declare function ensureHtmlLoadWrapped(loadFile: t.BabelFile, getTemplate: () => t.Identifier, triggers: LoadTrigger[] | undefined): string;
@@ -13,7 +13,8 @@ declare const _default: {
13
13
  exit(this: unknown, placeholder: t.NodePath<t.MarkoPlaceholder>): void;
14
14
  };
15
15
  translate: {
16
- exit(this: unknown, placeholder: t.NodePath<t.MarkoPlaceholder>): void;
16
+ exit: typeof translateExit;
17
17
  };
18
18
  };
19
19
  export default _default;
20
+ declare function translateExit(placeholder: t.NodePath<t.MarkoPlaceholder>): void;
@@ -1,5 +1,4 @@
1
1
  import { types as t } from "@marko/compiler";
2
- export declare function getTemplateContentName(): string;
3
2
  declare const _default: {
4
3
  translate: {
5
4
  enter(): void;