marko 6.5.0 → 6.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/debug/dom/catch.feat.js +1 -1
  2. package/dist/debug/dom/catch.feat.mjs +1 -1
  3. package/dist/debug/dom/compat.feat.js +1 -1
  4. package/dist/debug/dom/compat.feat.mjs +1 -1
  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 +1 -1
  18. package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
  19. package/dist/debug/dom/lazy.feat.js +1 -1
  20. package/dist/debug/dom/lazy.feat.mjs +1 -1
  21. package/dist/debug/dom/placeholder.feat.js +1 -1
  22. package/dist/debug/dom/placeholder.feat.mjs +1 -1
  23. package/dist/debug/{dom-D3A8gh_D.mjs → dom-4AzxJQHb.mjs} +12 -12
  24. package/dist/debug/{dom-BiJ_UKJV.js → dom-Uu_OCdvg.js} +12 -12
  25. package/dist/debug/dom.js +1 -1
  26. package/dist/debug/dom.mjs +1 -1
  27. package/dist/dom/catch.feat.js +1 -1
  28. package/dist/dom/catch.feat.mjs +1 -1
  29. package/dist/dom/compat.feat.js +1 -1
  30. package/dist/dom/compat.feat.mjs +1 -1
  31. package/dist/dom/control-flow.d.ts +7 -7
  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 +1 -1
  43. package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
  44. package/dist/dom/dynamic-tag-var.feat.js +1 -1
  45. package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
  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 +1 -1
  49. package/dist/dom/placeholder.feat.mjs +1 -1
  50. package/dist/{dom-B3piR0q1.js → dom-BdJeggv5.js} +9 -9
  51. package/dist/{dom-CPk_8CMB.mjs → dom-DJrZXgdr.mjs} +9 -9
  52. package/dist/dom.js +1 -1
  53. package/dist/dom.mjs +1 -1
  54. package/dist/translator/core/if.d.ts +1 -1
  55. package/dist/translator/core/show.d.ts +2 -3
  56. package/dist/translator/index.js +2630 -2687
  57. package/dist/translator/util/assert.d.ts +0 -10
  58. package/dist/translator/util/branch-tag.d.ts +1 -1
  59. package/dist/translator/util/get-root.d.ts +3 -1
  60. package/dist/translator/util/nested-attribute-tags.d.ts +4 -5
  61. package/dist/translator/util/optional.d.ts +0 -1
  62. package/dist/translator/util/params-tree.d.ts +1 -1
  63. package/dist/translator/util/sections.d.ts +4 -1
  64. package/dist/translator/util/state.d.ts +2 -2
  65. package/dist/translator/util/to-property-name.d.ts +0 -2
  66. package/dist/translator/util/visitors.d.ts +2 -2
  67. package/dist/translator/util/writer.d.ts +2 -2
  68. package/package.json +3 -3
@@ -1,5 +1,4 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type ForType } from "./branch-tag";
3
2
  export declare function assertNoSpreadAttrs(tag: t.NodePath<t.MarkoTag>): void;
4
3
  export declare function assertOnlyValueAttr(tag: t.NodePath<t.MarkoTag>, required: true, change?: boolean, hint?: (attr: t.MarkoAttribute) => string | undefined): {
5
4
  valueAttr: t.MarkoAttribute;
@@ -20,14 +19,5 @@ export declare function buildAttrsError(tag: t.NodePath<t.MarkoTag>, attrs: t.Ma
20
19
  export declare function buildAttrError(tag: t.NodePath<t.MarkoTag>, attr: t.MarkoTag["attributes"][number], msg: string): Error;
21
20
  export declare function buildAttrNameError(tag: t.NodePath<t.MarkoTag>, attr: t.MarkoAttribute, msg: string): Error;
22
21
  export declare function buildDuplicateAttrError(tag: t.NodePath<t.MarkoTag>, attr: t.MarkoAttribute): Error;
23
- /** The loop a `<for>` tag's attributes run, which it requires. */
24
- export declare function assertForType(tag: t.NodePath<t.MarkoTag>): ForType;
25
- /** The attributes a loop of `type` takes, besides `by=`. */
26
- export declare function getForAttrs(type: ForType): string[];
27
- /** Throws for a param that a loop of `type` never supplies. */
28
- export declare function assertForParams(tag: t.NodePath<t.MarkoTag>, type: ForType): void;
29
- /** The params a loop of `type` supplies, as its docs name them. */
30
- export declare function getForParamNames(type: ForType): "item, index" | "key, value" | "num";
31
22
  export declare function coreTagLink(tag: t.NodePath<t.MarkoTag>): string;
32
23
  export declare function isValueAttr(attr: t.MarkoTag["attributes"][number]): attr is t.MarkoAttribute;
33
- export declare function isValueChangeAttr(attr: t.MarkoTag["attributes"][number]): attr is t.MarkoAttribute;
@@ -3,7 +3,7 @@ import { type Binding } from "./bindings";
3
3
  import { type Reasons } from "./reasons";
4
4
  import { type Section } from "./sections";
5
5
  export declare function initBranchSection(bodySection: Section, branchExpr: Section["branchExpr"], branch: NonNullable<Section["branch"]>): void;
6
- export declare function resumeOwnerByMarkerWhenUnconditional(bodySection: Section, nodeBinding: Binding): void;
6
+ export declare function resumeOwnerByMarkerWhenUnconditional(bodySection: Section): void;
7
7
  export declare function getBranchResumeArgs(tag: t.NodePath<t.MarkoTag>, branchReasons: Reasons, singleNode: boolean): (t.Expression | undefined)[];
8
8
  export declare function buildBranchEndArgs(tagSection: Section, nodeBinding: Binding, onlyChildParentTagName: string | false | undefined, singleNode: boolean | undefined): (t.Expression | undefined)[];
9
9
  export declare function isEndTagWrittenByBranch(nodeBinding: Binding | undefined): boolean;
@@ -1,7 +1,9 @@
1
1
  import type { types as t } from "@marko/compiler";
2
2
  export type MarkoRootPath = t.NodePath<t.MarkoTag | t.MarkoTagBody | t.MarkoAttribute | t.MarkoSpreadAttribute | t.MarkoScriptlet | t.MarkoPlaceholder | t.ExportNamedDeclaration | t.ExportDefaultDeclaration>;
3
3
  export declare function getMarkoRoot(path: t.NodePath<t.Node>): MarkoRootPath | null;
4
- export declare function getExprRoot(path: t.NodePath<t.Node>): t.NodePath<t.Node>;
4
+ export declare function getExprRoot(path: t.NodePath<t.Node>): t.NodePath<t.Node> & {
5
+ parentPath: MarkoRootPath;
6
+ };
5
7
  export declare function getFnRoot(path: t.NodePath<t.Node>): t.NodePath<t.ArrowFunctionExpression | t.FunctionDeclaration | t.FunctionExpression | t.ObjectMember> | undefined;
6
8
  export declare function getFnParent(path: t.NodePath<t.Node>): t.NodePath<t.ArrowFunctionExpression | t.FunctionDeclaration | t.FunctionExpression | t.ObjectMember> | undefined;
7
9
  export declare function getDeclarationRoot(path: t.NodePath<t.Node>): t.NodePath<t.FunctionDeclaration | t.VariableDeclaration> | undefined;
@@ -3,17 +3,16 @@ export interface AttrTagMeta {
3
3
  name: string;
4
4
  dynamic: boolean;
5
5
  repeated: boolean;
6
- group: AttrTagNames;
6
+ group: AttrTagGroup;
7
7
  }
8
8
  export type AttrTagLookup = Record<string, AttrTagMeta>;
9
- type AttrTagNames = string[];
9
+ export type AttrTagGroup = string[];
10
10
  declare module "@marko/compiler/dist/types" {
11
11
  interface MarkoTagExtra {
12
12
  attrTagLookup?: AttrTagLookup;
13
- attributeTagGroup?: AttrTagLookup[string]["group"];
13
+ attributeTagGroup?: AttrTagGroup;
14
14
  }
15
15
  }
16
- export declare function getAttrTagIdentifier(meta: AttrTagLookup[string]): t.Identifier;
16
+ export declare function getAttrTagIdentifier(meta: AttrTagMeta): t.Identifier;
17
17
  export declare function getAttrTagPaths(tag: t.NodePath<t.MarkoTag>): ReturnType<typeof tag.get<"attributeTags">>;
18
18
  export declare function analyzeAttributeTags(tag: t.NodePath<t.MarkoTag>): AttrTagLookup | undefined;
19
- export {};
@@ -16,7 +16,6 @@ export declare class Sorted<T> {
16
16
  filter<U extends NonNullable<T>>(data: SortedOpt<U>, cb: (item: U) => boolean): SortedOpt<U>;
17
17
  filter<U extends NonNullable<T>, C>(data: SortedOpt<U>, cb: (item: U, context: C) => boolean, context: C): SortedOpt<U>;
18
18
  leadingRun<U extends NonNullable<T>, K>(data: SortedOpt<U>, key: (item: U) => K, compareKeys: Compare<K>, bound: K): SortedOpt<U>;
19
- range<U extends NonNullable<T>, K>(data: SortedOpt<U>, key: (item: U) => K, compareKeys: Compare<K>, bound: K): SortedOpt<U>;
20
19
  forEachRun<U extends NonNullable<T>, K>(data: SortedOpt<U>, key: (item: U) => K, compareKeys: Compare<K>, fn: (key: K, run: SortedOneMany<U>) => void): void;
21
20
  reduceRuns<U extends NonNullable<T>, K, R>(data: SortedOpt<U>, key: (item: U) => K, compareKeys: Compare<K>, fn: (acc: R, key: K, run: SortedOneMany<U>) => R, initial: R): R;
22
21
  has<U extends NonNullable<T>>(data: SortedOpt<U>, item: U): boolean;
@@ -14,5 +14,5 @@ declare module "@marko/compiler/dist/types" {
14
14
  export declare function exposeParamsTree(binding: Binding, bodyAnalyzed?: boolean): ParamsTree;
15
15
  export declare function getSettledParamsTree(paramsTree: ParamsTree | undefined): ParamsTree | undefined;
16
16
  export declare function getParamsTreeAt(paramsTree: ParamsTree | true, name: string): ParamsTree | true | undefined;
17
- export declare function getAllKnownPropertyNames(paramsTree: ParamsTree): string[];
17
+ export declare function getAllKnownPropertyNames(paramsTree: ParamsTree): Set<string>;
18
18
  export declare function hasAllKnownProperties(paramsTree: ParamsTree): boolean | undefined;
@@ -56,6 +56,9 @@ export interface Section {
56
56
  children: Section[];
57
57
  program: Section;
58
58
  params: undefined | ParamBinding;
59
+ /** How many params its tag supplies as it renders it: a `<for>` row's, an
60
+ * `<await>`'s value, a `<try>`'s caught error. */
61
+ suppliedParams: number | undefined;
59
62
  /** The attribute tag `<for>` params this content reads, held as its own
60
63
  * bindings that the loop binds as it creates it. */
61
64
  localClosures: ReferencedBindings;
@@ -167,7 +170,7 @@ export declare function getNodeContentType(path: t.NodePath<t.Statement>, edge:
167
170
  export declare function isKnownChild(section: Section): boolean;
168
171
  export declare const getSectionTextBefore: (key: Section) => boolean | undefined;
169
172
  export declare function mayMergeWithText(path: t.NodePath, before: boolean): boolean | undefined;
170
- export declare function getRendererReason(section: Section): false | Sources;
173
+ export declare function getRendererReason(section: Section): Sources | undefined;
171
174
  export declare function isOptionalBranch(section: Section): section is Section & {
172
175
  branch: NonNullable<Section["branch"]>;
173
176
  };
@@ -1,5 +1,5 @@
1
1
  import type { Section } from "./sections";
2
2
  export declare function createOutputState<T>(init: () => T): readonly [() => T, (value: T) => void];
3
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];
4
+ export declare function createOutputSectionState<T = unknown>(init?: (section: Section) => T): readonly [(section: Section) => T, (section: Section, value: T) => void];
5
+ export declare function createAnalysisSectionState<T = unknown>(init?: (section: Section) => T): readonly [(section: Section) => T, (section: Section, value: T) => void];
@@ -6,6 +6,4 @@ export declare function isValidPropertyIdentifier(name: string): boolean;
6
6
  export declare function toPropertyName(name: string): t.Identifier | t.NumericLiteral | t.StringLiteral;
7
7
  export declare function toObjectProperty(name: string, value: t.Expression): t.ObjectProperty;
8
8
  export declare function toMemberExpression(object: t.Expression, key: string): t.MemberExpression;
9
- export declare function toMemberExpression(object: t.Expression, key: string, optional: false | undefined): t.MemberExpression;
10
- export declare function toMemberExpression(object: t.Expression, key: string, optional: true): t.OptionalMemberExpression;
11
9
  export declare function toMemberExpression(object: t.Expression, key: string, optional?: boolean): t.MemberExpression | t.OptionalMemberExpression;
@@ -10,5 +10,5 @@ export declare function translateByTarget<T extends t.Node>({ html, dom, }: {
10
10
  readonly enter: (path: t.NodePath<T>) => void;
11
11
  readonly exit: (path: t.NodePath<T>) => void;
12
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;
13
+ export declare function enterHook<T extends t.Node>(modulePlugin: Plugin, path: t.NodePath<T>): void;
14
+ export declare function exitHook<T extends t.Node>(modulePlugin: Plugin, path: t.NodePath<T>): void;
@@ -1,6 +1,6 @@
1
1
  import { types as t } from "@marko/compiler";
2
- import { type Binding } from "./bindings";
3
- type Write = string | t.Expression | (() => undefined | string | t.Expression);
2
+ import type { Binding } from "./bindings";
3
+ type Write = string | t.Expression;
4
4
  export declare function writeTo(path: t.NodePath<any>, trailer?: boolean): (strs: TemplateStringsArray, ...exprs: Write[]) => void;
5
5
  export declare function flushBefore(path: t.NodePath<any>): void;
6
6
  export declare function flushInto(path: t.NodePath<t.MarkoTag> | t.NodePath<t.Program>): t.NodePath<t.MarkoTagBody | t.Program>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.5.0",
3
+ "version": "6.5.1",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",
@@ -57,8 +57,8 @@
57
57
  "magic-string": "^1.4.5"
58
58
  },
59
59
  "devDependencies": {
60
- "@marko/runtime-tags": "npm:marko@6.5.0",
61
- "marko": "5.41.0"
60
+ "@marko/runtime-tags": "npm:marko@6.5.1",
61
+ "marko": "5.42.0"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=22.12.0"