marko 6.4.6 → 6.4.8

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 (88) hide show
  1. package/cheatsheet.md +2 -1
  2. package/dist/common/errors.d.ts +1 -0
  3. package/dist/debug/dom/catch.feat.js +2 -2
  4. package/dist/debug/dom/catch.feat.mjs +2 -2
  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 +1 -1
  14. package/dist/debug/dom/controllable.feat.mjs +1 -1
  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 +2 -2
  18. package/dist/debug/dom/dynamic-tag-var.feat.mjs +2 -2
  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-o9jQjchF.mjs → dom-CFCBDift.mjs} +97 -99
  24. package/dist/debug/{dom-CNgQ6lj9.js → dom-D8znnhpf.js} +102 -104
  25. package/dist/debug/dom.js +18 -19
  26. package/dist/debug/dom.mjs +19 -19
  27. package/dist/debug/html.js +15 -12
  28. package/dist/debug/html.mjs +15 -13
  29. package/dist/dom/catch.feat.js +3 -3
  30. package/dist/dom/catch.feat.mjs +2 -2
  31. package/dist/dom/control-flow.d.ts +1 -1
  32. package/dist/dom/controllable-input.feat.js +1 -1
  33. package/dist/dom/controllable-input.feat.mjs +1 -1
  34. package/dist/dom/controllable-open.feat.js +1 -1
  35. package/dist/dom/controllable-open.feat.mjs +1 -1
  36. package/dist/dom/controllable-select.feat.js +1 -1
  37. package/dist/dom/controllable-select.feat.mjs +1 -1
  38. package/dist/dom/controllable-textarea.feat.js +1 -1
  39. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  40. package/dist/dom/controllable.feat.js +1 -1
  41. package/dist/dom/controllable.feat.mjs +1 -1
  42. package/dist/dom/dynamic-tag-script.feat.js +2 -2
  43. package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
  44. package/dist/dom/dynamic-tag-var.feat.js +3 -3
  45. package/dist/dom/dynamic-tag-var.feat.mjs +2 -2
  46. package/dist/dom/lazy.feat.js +1 -1
  47. package/dist/dom/lazy.feat.mjs +1 -1
  48. package/dist/dom/placeholder.feat.js +2 -2
  49. package/dist/dom/placeholder.feat.mjs +1 -1
  50. package/dist/dom/renderer.d.ts +1 -3
  51. package/dist/dom/resume.d.ts +2 -3
  52. package/dist/dom/signals.d.ts +2 -7
  53. package/dist/{dom-60R4bRWD.js → dom-Bpkm72vV.js} +123 -132
  54. package/dist/{dom-Ci2W4l1P.mjs → dom-CVAevsbz.mjs} +77 -81
  55. package/dist/dom.d.ts +1 -1
  56. package/dist/dom.js +33 -33
  57. package/dist/dom.mjs +19 -19
  58. package/dist/html/assets.d.ts +1 -1
  59. package/dist/html/control-flow.d.ts +1 -1
  60. package/dist/html/inlined-runtimes.d.ts +2 -2
  61. package/dist/html/inlined-runtimes.debug.d.ts +2 -2
  62. package/dist/html/template.d.ts +1 -1
  63. package/dist/html.d.ts +1 -1
  64. package/dist/html.js +16 -19
  65. package/dist/html.mjs +16 -19
  66. package/dist/translator/index.js +6201 -5997
  67. package/dist/translator/util/assert.d.ts +7 -0
  68. package/dist/translator/util/bindings.d.ts +11 -3
  69. package/dist/translator/util/cyclic-memo.d.ts +6 -2
  70. package/dist/translator/util/entry-builder.d.ts +0 -1
  71. package/dist/translator/util/finalize-references.d.ts +4 -2
  72. package/dist/translator/util/for-selector.d.ts +1 -1
  73. package/dist/translator/util/generate-uid.d.ts +1 -0
  74. package/dist/translator/util/known-tag.d.ts +10 -3
  75. package/dist/translator/util/optional.d.ts +1 -1
  76. package/dist/translator/util/reasons.d.ts +5 -3
  77. package/dist/translator/util/references.d.ts +4 -0
  78. package/dist/translator/util/sections.d.ts +10 -9
  79. package/dist/translator/util/signals.d.ts +3 -3
  80. package/dist/translator/util/slots.d.ts +2 -2
  81. package/dist/translator/util/solve-reasons.d.ts +1 -0
  82. package/dist/translator/util/state.d.ts +4 -2
  83. package/dist/translator/util/write-guard.d.ts +2 -1
  84. package/dist/translator/visitors/import-declaration.d.ts +2 -0
  85. package/dist/translator/visitors/program/pre-analyze.d.ts +2 -0
  86. package/dist/translator/visitors/tag/dynamic-tag.d.ts +1 -0
  87. package/package.json +4 -4
  88. package/tags-html.d.ts +3 -0
@@ -1,4 +1,5 @@
1
1
  import { types as t } from "@marko/compiler";
2
+ import { type ForType } from "./branch-tag";
2
3
  export declare function assertNoSpreadAttrs(tag: t.NodePath<t.MarkoTag>): void;
3
4
  export declare function assertOnlyValueAttr(tag: t.NodePath<t.MarkoTag>, required: true, change?: boolean, hint?: (attr: t.MarkoAttribute) => string | undefined): t.MarkoAttribute;
4
5
  export declare function assertOnlyValueAttr(tag: t.NodePath<t.MarkoTag>, required?: boolean, change?: boolean, hint?: (attr: t.MarkoAttribute) => string | undefined): t.MarkoAttribute | undefined;
@@ -9,3 +10,9 @@ export declare function assertHasBody(tag: t.NodePath<t.MarkoTag>): void;
9
10
  export declare function assertNoBodyContent(tag: t.NodePath<t.MarkoTag>): void;
10
11
  export declare function buildAttrsError(tag: t.NodePath<t.MarkoTag>, attrs: t.MarkoTag["attributes"], msg: string): Error;
11
12
  export declare function buildAttrNameError(tag: t.NodePath<t.MarkoTag>, attr: t.MarkoAttribute, msg: string): Error;
13
+ /** The loop a `<for>` tag's attributes run, which it requires. */
14
+ export declare function assertForType(tag: t.NodePath<t.MarkoTag>): ForType;
15
+ /** The attributes a loop of `type` takes, besides `by=`. */
16
+ export declare function getForAttrs(type: ForType): string[];
17
+ /** Throws for a param that a loop of `type` never supplies. */
18
+ export declare function assertForParams(tag: t.NodePath<t.MarkoTag>, type: ForType): void;
@@ -2,6 +2,7 @@ import { types as t } from "@marko/compiler";
2
2
  import { ReservedId } from "../../common/types";
3
3
  import * as BindingType from "./constants/binding-type";
4
4
  import { type Opt, type SortedMany, type SortedOpt, Sorted } from "./optional";
5
+ import { type KnownExprs } from "./reasons";
5
6
  import { type AssignedBindingExtra, type Read, type ReferencedExtra } from "./references";
6
7
  import { type Section } from "./sections";
7
8
  import { type Sources } from "./sources";
@@ -52,9 +53,16 @@ export interface Binding {
52
53
  /** For an array rest, the source index it starts at: `rest[0]` of
53
54
  * `[a, ...rest]` is the source's `[1]`. */
54
55
  restOffset: number | undefined;
55
- /** For a tag variable a child's `<return>` writes, the node binding of the
56
- * tag rendering that child. */
57
- returnedBy: Binding | undefined;
56
+ /** For a tag variable a `<return>` writes, the call's scope binding and, for
57
+ * a known tag, its body and the expressions it passes. */
58
+ returnedBy: {
59
+ scope: Binding;
60
+ section?: Section;
61
+ exprs?: KnownExprs;
62
+ } | undefined;
63
+ /** For the node a control flow tag renders at, the bodies it renders there:
64
+ * an `<if>` chain's in order, a loop's, an `<await>`'s, a `<try>`'s. */
65
+ branchBodies: Opt<Section>;
58
66
  /** Scope ids it holds right after its own, up to its highest `ReservedId`:
59
67
  * a controllable `<let>`'s change handler, or a tag's scope offset. */
60
68
  reserveSize: number;
@@ -1,4 +1,8 @@
1
1
  import { type Opt } from "./optional";
2
2
  export declare function createCyclicMemo<K extends object, R>(compute: (key: K) => R, cycleAnswer: R): (key: K) => R;
3
- export type MemoPath = Opt<string> | true;
4
- export declare function createCyclicPathMemo<K extends object, R>(compute: (key: K, path: MemoPath) => R, cycleAnswer: R): (key: K, path: MemoPath) => R;
3
+ export declare function createAnalysisMemo<K extends object, R>(compute: (key: K) => R, cycleAnswer: R): readonly [(key: K) => R, () => void];
4
+ export declare function createPassMemo<K extends object, R>(compute: (key: K) => R, cycleAnswer: R): (key: K) => R;
5
+ export declare function resetPassMemos(): void;
6
+ type MemoPath = Opt<string> | true;
7
+ export declare function createPassPathMemo<K extends object, R>(compute: (key: K, path: MemoPath) => R, cycleAnswer: R): (key: K, path: MemoPath) => R;
8
+ export {};
@@ -1,7 +1,6 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  declare module "@marko/compiler/dist/types" {
3
3
  interface ProgramExtra {
4
- needsCompat?: boolean;
5
4
  isInteractive?: boolean;
6
5
  hasClientStatement?: boolean;
7
6
  page?: boolean;
@@ -1,5 +1,7 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type Binding } from "./bindings";
3
- export declare function finalizeReferences(): void;
2
+ import { type Binding, type Intersection } from "./bindings";
3
+ import { type Section } from "./sections";
4
+ export declare function finalizeReferences(): Map<Section, Intersection[]>;
5
+ export declare function allocateIds(intersectionsBySection: Map<Section, Intersection[]>): void;
4
6
  export declare function readsValuesOnResume(expr: t.NodeExtra): boolean;
5
7
  export declare function hasEmittedAssignment(binding: Binding): boolean;
@@ -1,5 +1,5 @@
1
1
  import { type Binding } from "./bindings";
2
2
  import { type Section } from "./sections";
3
- export declare function getForSelectorKey(bodySection: Section, closure: Binding): Binding | undefined;
3
+ export declare function isForSelectorClosure(bodySection: Section, closure: Binding): boolean;
4
4
  export declare function isForSelectorValue(binding: Binding): boolean;
5
5
  export declare function detectForSelector(bodySection: Section, keyBinding: Binding): void;
@@ -10,5 +10,6 @@ export declare function generateUid(name?: string): string;
10
10
  export declare function generateUidIdentifier(name?: string): t.Identifier;
11
11
  export declare function declareConstBefore(tag: t.NodePath<t.MarkoTag>, name: string, expr: t.Expression): t.Identifier;
12
12
  export declare function ensureSharedUid(name: string, section?: Section): string;
13
+ export declare function getUnusedParamIdentifier(): t.Identifier;
13
14
  export declare function hasSharedUid(name: string): boolean;
14
15
  export {};
@@ -1,25 +1,32 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type Binding } from "./bindings";
2
+ import { type Binding, type ParamBinding } from "./bindings";
3
3
  import { type ParamsTree } from "./params-tree";
4
4
  import { type KnownExprs } from "./reasons";
5
5
  import { type Section } from "./sections";
6
- declare const kChildSection: unique symbol;
6
+ import { type Sources } from "./sources";
7
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
11
  /** The dom binding a known tag holds its child's scope in. */
12
12
  childScopeBinding?: Binding;
13
- [kChildSection]?: Section;
13
+ /** The section a known tag renders: another template's, a `<define>` body. */
14
+ childSection?: Section;
14
15
  /** The child's params tree the call site was analyzed against. */
15
16
  [kParamsTree]?: ParamsTree;
16
17
  [kKnownExprs]?: KnownExprs;
17
18
  }
18
19
  }
20
+ export interface KnownTagExtra extends t.MarkoTagExtra {
21
+ childScopeBinding: Binding;
22
+ childSection: Section;
23
+ }
19
24
  export declare function knownTagAnalyze(tag: t.NodePath<t.MarkoTag>, childSection: Section, childParamsTree?: ParamsTree): void;
20
25
  export declare function analyzeRecursiveTags(): void;
21
26
  export declare function knownTagTranslateHTML(tag: t.NodePath<t.MarkoTag>, tagIdentifier: t.Expression): void;
22
27
  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;
28
+ export declare function getCallSiteSources(param: ParamBinding): Sources | undefined;
29
+ export declare function addTagVarBindings(section: Section): void;
23
30
  export declare function addKnownTagReasons(section: Section): void;
24
31
  export declare function callsOtherTemplateSetup(section: Section): boolean;
25
32
  export {};
@@ -32,7 +32,7 @@ export declare function filter<T>(data: Opt<T>, cb: (item: T) => boolean): Opt<T
32
32
  export declare function forEach<T>(data: Opt<T>, cb: (item: T, index: number) => void): void;
33
33
  export declare function fromIter<T>(data: Iterable<T>): T | Many<T> | undefined;
34
34
  export declare function find<T>(data: Opt<T>, cb: (item: T, index: number) => boolean): Opt<T>;
35
- export declare function some<T>(data: Opt<T>, cb: (item: T, index: number) => boolean): boolean;
35
+ export declare function some<T>(data: Opt<T>, cb: (item: T, index: number) => unknown): boolean;
36
36
  export declare function every<T>(data: Opt<T>, cb: (item: T, index: number) => boolean): boolean;
37
37
  export declare function reduce<T, R>(data: Opt<T>, cb: (acc: R | undefined, item: T, index: number) => R | undefined): R | undefined;
38
38
  export declare function reduce<T, R>(data: Opt<T>, cb: (acc: R, item: T, index: number) => R, initial: R): R;
@@ -10,11 +10,11 @@ export declare function addReason(slot: Slot, reason: undefined | false | Reason
10
10
  export declare function addAlwaysReason(binding: Binding): void;
11
11
  export declare function addReasonExprs(slot: Slot, expr: Opt<t.NodeExtra>): void;
12
12
  export declare function addOwnerReason(from: Section, to: Section, reason: undefined | false | Reason): void;
13
- export declare function isConditionalReason(reason: undefined | Reason): reason is Sources & {
13
+ export declare function mapBodyParams(section: Section, reason: undefined | Reason, seen?: Set<ParamBinding>): Reason | undefined;
14
+ export declare function isGuardedReason(reason: undefined | Reason): reason is Sources & {
14
15
  state: undefined;
15
16
  always: undefined;
16
17
  };
17
- export declare function isUnconditionalReason(reason: undefined | Reason): reason is Reason;
18
18
  export declare function isStateReason(reason: undefined | Reason): reason is Sources;
19
19
  export declare function getSourcesForExpr(expr: t.NodeExtra): Sources | undefined;
20
20
  export declare function getSourcesForExprs(exprs: Opt<t.NodeExtra> | boolean): Sources | undefined;
@@ -25,8 +25,10 @@ export interface KnownExprs {
25
25
  known?: Record<string, KnownExprs>;
26
26
  value?: t.NodeExtra;
27
27
  }
28
- export declare function mapParamReasonToExpr(exprs: KnownExprs, reason: boolean | Opt<ParamBinding>): true | import("./optional").Many<t.NodeExtra> | t.NodeExtra | undefined;
28
+ export declare function mapParamReasonToExpr(exprs: KnownExprs, reason: Opt<ParamBinding>): Opt<t.NodeExtra>;
29
+ export declare function mapParamReasonToExpr(exprs: KnownExprs, reason: boolean | Opt<ParamBinding>): Opt<t.NodeExtra> | true;
29
30
  export declare function mapParamBindingToExpr(exprs: KnownExprs, binding: ParamBinding): Opt<t.NodeExtra>;
31
+ export declare function getKnownExprsAt(exprs: KnownExprs, binding: Binding): KnownExprs;
30
32
  export declare function applyReasonExprs(section: Section): void;
31
33
  export declare function mergeSlotReasons(section: Section): void;
32
34
  export declare function getNodeReasons(section: Section): Sources | import("./optional").SortedMany<Sources> | undefined;
@@ -31,6 +31,8 @@ declare module "@marko/compiler/dist/types" {
31
31
  interface ProgramExtra {
32
32
  /** An expression reads `$global`, so HTML output declares a const for it. */
33
33
  hasGlobalRead?: true;
34
+ /** The template's `$global`: a signal-inert root binding, made on its first read. */
35
+ globalBinding?: Binding;
34
36
  }
35
37
  interface MarkoTagExtra {
36
38
  /** The dom binding the tag is addressed by: its node or marker; an only
@@ -61,6 +63,8 @@ declare module "@marko/compiler/dist/types" {
61
63
  assignment?: Binding;
62
64
  assignmentTo?: Binding;
63
65
  read?: ResolvedRead;
66
+ /** An expression root that is a dynamic tag's name, not one of its inputs. */
67
+ tagName?: true;
64
68
  dropped?: true;
65
69
  /** The expression this node sits in: dropped or merged as one. */
66
70
  exprRoot?: NodeExtra;
@@ -3,6 +3,7 @@ import { type Binding, type Intersection, type IntersectionMeta, type ParamBindi
3
3
  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
+ import type { KnownTagExtra } from "./known-tag";
6
7
  import { type OneMany, type Opt, Sorted, type SortedOpt } from "./optional";
7
8
  import { type KnownExprs, type Reason } from "./reasons";
8
9
  import { type Slot } from "./slots";
@@ -59,10 +60,7 @@ export interface Section {
59
60
  hoisted: ReferencedBindings;
60
61
  /** The closures its `<for>` rows read only by comparing them to the row's
61
62
  * key, which a row selector updates. */
62
- selector: {
63
- key: Binding;
64
- closures: Set<Binding>;
65
- } | undefined;
63
+ selector: Set<Binding> | undefined;
66
64
  /** The canonical intersections its work waits on, once ids allocate. */
67
65
  intersections: Map<Intersection, IntersectionMeta> | undefined;
68
66
  /** The slots of its scope, its own and its bindings'. */
@@ -73,9 +71,11 @@ export interface Section {
73
71
  returnValueExpr: t.NodeExtra | undefined;
74
72
  isHoistThrough: true | undefined;
75
73
  branchExpr: t.NodeExtra | undefined;
76
- /** For a `<define>` body or a template rendering itself, the sections whose
77
- * direct calls render it. */
78
- callSections: SortedOpt<Section>;
74
+ /** For a `<define>` body or a template rendering itself, the known tags whose
75
+ * direct calls render it (each in its child scope binding's section). */
76
+ calls: Opt<KnownTagExtra>;
77
+ /** The known tags rendering in it, in analyze order. */
78
+ knownTags: KnownTagExtra[] | undefined;
79
79
  /** The content's rendering tag (its extra), and each child binding that
80
80
  * derives from the content, at `properties`. */
81
81
  derives: {
@@ -101,6 +101,8 @@ export interface Section {
101
101
  optional: boolean;
102
102
  /** An `<if>` branch's place in its chain, the renderer index it renders as. */
103
103
  index?: number;
104
+ /** An `<await>` body, made with its owner: its promise settles into it. */
105
+ await?: true;
104
106
  } | undefined;
105
107
  content: null | {
106
108
  startType: ContentType;
@@ -127,7 +129,7 @@ export declare function getSection(path: t.NodePath): Section;
127
129
  export declare const getScopeIdIdentifier: (section: Section) => t.Identifier;
128
130
  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;
129
131
  export declare function forEachSection(fn: (section: Section) => void): void;
130
- export declare function getDynamicTagContentClosures(section: Section): ReferencedBindings;
132
+ export declare function getDynamicTagContentClosures(section: Section): SortedOpt<Binding>;
131
133
  export declare function forEachAncestorSection<A>(from: Section, to: Section, fn: (section: Section, arg: A) => void, arg: A): void;
132
134
  export declare function forEachSectionReverse(fn: (section: Section) => void): void;
133
135
  export declare function getNodeContentType(path: t.NodePath<t.Statement>, edge: "startType" | "endType"): ContentType.Value | null;
@@ -143,7 +145,6 @@ export declare function getDirectClosures(section: Section): SortedOpt<Binding>;
143
145
  export declare function isSameOrAncestorSection(section: Section, other: Section): boolean;
144
146
  export declare function getCommonSection(section: Section, other: Section): Section;
145
147
  export declare function ensureSectionReasonGroups(section: Section): void;
146
- export declare function ensureReasonGroups(reason: Section["reason"]): void;
147
148
  export declare function getParamReasonGroupIndex(section: Section, group: ParamReasonGroup): number;
148
149
  export declare function forEachParamGroup(params: Sources["param"], fn: (section: Section, group: ParamReasonGroup) => void): void;
149
150
  export declare function reduceParamGroups<R>(params: Sources["param"], fn: (acc: R, section: Section, group: ParamReasonGroup) => R, initial: R): R;
@@ -62,13 +62,13 @@ export declare function signalHasWork(signal: Signal): boolean;
62
62
  export declare function buildSignalFn(signal: Signal): t.Expression;
63
63
  export declare function getSignalValueIdentifier(signal: Signal): t.Identifier;
64
64
  export declare function trimEmptyArgs(args: (t.Expression | undefined | false)[]): t.Expression[];
65
- export declare function addStatement(type: "render" | "effect", targetSection: Section, referencedBindings: ReferencedBindings, statement: t.Statement | t.Statement[] | t.Expression, isPure?: boolean): void;
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
66
  export declare function addTagStatement(tag: t.NodePath<t.MarkoTag>, statement: t.Statement): void;
67
- export declare function addValue(targetSection: Section, referencedBindings: ReferencedBindings, signal: Signal, value?: t.Expression): void;
67
+ export declare function addValue(targetSection: Section, expr: t.NodeExtra | undefined, signal: Signal, value?: t.Expression): void;
68
68
  export declare function getResumeRegisterId(section: Section, referencedBindings: string | ReferencedBindings, type?: string): string;
69
69
  export declare function writeSignals(section: Section): Set<Signal>;
70
70
  export declare function writeRegisteredFns(): void;
71
- export declare function addHTMLEffectCall(section: Section, referencedBindings?: ReferencedBindings): void;
71
+ export declare function addHTMLEffectCall(section: Section, expr?: t.NodeExtra): void;
72
72
  export declare function writeHTMLResumeStatements(path: t.NodePath<t.MarkoTag> | t.NodePath<t.Program>): void;
73
73
  export declare function getSetup(section: Section): Signal | undefined;
74
74
  export declare function replaceRegisteredFunctionNode(node: t.Node): t.CallExpression | t.ClassPrivateProperty | t.ClassProperty | t.Identifier | t.ObjectProperty | t.VariableDeclaration | undefined;
@@ -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 {
@@ -6,4 +6,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
8
  export declare function getReasonForExpr(extra: t.NodeExtra): undefined | Reason;
9
+ export declare function bindingLandsRetained(binding: Binding, properties: Opt<string>): boolean;
9
10
  export declare function landsRetained(extra: t.NodeExtra): boolean;
@@ -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];
@@ -13,4 +13,5 @@ export declare function getWriteReason(binding: Binding): Sources | undefined;
13
13
  export declare function getBranchWriteReason(section: Section): Sources | undefined;
14
14
  export declare function getWriteGuard(section: Section, reason: undefined | Reason, omitUnconditional: boolean): t.Expression | undefined;
15
15
  export declare function getWriteGuardForAny(section: Section, reasons: undefined | Reasons, omitUnconditional: boolean): t.Expression | undefined;
16
- export declare function getExprIfWritten<T extends undefined | Reason, R extends (T extends {} ? t.Expression : undefined)>(section: Section, reason: T, expr: t.Expression): R;
16
+ export declare function getExprIfWritten(section: Section, reason: undefined | Reason, expr: t.Expression): t.Expression | undefined;
17
+ export declare function isEverWritten(section: Section, reason: undefined | Reason): boolean;
@@ -1,4 +1,5 @@
1
1
  import { types as t } from "@marko/compiler";
2
+ import type { LoadTrigger } from "../../html/assets";
2
3
  declare module "@marko/compiler/dist/types" {
3
4
  interface ProgramExtra {
4
5
  /** Absolute filenames of templates this one imports with `load`. */
@@ -12,3 +13,4 @@ declare const _default: {
12
13
  };
13
14
  };
14
15
  export default _default;
16
+ export declare function ensureHtmlLoadWrapped(loadFile: t.BabelFile, getTemplate: () => t.Identifier, triggers: LoadTrigger[] | undefined): string;
@@ -6,3 +6,5 @@ declare module "@marko/compiler/dist/types" {
6
6
  }
7
7
  }
8
8
  export declare function preAnalyze(program: t.NodePath<t.Program>): void;
9
+ /** A `<const>` tag declaring `id` as `expr`. */
10
+ export declare function toConstTag(id: t.LVal, expr: t.Expression): t.MarkoTag;
@@ -1,6 +1,7 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  import { type Section } from "../../util/sections";
3
3
  import * as ClassHydration from "./constants/class-hydration";
4
+ export declare const needsCompat: () => boolean, setNeedsCompat: (value: boolean) => void;
4
5
  type ClassHydration = ClassHydration.Value;
5
6
  declare module "@marko/compiler" {
6
7
  interface MarkoMeta {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.4.6",
3
+ "version": "6.4.8",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",
@@ -51,14 +51,14 @@
51
51
  }
52
52
  },
53
53
  "dependencies": {
54
- "@marko/compiler": "^5.42.12",
54
+ "@marko/compiler": "^5.42.14",
55
55
  "csstype": "^3.2.3",
56
56
  "fastest-levenshtein": "^1.0.16",
57
57
  "magic-string": "^0.30.21"
58
58
  },
59
59
  "devDependencies": {
60
- "@marko/runtime-tags": "npm:marko@6.4.6",
61
- "marko": "5.39.46"
60
+ "@marko/runtime-tags": "npm:marko@6.4.8",
61
+ "marko": "5.39.48"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=22"
package/tags-html.d.ts CHANGED
@@ -97,6 +97,7 @@ declare global {
97
97
  search: NativeTag<Marko.HTML.Search, HTMLElement>;
98
98
  section: NativeTag<Marko.HTML.Section, HTMLElement>;
99
99
  select: NativeTag<Marko.HTML.Select, HTMLSelectElement>;
100
+ selectedcontent: NativeTag<Marko.HTML.SelectedContent, HTMLElement>;
100
101
  slot: NativeTag<Marko.HTML.Slot, HTMLSlotElement>;
101
102
  small: NativeTag<Marko.HTML.Small, HTMLElement>;
102
103
  source: NativeTag<Marko.HTML.Source, HTMLSourceElement>;
@@ -2056,6 +2057,8 @@ declare global {
2056
2057
  ) => void);
2057
2058
  }
2058
2059
 
2060
+ interface SelectedContent extends HTMLAttributes<HTMLElement> {}
2061
+
2059
2062
  interface Slot extends HTMLAttributes<HTMLSlotElement> {
2060
2063
  /**
2061
2064
  * Used to assign slots to other elements