marko 6.3.34 → 6.3.36

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 (62) 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/errors.d.ts +1 -0
  5. package/dist/common/meta.d.ts +1 -0
  6. package/dist/common/types.d.ts +10 -0
  7. package/dist/debug/dom/catch.feat.js +1 -1
  8. package/dist/debug/dom/catch.feat.mjs +1 -1
  9. package/dist/debug/dom/controllable-input.feat.js +1 -1
  10. package/dist/debug/dom/controllable-input.feat.mjs +1 -1
  11. package/dist/debug/dom/controllable-open.feat.js +1 -1
  12. package/dist/debug/dom/controllable-open.feat.mjs +1 -1
  13. package/dist/debug/dom/controllable-select.feat.js +1 -1
  14. package/dist/debug/dom/controllable-select.feat.mjs +1 -1
  15. package/dist/debug/dom/controllable-textarea.feat.js +1 -1
  16. package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
  17. package/dist/debug/dom/controllable.feat.js +1 -1
  18. package/dist/debug/dom/controllable.feat.mjs +1 -1
  19. package/dist/debug/dom/dynamic-tag-var.feat.js +7 -0
  20. package/dist/debug/dom/dynamic-tag-var.feat.mjs +6 -0
  21. package/dist/debug/{dom-Bj58jt8y.js → dom-BbFAdZEB.js} +54 -17
  22. package/dist/debug/{dom-klf8Ec_o.mjs → dom-ClMc0GK9.mjs} +43 -18
  23. package/dist/debug/dom.js +1 -1
  24. package/dist/debug/dom.mjs +1 -1
  25. package/dist/debug/html.js +94 -25
  26. package/dist/debug/html.mjs +94 -25
  27. package/dist/dom/catch.feat.js +4 -4
  28. package/dist/dom/catch.feat.mjs +1 -1
  29. package/dist/dom/control-flow.d.ts +3 -0
  30. package/dist/dom/controllable-input.feat.js +2 -2
  31. package/dist/dom/controllable-input.feat.mjs +1 -1
  32. package/dist/dom/controllable-open.feat.js +2 -2
  33. package/dist/dom/controllable-open.feat.mjs +1 -1
  34. package/dist/dom/controllable-select.feat.js +2 -2
  35. package/dist/dom/controllable-select.feat.mjs +1 -1
  36. package/dist/dom/controllable-textarea.feat.js +2 -2
  37. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  38. package/dist/dom/controllable.feat.js +2 -2
  39. package/dist/dom/controllable.feat.mjs +1 -1
  40. package/dist/dom/dynamic-tag-var.feat.d.ts +1 -0
  41. package/dist/dom/dynamic-tag-var.feat.js +3 -0
  42. package/dist/dom/dynamic-tag-var.feat.mjs +4 -0
  43. package/dist/dom/signals.d.ts +3 -3
  44. package/dist/{dom-B-XpL2_H.js → dom-59H9kVUF.js} +133 -118
  45. package/dist/{dom-6hBvZW7X.mjs → dom-BKDjlXIl.mjs} +25 -15
  46. package/dist/dom.js +34 -34
  47. package/dist/dom.mjs +1 -1
  48. package/dist/html/dynamic-tag.d.ts +1 -1
  49. package/dist/html/serializer.d.ts +9 -1
  50. package/dist/html/template.d.ts +1 -0
  51. package/dist/html/writer.d.ts +1 -0
  52. package/dist/html.js +19 -13
  53. package/dist/html.mjs +19 -13
  54. package/dist/translator/index.js +287 -101
  55. package/dist/translator/util/references.d.ts +1 -0
  56. package/dist/translator/util/runtime.d.ts +1 -1
  57. package/dist/translator/util/signals.d.ts +2 -0
  58. package/dist/translator/util/translate-var.d.ts +1 -1
  59. package/dist/translator/util/traverse.d.ts +2 -0
  60. package/dist/translator/visitors/export-declaration.d.ts +8 -0
  61. package/package.json +4 -4
  62. package/tags/let.d.marko +3 -4
@@ -19,6 +19,7 @@ export interface Sources {
19
19
  export declare const globalSources: Sources;
20
20
  export interface Binding {
21
21
  id: number;
22
+ uid: number;
22
23
  name: string;
23
24
  originalName: string | undefined;
24
25
  type: BindingType;
@@ -5,7 +5,7 @@ export type DOMRuntimeHelpers = keyof typeof import("../../dom");
5
5
  export type HTMLRuntimeHelpers = keyof typeof import("../../html");
6
6
  export declare function importRuntime(name: DOMRuntimeHelpers | HTMLRuntimeHelpers): t.Identifier;
7
7
  export declare function callRuntime(name: DOMRuntimeHelpers | HTMLRuntimeHelpers, ...args: Array<Parameters<typeof t.callExpression>[1][number] | Falsy>): t.CallExpression;
8
- export type DOMRuntimeFeature = "catch" | "controllable" | "controllable-input" | "controllable-open" | "controllable-select" | "controllable-textarea";
8
+ export type DOMRuntimeFeature = "catch" | "controllable" | "controllable-input" | "controllable-open" | "controllable-select" | "controllable-textarea" | "dynamic-tag-var";
9
9
  export declare function importRuntimeFeature(feature: DOMRuntimeFeature): void;
10
10
  export declare function getHTMLRuntime(): {
11
11
  _escape: typeof _escape;
@@ -9,6 +9,7 @@ export interface Signal {
9
9
  section: Section;
10
10
  build: undefined | (() => t.Expression | undefined);
11
11
  register?: boolean;
12
+ referenced?: boolean;
12
13
  values: Array<{
13
14
  signal: Signal;
14
15
  value: t.Expression;
@@ -37,6 +38,7 @@ export declare const getTryHasPlaceholder: (section: Section) => true | undefine
37
38
  export declare function setSectionOwnerResumedByMarker(section: Section): void;
38
39
  export declare function setSectionSerializedValue(section: Section, prop: AccessorProp, expression: t.Expression): void;
39
40
  export declare function setBindingSerializedValue(section: Section, binding: Binding, expression: t.Expression, prefix?: AccessorPrefix): void;
41
+ export declare function setSectionDebugVar(section: Section, accessor: string, name: string, loc: t.SourceLocation | null | undefined): void;
40
42
  export declare function setSerializedValue(section: Section, key: string, expression: t.Expression): void;
41
43
  export declare function addWriteScopeBuilder(section: Section, builder: (writeCall: t.Expression) => t.Expression): void;
42
44
  export declare const getHTMLSectionStatements: (section: Section) => t.Statement[];
@@ -1,2 +1,2 @@
1
1
  import { types as t } from "@marko/compiler";
2
- export default function translateVar(tag: t.NodePath<t.MarkoTag>, initialValue: t.Expression, kind?: "let" | "const"): void;
2
+ export default function translateVar(tag: t.NodePath<t.MarkoTag>, initialValue: t.Expression, kind?: "let" | "const", statements?: t.Statement[]): void;
@@ -6,5 +6,7 @@ type VisitKeys<T> = (string | number) & (T extends T ? {
6
6
  }[keyof T] : never);
7
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;
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
+ export declare function traverseFindAwait(node: undefined | null | t.Node | t.Node[]): t.Node | undefined;
9
11
  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;
10
12
  export {};
@@ -0,0 +1,8 @@
1
+ import { types as t } from "@marko/compiler";
2
+ declare const _default: {
3
+ analyze(this: unknown, exportDecl: t.NodePath<t.ExportAllDeclaration | t.ExportNamedDeclaration>): void;
4
+ translate: {
5
+ exit(this: unknown, exportDecl: t.NodePath<t.ExportAllDeclaration | t.ExportNamedDeclaration>): void;
6
+ };
7
+ };
8
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.3.34",
3
+ "version": "6.3.36",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",
@@ -48,14 +48,14 @@
48
48
  }
49
49
  },
50
50
  "dependencies": {
51
- "@marko/compiler": "^5.41.18",
51
+ "@marko/compiler": "^5.42.1",
52
52
  "csstype": "^3.2.3",
53
53
  "fastest-levenshtein": "^1.0.16",
54
54
  "magic-string": "^0.30.21"
55
55
  },
56
56
  "devDependencies": {
57
- "@marko/runtime-tags": "npm:marko@6.3.34",
58
- "marko": "5.39.32"
57
+ "marko": "5.39.34",
58
+ "@marko/runtime-tags": "npm:marko@6.3.36"
59
59
  },
60
60
  "engines": {
61
61
  "node": ">=22"
package/tags/let.d.marko CHANGED
@@ -1,8 +1,7 @@
1
1
  /** File for types only, not actual implementation **/
2
2
 
3
- export interface Input<T, K = T> {
4
- value?: T;
5
- valueChange?: ((newValue: K) => void) | false | null;
6
- }
3
+ export type Input<T = undefined, K = T> =
4
+ | { value: T; valueChange?: ((newValue: K) => void) | false | null }
5
+ | { value?: undefined; valueChange?: ((newValue: K) => void) | false | null };
7
6
 
8
7
  return=(input.value as T) valueChange=(input.valueChange as (newValue: K) => void)