marko 6.4.0 → 6.4.2

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 (130) hide show
  1. package/cheatsheet.md +2 -2
  2. package/dist/common/constants/accessor-prefix.d.ts +1 -0
  3. package/dist/common/constants/accessor-prefix.debug.d.ts +1 -0
  4. package/dist/common/constants/reserved-id.d.ts +5 -0
  5. package/dist/common/errors.d.ts +2 -1
  6. package/dist/common/opt.d.ts +1 -0
  7. package/dist/common/types.d.ts +3 -0
  8. package/dist/debug/dom/catch.feat.js +1 -1
  9. package/dist/debug/dom/catch.feat.mjs +1 -1
  10. package/dist/debug/dom/controllable-input.feat.js +1 -1
  11. package/dist/debug/dom/controllable-input.feat.mjs +1 -1
  12. package/dist/debug/dom/controllable-open.feat.js +1 -1
  13. package/dist/debug/dom/controllable-open.feat.mjs +1 -1
  14. package/dist/debug/dom/controllable-select.feat.js +1 -1
  15. package/dist/debug/dom/controllable-select.feat.mjs +1 -1
  16. package/dist/debug/dom/controllable-textarea.feat.js +1 -1
  17. package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
  18. package/dist/debug/dom/controllable.feat.js +1 -1
  19. package/dist/debug/dom/controllable.feat.mjs +1 -1
  20. package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
  21. package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
  22. package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
  23. package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
  24. package/dist/debug/dom/lazy.feat.js +1 -1
  25. package/dist/debug/dom/lazy.feat.mjs +1 -1
  26. package/dist/debug/dom/placeholder.feat.js +1 -1
  27. package/dist/debug/dom/placeholder.feat.mjs +1 -1
  28. package/dist/debug/{dom-BRO5aArp.js → dom-BLbR0hEx.js} +62 -16
  29. package/dist/debug/{dom-Btj2QJhk.mjs → dom-Cii0IA92.mjs} +51 -17
  30. package/dist/debug/dom.js +7 -4
  31. package/dist/debug/dom.mjs +6 -5
  32. package/dist/debug/html.js +551 -292
  33. package/dist/debug/html.mjs +548 -290
  34. package/dist/dom/catch.feat.js +3 -3
  35. package/dist/dom/catch.feat.mjs +1 -1
  36. package/dist/dom/controllable-input.feat.js +1 -1
  37. package/dist/dom/controllable-input.feat.mjs +1 -1
  38. package/dist/dom/controllable-open.feat.js +1 -1
  39. package/dist/dom/controllable-open.feat.mjs +1 -1
  40. package/dist/dom/controllable-select.feat.js +1 -1
  41. package/dist/dom/controllable-select.feat.mjs +1 -1
  42. package/dist/dom/controllable-textarea.feat.js +1 -1
  43. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  44. package/dist/dom/controllable.feat.js +1 -1
  45. package/dist/dom/controllable.feat.mjs +1 -1
  46. package/dist/dom/dom.d.ts +1 -0
  47. package/dist/dom/dynamic-tag-script.feat.js +2 -2
  48. package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
  49. package/dist/dom/dynamic-tag-var.feat.js +1 -1
  50. package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
  51. package/dist/dom/lazy.feat.js +1 -1
  52. package/dist/dom/lazy.feat.mjs +1 -1
  53. package/dist/dom/placeholder.feat.js +3 -3
  54. package/dist/dom/placeholder.feat.mjs +1 -1
  55. package/dist/dom/signals.d.ts +3 -2
  56. package/dist/{dom-BSsI9OPC.js → dom-B8UEYzOz.js} +112 -84
  57. package/dist/{dom-B-v8Gw6T.mjs → dom-BPjLe6YU.mjs} +23 -5
  58. package/dist/dom.d.ts +2 -2
  59. package/dist/dom.js +34 -33
  60. package/dist/dom.mjs +6 -5
  61. package/dist/html/assets.d.ts +12 -6
  62. package/dist/html/attrs.d.ts +3 -2
  63. package/dist/html/compat.d.ts +10 -2
  64. package/dist/html/dynamic-tag.d.ts +1 -1
  65. package/dist/html/inlined-runtimes.d.ts +1 -1
  66. package/dist/html/inlined-runtimes.debug.d.ts +1 -1
  67. package/dist/html/serializer.d.ts +2 -1
  68. package/dist/html/writer.d.ts +42 -22
  69. package/dist/html.d.ts +2 -2
  70. package/dist/html.js +400 -208
  71. package/dist/html.mjs +399 -207
  72. package/dist/translator/core/html-comment.d.ts +0 -7
  73. package/dist/translator/core/let.d.ts +0 -5
  74. package/dist/translator/core/show.d.ts +2 -5
  75. package/dist/translator/core/style.d.ts +6 -8
  76. package/dist/translator/index.d.ts +9 -0
  77. package/dist/translator/index.js +8429 -8100
  78. package/dist/translator/util/binding-has-prop.d.ts +1 -1
  79. package/dist/translator/util/binding-prop-tree.d.ts +4 -4
  80. package/dist/translator/util/bindings.d.ts +135 -0
  81. package/dist/translator/util/body-to-text-literal.d.ts +1 -2
  82. package/dist/translator/util/branch-tag.d.ts +7 -7
  83. package/dist/translator/util/constants/binding-type.d.ts +5 -6
  84. package/dist/translator/util/constants/slot-kind.d.ts +14 -0
  85. package/dist/translator/util/constants/structure-kind.d.ts +2 -1
  86. package/dist/translator/util/evaluate.d.ts +11 -10
  87. package/dist/translator/util/finalize-references.d.ts +4 -0
  88. package/dist/translator/util/for-selector.d.ts +1 -1
  89. package/dist/translator/util/generate-uid.d.ts +3 -1
  90. package/dist/translator/util/get-declared-binding-expression.d.ts +2 -2
  91. package/dist/translator/util/is-core-tag.d.ts +0 -3
  92. package/dist/translator/util/is-only-child-in-parent.d.ts +2 -7
  93. package/dist/translator/util/known-tag.d.ts +10 -8
  94. package/dist/translator/util/module-read.d.ts +21 -0
  95. package/dist/translator/util/read-replacement.d.ts +3 -0
  96. package/dist/translator/util/reasons.d.ts +32 -0
  97. package/dist/translator/util/references.d.ts +68 -166
  98. package/dist/translator/util/runtime.d.ts +2 -0
  99. package/dist/translator/util/scope-accessor.d.ts +14 -0
  100. package/dist/translator/util/scope-read.d.ts +1 -1
  101. package/dist/translator/util/sections.d.ts +52 -48
  102. package/dist/translator/util/set-tag-derived-from.d.ts +7 -0
  103. package/dist/translator/util/setup-work.d.ts +1 -2
  104. package/dist/translator/util/signals.d.ts +3 -5
  105. package/dist/translator/util/slots.d.ts +50 -0
  106. package/dist/translator/util/solve-reasons.d.ts +10 -0
  107. package/dist/translator/util/sources.d.ts +21 -0
  108. package/dist/translator/util/structure.d.ts +6 -2
  109. package/dist/translator/util/tag-facts.d.ts +21 -0
  110. package/dist/translator/util/tag-name-type.d.ts +4 -1
  111. package/dist/translator/util/translate-attrs.d.ts +2 -0
  112. package/dist/translator/util/translate-var.d.ts +3 -0
  113. package/dist/translator/util/write-guard.d.ts +12 -0
  114. package/dist/translator/util/writer.d.ts +3 -3
  115. package/dist/translator/visitors/export-declaration.d.ts +9 -0
  116. package/dist/translator/visitors/function.d.ts +5 -4
  117. package/dist/translator/visitors/import-declaration.d.ts +2 -2
  118. package/dist/translator/visitors/placeholder.d.ts +0 -3
  119. package/dist/translator/visitors/program/index.d.ts +13 -3
  120. package/dist/translator/visitors/referenced-identifier.d.ts +2 -1
  121. package/dist/translator/visitors/tag/custom-tag.d.ts +1 -1
  122. package/dist/translator/visitors/tag/dynamic-tag.d.ts +0 -3
  123. package/dist/translator/visitors/tag/index.d.ts +2 -1
  124. package/dist/translator/visitors/tag/native-tag.d.ts +26 -12
  125. package/package.json +3 -3
  126. package/dist/translator/util/insertion-context.d.ts +0 -1
  127. package/dist/translator/util/is-non-html-text.d.ts +0 -3
  128. package/dist/translator/util/serialize-guard.d.ts +0 -11
  129. package/dist/translator/util/serialize-reasons.d.ts +0 -37
  130. package/dist/translator/util/set-tag-sections-downstream.d.ts +0 -6
@@ -0,0 +1,21 @@
1
+ import { type Binding, type ParamBinding } from "./bindings";
2
+ import { type SortedOpt } from "./optional";
3
+ export interface Sources {
4
+ state: SortedOpt<Binding>;
5
+ param: SortedOpt<ParamBinding>;
6
+ global: true | undefined;
7
+ /** Read whatever changes, as an effect or handler reads on resume; the
8
+ * other fields still say what it reads. */
9
+ always: true | undefined;
10
+ }
11
+ export declare const ALWAYS: Sources;
12
+ export declare const globalSources: Sources;
13
+ export declare function sharesSources(a: Binding, b: Binding): boolean;
14
+ export declare function createSources(state: Sources["state"], param: Sources["param"], global?: Sources["global"], always?: Sources["always"]): Sources;
15
+ export declare function withSources(sources: Sources, state: Sources["state"], param: Sources["param"]): Sources | undefined;
16
+ export declare function compareSources(a: Sources, b: Sources): number;
17
+ export declare function mergeSources(a: Sources, b: undefined | Sources): Sources;
18
+ export declare function mergeSources(a: undefined | Sources, b: Sources): Sources;
19
+ export declare function mergeSources(a: undefined | Sources, b: undefined | Sources): Sources | undefined;
20
+ export declare function isInParams(binding: Binding, params: Sources["param"]): boolean;
21
+ export declare function isSupersetSources(a: Binding, b: Binding): boolean;
@@ -1,13 +1,17 @@
1
1
  import { types as t } from "@marko/compiler";
2
+ import { type Binding } from "./bindings";
2
3
  import * as Step from "./constants/step";
3
- import { type Section, type StructureRef, type StructureVisit } from "./sections";
4
+ import { type Section, type StructureNode, type StructureRef } from "./sections";
4
5
  export declare function enter(path: t.NodePath<any>): void;
5
6
  export declare function exit(path: t.NodePath<any>): void;
6
7
  export declare function enterShallow(path: t.NodePath<any>): void;
7
8
  export declare function child(tag: t.NodePath<t.MarkoTag>, name: string, renderer?: StructureRef): void;
8
9
  export declare function writeTo(path: t.NodePath<any>): (strs: TemplateStringsArray, ...exprs: string[]) => void;
10
+ export declare function writeModuleReadTo(path: t.NodePath<any>, read: string[]): void;
9
11
  export declare function writeTextTo(path: t.NodePath<any>, value: string): void;
10
- export declare function visit(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder | t.Program>, code: StructureVisit["code"], claimed?: boolean): StructureVisit | undefined;
12
+ export declare function node(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, binding?: Binding): StructureNode | undefined;
13
+ export declare function marker(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, binding: Binding): void;
14
+ export declare function controlFlowNode(tag: t.NodePath<t.MarkoTag>, section: Section): Binding;
11
15
  type ResolvedPart = string | t.Expression;
12
16
  interface ResolvedStructure {
13
17
  writes: ResolvedPart[];
@@ -0,0 +1,21 @@
1
+ import { types as t } from "@marko/compiler";
2
+ import * as ContentType from "./constants/content-type";
3
+ export interface TagFacts {
4
+ /** What renders at its edges, `null` for nothing. */
5
+ content: ContentType.Value | null | ((tag: t.MarkoTag) => ContentType.Value | null);
6
+ /** Its body renders into the section holding the tag. */
7
+ inlineBody?: true;
8
+ /** Its body is text rather than markup. */
9
+ textBody?: true;
10
+ /** It renders its body in its own place, with no node of its own. */
11
+ controlFlow?: true;
12
+ /** One of the document's own elements: the parser implies and moves nodes
13
+ * into it, and the page writes assets and resume scripts into it. */
14
+ pageElement?: true;
15
+ /** Its insertion mode drops an unknown element but keeps its children, so a
16
+ * wrapper around content inside it is discarded. */
17
+ discardsWrapperChildren?: true;
18
+ }
19
+ export declare function getTagFacts(tag: t.NodePath<t.MarkoTag>): TagFacts;
20
+ 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;
@@ -1,6 +1,7 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  import { type LoadImportConfig } from "../visitors/import-declaration";
3
3
  import * as TagNameType from "./constants/tag-name-type";
4
+ declare const kTagNameDynamic: unique symbol;
4
5
  declare module "@marko/compiler/dist/types" {
5
6
  interface ProgramExtra {
6
7
  featureType?: "class" | "tags";
@@ -9,6 +10,8 @@ declare module "@marko/compiler/dist/types" {
9
10
  }
10
11
  interface NodeExtra {
11
12
  tagNameType?: TagNameType;
13
+ }
14
+ interface MarkoTagExtra {
12
15
  tagNameNullable?: boolean;
13
16
  tagNameImported?: string;
14
17
  /** Every template the name may resolve to, when it can resolve to
@@ -17,7 +20,7 @@ declare module "@marko/compiler/dist/types" {
17
20
  tagNameLoad?: LoadImportConfig;
18
21
  }
19
22
  interface MarkoTagExtra {
20
- tagNameDynamic?: boolean;
23
+ [kTagNameDynamic]?: boolean;
21
24
  tagNameUnresolved?: boolean;
22
25
  featureType?: ProgramExtra["featureType"];
23
26
  }
@@ -1,5 +1,6 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  import { type BindingPropTree } from "./binding-prop-tree";
3
+ import { type Binding } from "./bindings";
3
4
  import { type AttrTagLookup } from "./nested-attribute-tags";
4
5
  import { type SortedOpt } from "./optional";
5
6
  type ContentKey = "renderBody" | "content";
@@ -14,4 +15,5 @@ export declare function addDynamicAttrTagStatements(attrTags: t.NodePath<t.Marko
14
15
  /** Unwraps a lone spread to the spread argument itself, so the result may alias
15
16
  * a caller binding; anything the runtime writes to needs its own object. */
16
17
  export declare function propsToExpression(props: t.ObjectExpression["properties"]): t.Expression;
18
+ export declare function getSingleKnownSpread(attributes: (t.MarkoAttribute | t.MarkoSpreadAttribute)[]): Binding | undefined;
17
19
  export {};
@@ -1,2 +1,5 @@
1
1
  import { types as t } from "@marko/compiler";
2
+ import { type Binding } from "./bindings";
2
3
  export default function translateVar(tag: t.NodePath<t.MarkoTag>, initialValue: t.Expression, kind?: "let" | "const", statements?: t.Statement[]): void;
4
+ export declare function getRestPattern(rest: Binding, id: t.Identifier, from: Binding, shorthand: boolean): t.ArrayPattern | t.ObjectPattern;
5
+ export declare function withRestFallback(rest: Binding, from: Binding, value: t.Expression): t.Expression;
@@ -0,0 +1,12 @@
1
+ import { types as t } from "@marko/compiler";
2
+ import { type Reason, type Reasons } from "./reasons";
3
+ import { type Section } from "./sections";
4
+ export declare function isSameReason(a: Reason | undefined, b: Reason | undefined): boolean;
5
+ export declare function buildGroupMask(groups: {
6
+ value: number | t.Expression | undefined;
7
+ names: string;
8
+ }[]): t.Expression | undefined;
9
+ export declare function getScopeReasonStatement(section: Section): t.Statement;
10
+ export declare function getWriteGuard(section: Section, reason: undefined | Reason, optional: boolean): t.Expression | undefined;
11
+ export declare function getWriteGuardForAny(section: Section, reasons: undefined | Reasons, optional: boolean): t.Expression | undefined;
12
+ export declare function getExprIfWritten<T extends undefined | Reason, R extends (T extends {} ? t.Expression : undefined)>(section: Section, reason: T, expr: t.Expression): R;
@@ -1,10 +1,10 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type Binding } from "./references";
3
- import type { SerializeReason } from "./serialize-reasons";
2
+ import { type Binding } from "./bindings";
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
6
  export declare function consumeHTML(path: t.NodePath<any>): t.ExpressionStatement | undefined;
7
7
  export declare function flushBefore(path: t.NodePath<any>): void;
8
8
  export declare function flushInto(path: t.NodePath<t.MarkoTag> | t.NodePath<t.Program>): void;
9
- export declare function markNode(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, nodeBinding: Binding, reason: undefined | false | SerializeReason, deferred?: boolean): void;
9
+ export declare function markNode(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, nodeBinding: Binding, reason: undefined | false | Reason, deferred?: boolean): void;
10
10
  export {};
@@ -1,4 +1,13 @@
1
1
  import { types as t } from "@marko/compiler";
2
+ declare const kTagImport: unique symbol;
3
+ declare module "@marko/compiler/dist/types" {
4
+ interface ExportNamedDeclarationExtra {
5
+ [kTagImport]?: string;
6
+ }
7
+ interface ExportAllDeclarationExtra {
8
+ [kTagImport]?: string;
9
+ }
10
+ }
2
11
  declare const _default: {
3
12
  analyze(this: unknown, exportDecl: t.NodePath<t.ExportAllDeclaration | t.ExportNamedDeclaration>): void;
4
13
  translate: {
@@ -1,7 +1,8 @@
1
1
  import { types as t } from "@marko/compiler";
2
+ declare const kRegisteredExports: unique symbol;
2
3
  declare module "@marko/compiler/dist/types" {
3
4
  interface ProgramExtra {
4
- registeredExports?: Map<string, ReservedExport>;
5
+ [kRegisteredExports]?: Map<string, ReservedExport>;
5
6
  }
6
7
  }
7
8
  /** The canonical name a reserved register id is exported under, and its id. */
@@ -17,12 +18,12 @@ declare const _default: {
17
18
  analyze(this: unknown, fn: t.NodePath<t.Function>): void;
18
19
  };
19
20
  export default _default;
20
- export declare function resolveFunctionRegisterReasons(): void;
21
+ export declare function resolveFunctionReason(): void;
21
22
  export declare function finalizeFunctionRegistry(): void;
22
23
  /**
23
24
  * Tracks a function imported from another template that reserved a register id.
24
- * The importing template registers it (under the reserved id) when its own
25
- * references reach something serialized.
25
+ * The importing template registers it (under the reserved id) when client
26
+ * code reads its own references.
26
27
  */
27
28
  export declare function trackImportedFn(importDecl: t.NodePath<t.ImportDeclaration>, local: string, resolved: ResolvedExport): void;
28
29
  /**
@@ -6,7 +6,7 @@ declare module "@marko/compiler/dist/types" {
6
6
  /** Absolute filenames of templates this one imports with `load`. */
7
7
  loadImports?: Set<string>;
8
8
  }
9
- interface NodeExtra {
9
+ interface ImportDeclarationExtra {
10
10
  tagImport?: string;
11
11
  loadImport?: LoadImportConfig;
12
12
  registeredImportedFns?: (ResolvedExport & {
@@ -28,4 +28,4 @@ declare const _default: {
28
28
  };
29
29
  };
30
30
  export default _default;
31
- export declare function getImportFacts(importDecl: t.NodePath<t.ImportDeclaration>): t.NodeExtra;
31
+ export declare function getImportFacts(importDecl: t.NodePath<t.ImportDeclaration>): t.ImportDeclarationExtra & t.NodeExtra;
@@ -1,12 +1,9 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type Binding } from "../util/references";
3
2
  import * as SiblingText from "./constants/sibling-text";
4
- declare const kNodeBinding: unique symbol;
5
3
  declare const kSiblingText: unique symbol;
6
4
  type SiblingText = SiblingText.Value;
7
5
  declare module "@marko/compiler/dist/types" {
8
6
  interface MarkoPlaceholderExtra {
9
- [kNodeBinding]?: Binding;
10
7
  [kSiblingText]?: SiblingText;
11
8
  }
12
9
  }
@@ -1,17 +1,27 @@
1
1
  import { types as t } from "@marko/compiler";
2
2
  import { type BindingPropTree } from "../../util/binding-prop-tree";
3
+ import { type Binding } from "../../util/bindings";
3
4
  import { preAnalyze } from "./pre-analyze";
4
5
  export declare let scopeIdentifier: t.Identifier;
5
6
  export declare let localsIdentifier: t.Identifier;
6
7
  declare module "@marko/compiler/dist/types" {
7
8
  interface ProgramExtra {
9
+ /** Client code reads something of its own after resume (a section, or a
10
+ * renderer it registers), so a page bundles it. */
8
11
  hasResumes?: boolean;
9
- domExports?: {
12
+ /** What the template reads of its params (its input is the first), the
13
+ * contract its callers keep. */
14
+ paramsTree?: BindingPropTree;
15
+ /** The names every compile of the template exports its parts under. */
16
+ exportNames?: {
10
17
  template: string;
11
18
  walks: string;
12
19
  setup: string;
13
- setupEmpty?: true;
14
- params: BindingPropTree | undefined;
20
+ /** The signal of each of the template's param bindings, a property of
21
+ * one included. */
22
+ params: Map<Binding, string>;
23
+ /** Each content passthrough's `_dynamic_tag_content` signal. */
24
+ directContent: Map<Binding, string>;
15
25
  };
16
26
  styleFile?: string;
17
27
  }
@@ -1,9 +1,10 @@
1
1
  import { types as t } from "@marko/compiler";
2
+ declare const kAbortId: unique symbol;
2
3
  declare module "@marko/compiler/dist/types" {
3
4
  interface NodeExtra {
4
5
  /** `$signal` abort id for this expression root, allocated in analyze
5
6
  * (see below) so every translate reads the same id. */
6
- abortId?: number;
7
+ [kAbortId]?: number;
7
8
  }
8
9
  }
9
10
  declare const _default: {
@@ -1,5 +1,5 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import type { Binding } from "../../util/references";
2
+ import { type Binding } from "../../util/bindings";
3
3
  declare const kLoadTagBinding: unique symbol;
4
4
  declare module "@marko/compiler/dist/types" {
5
5
  interface MarkoTagExtra {
@@ -1,8 +1,6 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type Binding } from "../../util/references";
3
2
  import { type Section } from "../../util/sections";
4
3
  import * as ClassHydration from "./constants/class-hydration";
5
- declare const kChildOffsetScopeBinding: unique symbol;
6
4
  type ClassHydration = ClassHydration.Value;
7
5
  declare module "@marko/compiler" {
8
6
  interface MarkoMeta {
@@ -12,7 +10,6 @@ declare module "@marko/compiler" {
12
10
  }
13
11
  declare module "@marko/compiler/dist/types" {
14
12
  interface MarkoTagExtra {
15
- [kChildOffsetScopeBinding]?: Binding;
16
13
  defineBodySection?: Section;
17
14
  }
18
15
  }
@@ -1,7 +1,8 @@
1
1
  import { types as t } from "@marko/compiler";
2
+ declare const kAnalyzeFailed: unique symbol;
2
3
  declare module "@marko/compiler/dist/types" {
3
4
  interface MarkoTagExtra {
4
- analyzeFailed?: boolean;
5
+ [kAnalyzeFailed]?: boolean;
5
6
  }
6
7
  }
7
8
  declare const _default: {
@@ -1,19 +1,34 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type Binding } from "../../util/references";
3
2
  import { type DOMRuntimeFeature } from "../../util/runtime";
4
- import { type StructureVisit } from "../../util/sections";
5
- export declare const kNativeTagBinding: unique symbol;
6
- export declare const kSkipEndTag: unique symbol;
7
- declare const kTagContentAttr: unique symbol;
8
- declare const kVisitOp: unique symbol;
3
+ import { type StructureNode } from "../../util/sections";
4
+ declare const kNodeOp: unique symbol;
5
+ declare const kNativeAttrs: unique symbol;
9
6
  declare module "@marko/compiler/dist/types" {
10
- interface NodeExtra {
11
- [kNativeTagBinding]?: Binding;
12
- [kSkipEndTag]?: true;
13
- [kTagContentAttr]?: true;
14
- [kVisitOp]?: StructureVisit;
7
+ interface MarkoTagExtra {
8
+ [kNodeOp]?: StructureNode;
9
+ [kNativeAttrs]?: NativeAttrs;
15
10
  }
16
11
  }
12
+ interface NativeAttrs {
13
+ /** Attributes written on their own, apart from the controllable pair. */
14
+ own: number[] | undefined;
15
+ /** Event handlers the element attaches on its own, in source order. */
16
+ handlers: number[] | undefined;
17
+ /** The `content` attribute rendering in place of a body. */
18
+ content: number | undefined;
19
+ /** Attributes controlling an element state, its change handler second. */
20
+ controllable: Controllable | undefined;
21
+ /** Attributes written as one object with the spreads, in write order. */
22
+ spread: number[] | undefined;
23
+ /** No attribute sets the nonce the page requires of it. */
24
+ nonceUnset: boolean;
25
+ }
26
+ interface Controllable {
27
+ state: "checked" | "checkedValue" | "value" | "open";
28
+ special: boolean;
29
+ valueMode?: "attribute" | "dynamic";
30
+ attrs: (number | undefined)[];
31
+ }
17
32
  declare const _default: {
18
33
  analyze: {
19
34
  enter(this: unknown, tag: t.NodePath<t.MarkoTag>): void;
@@ -33,4 +48,3 @@ export declare function controllableClaimFor(tagName: string | undefined): "_con
33
48
  * kind at run time, and a run-time tag name can be any of them. */
34
49
  export declare function controllableFeatureFor(tagName: string | undefined): "controllable" | "controllable-input" | "controllable-open" | "controllable-select" | "controllable-textarea" | undefined;
35
50
  export declare function enableControllable(feature: DOMRuntimeFeature | undefined): void;
36
- export declare function isPageElement(tagName: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.4.0",
3
+ "version": "6.4.2",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",
@@ -57,8 +57,8 @@
57
57
  "magic-string": "^0.30.21"
58
58
  },
59
59
  "devDependencies": {
60
- "@marko/runtime-tags": "npm:marko@6.4.0",
61
- "marko": "5.39.44"
60
+ "@marko/runtime-tags": "npm:marko@6.4.2",
61
+ "marko": "5.39.45"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=22"
@@ -1 +0,0 @@
1
- export declare function discardsWrapperChildren(tagName: string): boolean;
@@ -1,3 +0,0 @@
1
- import { types as t } from "@marko/compiler";
2
- export declare function isNonHTMLText(placeholder: t.NodePath<t.MarkoPlaceholder | t.MarkoText>): boolean;
3
- export declare function isTextOnlyNativeTag(tag: t.NodePath<t.MarkoTag>): boolean;
@@ -1,11 +0,0 @@
1
- import { types as t } from "@marko/compiler";
2
- import { type Section } from "./sections";
3
- import { type SerializeReason, type SerializeReasons } from "./serialize-reasons";
4
- export declare function buildGroupMask(groups: {
5
- value: number | t.Expression | undefined;
6
- names: string;
7
- }[]): t.Expression | undefined;
8
- export declare function getScopeReasonStatement(section: Section): t.Statement;
9
- export declare function getSerializeGuard(section: Section, reason: undefined | SerializeReason, optional: boolean): t.Expression | undefined;
10
- export declare function getSerializeGuardForAny(section: Section, reasons: undefined | SerializeReasons, optional: boolean): t.Expression | undefined;
11
- export declare function getExprIfSerialized<T extends undefined | SerializeReason, R extends (T extends {} ? t.Expression : undefined)>(section: Section, reason: T, expr: t.Expression): R;
@@ -1,37 +0,0 @@
1
- import { types as t } from "@marko/compiler";
2
- import { AccessorPrefix, AccessorProp } from "../../common/types";
3
- import { type Opt, Sorted, type SortedOneMany } from "./optional";
4
- import { type Binding, type KnownExprs, type ReferencedBindings, type Sources } from "./references";
5
- import { type ParamSerializeReasonGroups, type Section } from "./sections";
6
- export type SerializeReasons = SortedOneMany<Sources>;
7
- export declare const sourcesUtil: Sorted<Sources>;
8
- export type SerializeReason = Sources;
9
- export type SerializeKey = symbol & {
10
- __serialize_key__: 1;
11
- };
12
- export declare function isSameReason(a: SerializeReason | undefined, b: SerializeReason | undefined): boolean;
13
- export declare function isForceSerialized(section: Section, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): boolean;
14
- export declare function addSerializeReason(section: Section, reason: undefined | false | SerializeReason, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): void;
15
- export declare function addSerializeExpr(section: Section, expr: Opt<t.NodeExtra>, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): void;
16
- export declare function addOwnerSerializeReason(from: Section, to: Section, reason: undefined | false | SerializeReason): void;
17
- export declare function isReasonDynamic(reason: undefined | SerializeReason): reason is Sources & {
18
- state: undefined;
19
- forced: undefined;
20
- };
21
- export declare function isStaticSerializeReason(reason: undefined | SerializeReason): reason is SerializeReason;
22
- export declare function isStateSerializeReason(reason: undefined | SerializeReason): reason is Sources;
23
- export declare function hasSerializeReasons(section: Section | undefined): boolean;
24
- export declare function getSerializeReason(section: Section, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): Sources | undefined;
25
- export declare function getSerializeSourcesForExpr(expr: t.NodeExtra): Sources | undefined;
26
- export declare function getSerializeSourcesForExprs(exprs: Opt<t.NodeExtra> | boolean): Sources | undefined;
27
- export declare function getSerializeSourcesForRef(ref: ReferencedBindings): Sources | undefined;
28
- export declare function getSerializeSourcesForDownstream({ binding, exprs, properties, }: NonNullable<Section["downstream"]>): Sources | undefined;
29
- export declare function mapParamReason(program: Section, reason: Sources, exprs: KnownExprs | undefined, ownParams: boolean): SerializeReason | undefined;
30
- export declare function mergeSerializeReasons(a: SerializeReason, b: undefined | SerializeReason): SerializeReason;
31
- export declare function mergeSerializeReasons(a: undefined | SerializeReason, b: SerializeReason): SerializeReason;
32
- export declare function mergeSerializeReasons(a: undefined | SerializeReason, b: undefined | SerializeReason): SerializeReason | undefined;
33
- export declare function isOwnResumeReason(reason: SerializeReason | undefined): boolean;
34
- export declare function applySerializeExprs(section: Section): void;
35
- export declare function finalizeSerializeReason(section: Section): void;
36
- export declare function getSerializeReasonsVersion(): number;
37
- export declare function setParamReasonGroups(section: Section, groups: ParamSerializeReasonGroups): void;
@@ -1,6 +0,0 @@
1
- import { types as t } from "@marko/compiler";
2
- import { type Opt } from "./optional";
3
- import type { Binding, KnownExprs } from "./references";
4
- import { type Section } from "./sections";
5
- export declare function setTagDownstream(tag: t.NodePath<t.MarkoTag>, binding: Opt<Binding>, exprs?: KnownExprs): void;
6
- export declare function finalizeTagDownstreams(section: Section): void;