marko 6.3.52 → 6.3.54
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.
- package/cheatsheet.md +1 -0
- package/dist/common/constants/renderer-prop.d.ts +0 -1
- package/dist/common/constants/renderer-prop.debug.d.ts +0 -1
- package/dist/common/helpers.d.ts +1 -0
- package/dist/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.feat.mjs +1 -1
- package/dist/debug/dom/controllable-input.feat.js +1 -1
- package/dist/debug/dom/controllable-input.feat.mjs +1 -1
- package/dist/debug/dom/controllable-open.feat.js +1 -1
- package/dist/debug/dom/controllable-open.feat.mjs +1 -1
- package/dist/debug/dom/controllable-select.feat.js +1 -1
- package/dist/debug/dom/controllable-select.feat.mjs +1 -1
- package/dist/debug/dom/controllable-textarea.feat.js +1 -1
- package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/debug/dom/controllable.feat.js +1 -1
- package/dist/debug/dom/controllable.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.js +5 -0
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +4 -0
- package/dist/debug/dom/dynamic-tag-var.feat.js +2 -3
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +2 -3
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-BJKb8-wr.js → dom-CI0Vojyk.js} +146 -88
- package/dist/debug/{dom-Dq_Yu7MS.mjs → dom-tl43c2wO.mjs} +113 -85
- package/dist/debug/dom.js +10 -8
- package/dist/debug/dom.mjs +7 -8
- package/dist/debug/html.js +52 -26
- package/dist/debug/html.mjs +52 -26
- package/dist/dom/catch.feat.js +4 -4
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/control-flow.d.ts +5 -4
- package/dist/dom/controllable-input.feat.js +2 -2
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +2 -2
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +2 -2
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +2 -2
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +2 -2
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-script.feat.d.ts +1 -0
- package/dist/dom/dynamic-tag-script.feat.js +4 -0
- package/dist/dom/dynamic-tag-script.feat.mjs +4 -0
- package/dist/dom/dynamic-tag-var.feat.js +1 -2
- package/dist/dom/dynamic-tag-var.feat.mjs +2 -3
- package/dist/dom/load.d.ts +2 -2
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/renderer.d.ts +2 -3
- package/dist/dom/resume.d.ts +1 -0
- package/dist/dom/signals.d.ts +1 -1
- package/dist/{dom-CzfddxCE.mjs → dom-4udEPZaj.mjs} +77 -58
- package/dist/{dom-CzGPOsST.js → dom-C1mr-TA7.js} +213 -174
- package/dist/dom.d.ts +2 -2
- package/dist/dom.js +40 -42
- package/dist/dom.mjs +6 -8
- package/dist/html/dynamic-tag.d.ts +2 -1
- package/dist/html/serializer.d.ts +3 -2
- package/dist/html/writer.d.ts +6 -5
- package/dist/html.js +35 -20
- package/dist/html.mjs +35 -20
- package/dist/translator/index.js +2863 -2666
- package/dist/translator/util/binding-has-prop.d.ts +1 -0
- package/dist/translator/util/branch-tag.d.ts +6 -1
- package/dist/translator/util/optional.d.ts +2 -0
- package/dist/translator/util/references.d.ts +26 -12
- package/dist/translator/util/runtime.d.ts +2 -1
- package/dist/translator/util/sections.d.ts +11 -8
- package/dist/translator/util/serialize-guard.d.ts +1 -7
- package/dist/translator/util/serialize-reasons.d.ts +3 -0
- package/dist/translator/util/set-tag-sections-downstream.d.ts +1 -1
- package/dist/translator/util/signals.d.ts +4 -1
- package/dist/translator/util/structure.d.ts +1 -1
- package/dist/translator/util/tag-name-type.d.ts +1 -1
- package/dist/translator/visitors/function.d.ts +1 -0
- package/dist/translator/visitors/import-declaration.d.ts +1 -0
- package/dist/translator/visitors/tag/custom-tag.d.ts +5 -0
- package/package.json +4 -4
- package/tags/try.d.marko +2 -0
- package/tags-html.d.ts +6 -0
|
@@ -3,3 +3,4 @@ import type { Binding } from "./references";
|
|
|
3
3
|
import type { Section } from "./sections";
|
|
4
4
|
export declare function isSectionRendererElided(section: Section): boolean;
|
|
5
5
|
export declare function bindingHasProperty(binding: Binding, properties: Opt<string>): boolean;
|
|
6
|
+
export declare function getPropertyPathAlias(binding: Binding, properties: Opt<string>): Binding;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { types as t } from "@marko/compiler";
|
|
1
2
|
import { type Binding } from "./references";
|
|
2
|
-
import type
|
|
3
|
+
import { type Section } from "./sections";
|
|
4
|
+
import { type SerializeReason, type SerializeReasons } from "./serialize-reasons";
|
|
3
5
|
export declare function getBranchSectionAccessor(nodeBinding: Binding): NonNullable<Section["sectionAccessor"]>;
|
|
4
6
|
export declare function initBranchSection(bodySection: Section, upstreamExpression: Section["upstreamExpression"], sectionAccessor: Section["sectionAccessor"]): void;
|
|
5
7
|
export declare function resumeOwnerByMarkerWhenStatic(tagSection: Section, bodySection: Section, nodeBinding: Binding, statefulReasonKey: symbol): void;
|
|
8
|
+
export declare function getBranchResumeArgs(tag: t.NodePath<t.MarkoTag>, tagSection: Section, nodeBinding: Binding, branchReasons: SerializeReasons, statefulReasonKey: symbol, onlyChildParentTagName: string | false | undefined, singleNode: boolean): (t.Expression | undefined)[];
|
|
9
|
+
export declare function getBranchEndArgs(tag: t.NodePath<t.MarkoTag>, tagSection: Section, nodeBinding: Binding, statefulReason: SerializeReason | undefined, onlyChildParentTagName: string | false | undefined, singleNode: boolean | undefined): (t.Expression | undefined)[];
|
|
10
|
+
export declare function isSingleNodeBranch(bodySection: Section | undefined): boolean;
|
|
@@ -18,6 +18,8 @@ export declare class Sorted<T> {
|
|
|
18
18
|
has<U extends NonNullable<T>>(data: SortedOpt<U>, item: U): boolean;
|
|
19
19
|
findIndex<U extends NonNullable<T>>(data: SortedOpt<U>, item: U): number;
|
|
20
20
|
groupBy<U extends NonNullable<T>, K>(data: SortedOpt<U>, cb: (item: U) => K): Map<K, SortedOneMany<U>>;
|
|
21
|
+
intersects<U extends NonNullable<T>>(a: SortedOpt<U>, b: SortedOpt<U>): boolean;
|
|
22
|
+
difference<U extends NonNullable<T>>(a: SortedOpt<U>, b: SortedOpt<U>): SortedOpt<U>;
|
|
21
23
|
isSuperset<U extends NonNullable<T>>(superset: SortedOpt<U>, subset: SortedOpt<U>): boolean;
|
|
22
24
|
}
|
|
23
25
|
export declare function push<T>(data: Opt<T>, item: T): OneMany<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import type
|
|
2
|
+
import { type AccessorPrefix } from "../../common/accessor.debug";
|
|
3
3
|
import * as BindingType from "./constants/binding-type";
|
|
4
4
|
import { type Many, type Opt, type SortedMany, type SortedOpt, Sorted } from "./optional";
|
|
5
5
|
import { type Section } from "./sections";
|
|
@@ -43,14 +43,25 @@ export interface Binding {
|
|
|
43
43
|
property: string | undefined;
|
|
44
44
|
propertyAliases: Map<string, Binding>;
|
|
45
45
|
excludeProperties: SortedOpt<string>;
|
|
46
|
-
noSerialize: boolean;
|
|
47
|
-
noSerializeProperties: SortedOpt<string>;
|
|
48
46
|
upstreamAlias: Binding | undefined;
|
|
47
|
+
/** The value these `<for>` params iterate, by `of` or `in`. */
|
|
48
|
+
iterates: {
|
|
49
|
+
expr: t.NodeExtra;
|
|
50
|
+
type: "of" | "in";
|
|
51
|
+
} | undefined;
|
|
49
52
|
restOffset: number | undefined;
|
|
50
53
|
scopeOffset: Binding | undefined;
|
|
51
54
|
scopeAccessor: string | undefined;
|
|
52
55
|
export: string | undefined;
|
|
53
56
|
directContentExport: string | undefined;
|
|
57
|
+
/** A name declared for this value, or all of it but its `excludeProperties`
|
|
58
|
+
* (a rest element), even once pruned. */
|
|
59
|
+
declaredAlias: Binding | undefined;
|
|
60
|
+
/** The attribute tag `<for>` param a local closure holds in its section. */
|
|
61
|
+
upstreamLocal: Binding | undefined;
|
|
62
|
+
/** An attribute tag `<for>` param's local closure in each content the loop
|
|
63
|
+
* creates that reads it. */
|
|
64
|
+
localClosures: Map<Section, Binding> | undefined;
|
|
54
65
|
declared: boolean;
|
|
55
66
|
nullable: boolean;
|
|
56
67
|
pruned: boolean | undefined;
|
|
@@ -94,7 +105,8 @@ interface ExtraRead {
|
|
|
94
105
|
}
|
|
95
106
|
declare module "@marko/compiler/dist/types" {
|
|
96
107
|
interface ProgramExtra {
|
|
97
|
-
/**
|
|
108
|
+
/** The template emits a `$global` read, so HTML output declares a const
|
|
109
|
+
* for it. */
|
|
98
110
|
hasGlobalRead?: true;
|
|
99
111
|
}
|
|
100
112
|
interface NodeExtra {
|
|
@@ -104,6 +116,9 @@ declare module "@marko/compiler/dist/types" {
|
|
|
104
116
|
nodeBinding?: Binding;
|
|
105
117
|
referencedBindings?: ReferencedBindings;
|
|
106
118
|
downstream?: SortedOpt<Binding>;
|
|
119
|
+
/** The initial value of the binding it feeds, which keeps it rather than
|
|
120
|
+
* following it, so the binding derives no sources from it. */
|
|
121
|
+
initialValue?: true;
|
|
107
122
|
/** The tag-root `KnownExprs` of the call site that linked this expression
|
|
108
123
|
* to a downstream template's binding, for dereferencing its reasons. */
|
|
109
124
|
downstreamExprs?: KnownExprs;
|
|
@@ -115,16 +130,17 @@ declare module "@marko/compiler/dist/types" {
|
|
|
115
130
|
/** The expression this node sits in: dropped or merged as one. */
|
|
116
131
|
exprRoot?: NodeExtra;
|
|
117
132
|
isEffect?: true;
|
|
118
|
-
/**
|
|
119
|
-
|
|
133
|
+
/** A value here may reach the client as written (a change handler, a
|
|
134
|
+
* native spread, a dynamic tag's input), so a function in it registers. */
|
|
135
|
+
forceRegister?: true;
|
|
120
136
|
invokeOnly?: true;
|
|
121
137
|
lazyBindings?: ReferencedBindings;
|
|
122
138
|
/** `$global` bindings this expression reads: the root means an opaque
|
|
123
139
|
* (dynamic/aliased) read, a property alias names the key. */
|
|
124
140
|
globalBindings?: ReferencedBindings;
|
|
125
|
-
|
|
141
|
+
/** The bindings this expression reads only by spreading them as is. */
|
|
142
|
+
spreadFrom?: SortedOpt<Binding>;
|
|
126
143
|
nativeTagSpread?: true;
|
|
127
|
-
nativeTagSpreadMerged?: true;
|
|
128
144
|
merged?: NodeExtra;
|
|
129
145
|
}
|
|
130
146
|
interface FunctionExtra {
|
|
@@ -157,7 +173,6 @@ export declare function trackGlobalReference(path: t.NodePath<t.Identifier>): vo
|
|
|
157
173
|
export declare function mergeReferences<T extends t.Node>(section: Section, target: T, nodes: (t.Node | undefined)[]): NonNullable<T["extra"]> & ReferencedExtra;
|
|
158
174
|
export declare function compareReferences(a: ReferencedBindings, b: ReferencedBindings): number;
|
|
159
175
|
export declare function finalizeReferences(): void;
|
|
160
|
-
export declare function dropReferencedBindings(expr: ReferencedExtra, drop: ReferencedBindings): boolean;
|
|
161
176
|
/**
|
|
162
177
|
* Every member computed from one local source in the same pass, or the
|
|
163
178
|
* intersection's own render id and scope offset.
|
|
@@ -173,7 +188,6 @@ type IntersectionMeta = {
|
|
|
173
188
|
};
|
|
174
189
|
export declare const intersectionMeta: WeakMap<Intersection, IntersectionMeta>;
|
|
175
190
|
export declare function setBindingDownstream(binding: Binding, expr: boolean | Opt<t.NodeExtra>, exprs?: KnownExprs): void;
|
|
176
|
-
export declare function setBindingValueExprs(binding: Binding, expr: boolean | Opt<t.NodeExtra>): void;
|
|
177
191
|
export declare function createSources(state: Sources["state"], param: Sources["param"], global?: Sources["global"], forced?: Sources["forced"]): Sources;
|
|
178
192
|
export declare function compareSources(a: Sources, b: Sources): number;
|
|
179
193
|
export declare function mergeSources(a: undefined | Sources, b: undefined | Sources): Sources | undefined;
|
|
@@ -186,9 +200,9 @@ export declare function dropNodes(node: t.Node | t.Node[]): void;
|
|
|
186
200
|
export declare function untrackNode(node: t.Node): void;
|
|
187
201
|
export declare function getCanonicalBinding(binding: Binding): Binding;
|
|
188
202
|
export declare function someAlias<A>(binding: Binding, test: (binding: Binding, arg: A) => boolean, arg: A, directOnly?: boolean): boolean;
|
|
189
|
-
export declare function someUpstream<A>(binding: Binding, test: (binding: Binding, arg: A) => boolean, arg: A): boolean;
|
|
203
|
+
export declare function someUpstream<A>(binding: Binding | undefined, test: (binding: Binding, arg: A) => boolean, arg: A): boolean;
|
|
190
204
|
export declare function isDirectAlias(binding: Binding): boolean;
|
|
191
|
-
export declare function getAllTagReferenceNodes(tag: t.MarkoTag, referenceNodes?: t.Node[]): t.Node[];
|
|
205
|
+
export declare function getAllTagReferenceNodes(tag: t.MarkoTag, referenceNodes?: t.Node[], getAttrTagNodes?: (attrTag: t.MarkoTag) => t.Node[]): t.Node[];
|
|
192
206
|
export declare function getScopeAccessorLiteral(binding: Binding, encoded?: boolean, includeId?: boolean): t.NumericLiteral | t.StringLiteral;
|
|
193
207
|
export declare function getScopeAccessor(binding: Binding, encoded?: boolean, includeId?: boolean): string;
|
|
194
208
|
export declare function getLocalsScopeAccessor(binding: Binding): string;
|
|
@@ -6,7 +6,8 @@ export type HTMLRuntimeHelpers = keyof typeof import("../../html");
|
|
|
6
6
|
export declare function importRuntime(name: DOMRuntimeHelpers | HTMLRuntimeHelpers): t.Identifier;
|
|
7
7
|
export declare function registerRuntimeValue(id: string, value: t.Expression): t.AssignmentExpression;
|
|
8
8
|
export declare function callRuntime(name: DOMRuntimeHelpers | HTMLRuntimeHelpers, ...args: Array<Parameters<typeof t.callExpression>[1][number] | Falsy>): t.CallExpression;
|
|
9
|
-
export declare
|
|
9
|
+
export declare function dynamicImport(request: string, ...handlers: Array<t.Expression | Falsy>): t.CallExpression;
|
|
10
|
+
export declare const domRuntimeFeatures: readonly ["catch", "controllable", "controllable-input", "controllable-open", "controllable-select", "controllable-textarea", "dynamic-tag-script", "dynamic-tag-var", "placeholder"];
|
|
10
11
|
export type DOMRuntimeFeature = (typeof domRuntimeFeatures)[number];
|
|
11
12
|
export declare function importRuntimeFeature(feature: DOMRuntimeFeature): void;
|
|
12
13
|
export declare function getHTMLRuntime(): {
|
|
@@ -4,7 +4,7 @@ import type { WalkCode } from "../../common/types";
|
|
|
4
4
|
import * as ContentType from "./constants/content-type";
|
|
5
5
|
import type * as Step from "./constants/step";
|
|
6
6
|
import * as StructureKind from "./constants/structure-kind";
|
|
7
|
-
import { type OneMany, type Opt, Sorted } from "./optional";
|
|
7
|
+
import { type OneMany, type Opt, Sorted, type SortedOpt } from "./optional";
|
|
8
8
|
import { type Binding, type InputBinding, type KnownExprs, type ParamBinding, type ReferencedBindings, type Sources } from "./references";
|
|
9
9
|
import { type SerializeKey, type SerializeReason, type SerializeReasons } from "./serialize-reasons";
|
|
10
10
|
export interface ParamSerializeReasonGroup {
|
|
@@ -56,7 +56,9 @@ export interface Section {
|
|
|
56
56
|
prefix: AccessorPrefix;
|
|
57
57
|
} | undefined;
|
|
58
58
|
params: undefined | ParamBinding | InputBinding;
|
|
59
|
-
|
|
59
|
+
/** The attribute tag `<for>` params this content reads, held as its own
|
|
60
|
+
* bindings that the loop binds as it creates it. */
|
|
61
|
+
localClosures: ReferencedBindings;
|
|
60
62
|
referencedClosures: ReferencedBindings;
|
|
61
63
|
referencedHoists: ReferencedBindings;
|
|
62
64
|
bindings: ReferencedBindings;
|
|
@@ -78,11 +80,13 @@ export interface Section {
|
|
|
78
80
|
returnSerializeReason: SerializeReason | undefined;
|
|
79
81
|
isHoistThrough: true | undefined;
|
|
80
82
|
upstreamExpression: t.NodeExtra | undefined;
|
|
83
|
+
/** For a `<define>` body, the sections whose direct calls render it. */
|
|
84
|
+
callSections: SortedOpt<Section>;
|
|
81
85
|
/** The content's rendering tag (its extra), and each child binding the
|
|
82
|
-
* content feeds
|
|
86
|
+
* content feeds, at `properties`. */
|
|
83
87
|
downstream: {
|
|
84
88
|
tag: t.MarkoTagExtra;
|
|
85
|
-
binding:
|
|
89
|
+
binding: OneMany<Binding>;
|
|
86
90
|
properties: Opt<string>;
|
|
87
91
|
exprs: KnownExprs | undefined;
|
|
88
92
|
} | undefined;
|
|
@@ -118,17 +122,16 @@ export declare const getSectionParentIsOwner: (section: Section) => boolean, set
|
|
|
118
122
|
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;
|
|
119
123
|
export declare function forEachSection(fn: (section: Section) => void): void;
|
|
120
124
|
export declare function getChildSections(section: Section): Section[];
|
|
121
|
-
export declare function
|
|
125
|
+
export declare function getContentClosures(section: Section): ReferencedBindings;
|
|
126
|
+
export declare function forEachAncestorSection<A>(from: Section, to: Section, fn: (section: Section, arg: A) => void, arg: A): void;
|
|
122
127
|
export declare function forEachSectionReverse(fn: (section: Section) => void): void;
|
|
123
128
|
export declare function getNodeContentType(path: t.NodePath<t.Statement>, extraMember: "startType" | "endType", contentInfo?: Section["content"]): ContentType.Value | null;
|
|
124
129
|
export declare function getSectionRegisterReasons(section: Section): boolean | Sources;
|
|
125
|
-
export declare function isSectionRegisterDynamic(section: Section, registerReason: true | SerializeReason): boolean;
|
|
126
|
-
export declare function isSectionRegisterEager(section: Section): boolean;
|
|
127
130
|
export declare function isImmediateOwner(section: Section, binding: Binding): boolean;
|
|
128
131
|
export declare function isDirectClosure(section: Section, closure: Binding): boolean;
|
|
129
132
|
export declare function isDynamicClosure(section: Section, closure: Binding): boolean;
|
|
130
133
|
export declare function getDynamicClosureIndex(closure: Binding, closureSection: Section): number;
|
|
131
|
-
export declare function getDirectClosures(section: Section):
|
|
134
|
+
export declare function getDirectClosures(section: Section): SortedOpt<Binding>;
|
|
132
135
|
export declare function isSameOrChildSection(section: Section, other: Section): boolean;
|
|
133
136
|
export declare function getCommonSection(section: Section, other: Section): Section;
|
|
134
137
|
export declare function finalizeParamSerializeReasonGroups(section: Section): void;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Sources } from "./references";
|
|
3
2
|
import { type Section } from "./sections";
|
|
4
3
|
import { type SerializeReason, type SerializeReasons } from "./serialize-reasons";
|
|
5
|
-
type DynamicSerializeReason = Sources & {
|
|
6
|
-
state: undefined;
|
|
7
|
-
};
|
|
8
4
|
export declare function buildGroupMask(groups: {
|
|
9
5
|
value: number | t.Expression | undefined;
|
|
10
6
|
names: string;
|
|
11
7
|
}[]): t.Expression | undefined;
|
|
12
|
-
export declare function
|
|
8
|
+
export declare function getScopeReasonStatement(section: Section): t.Statement;
|
|
13
9
|
export declare function getSerializeGuard(section: Section, reason: undefined | SerializeReason, optional: boolean): t.Expression | undefined;
|
|
14
10
|
export declare function getSerializeGuardForAny(section: Section, reasons: undefined | SerializeReasons, optional: boolean): t.Expression | undefined;
|
|
15
11
|
export declare function getExprIfSerialized<T extends undefined | SerializeReason, R extends (T extends {} ? t.Expression : undefined)>(section: Section, reason: T, expr: t.Expression): R;
|
|
16
|
-
export declare function isDynamicSerializeGuard(section: Section, reason: undefined | SerializeReason): reason is DynamicSerializeReason;
|
|
17
|
-
export {};
|
|
@@ -20,13 +20,16 @@ export declare function isReasonDynamic(reason: undefined | SerializeReason): re
|
|
|
20
20
|
};
|
|
21
21
|
export declare function isStaticSerializeReason(reason: undefined | SerializeReason): reason is SerializeReason;
|
|
22
22
|
export declare function isStateSerializeReason(reason: undefined | SerializeReason): reason is Sources;
|
|
23
|
+
export declare function hasSerializeReasons(section: Section | undefined): boolean;
|
|
23
24
|
export declare function getSerializeReason(section: Section, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): Sources | undefined;
|
|
24
25
|
export declare function getSerializeSourcesForExpr(expr: t.NodeExtra): Sources | undefined;
|
|
25
26
|
export declare function getSerializeSourcesForExprs(exprs: Opt<t.NodeExtra> | boolean): Sources | undefined;
|
|
26
27
|
export declare function getSerializeSourcesForRef(ref: ReferencedBindings): Sources | undefined;
|
|
28
|
+
export declare function getSerializeSourcesForDownstream({ binding, exprs, properties, }: NonNullable<Section["downstream"]>): Sources | undefined;
|
|
27
29
|
export declare function mapParamReason(program: Section, reason: Sources, exprs: KnownExprs | undefined, ownParams: boolean): SerializeReason | undefined;
|
|
28
30
|
export declare function mergeSerializeReasons(a: SerializeReason, b: undefined | SerializeReason): SerializeReason;
|
|
29
31
|
export declare function mergeSerializeReasons(a: undefined | SerializeReason, b: SerializeReason): SerializeReason;
|
|
30
32
|
export declare function mergeSerializeReasons(a: undefined | SerializeReason, b: undefined | SerializeReason): SerializeReason | undefined;
|
|
31
33
|
export declare function applySerializeExprs(section: Section): void;
|
|
32
34
|
export declare function finalizeSerializeReason(section: Section): void;
|
|
35
|
+
export declare function getSerializeReasonsVersion(): number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import { type Opt } from "./optional";
|
|
3
|
-
import {
|
|
3
|
+
import type { Binding, KnownExprs } from "./references";
|
|
4
4
|
import { type Section } from "./sections";
|
|
5
5
|
export declare function setTagDownstream(tag: t.NodePath<t.MarkoTag>, binding: Opt<Binding>, exprs?: KnownExprs): void;
|
|
6
6
|
export declare function finalizeTagDownstreams(section: Section): void;
|
|
@@ -37,8 +37,11 @@ export interface Signal {
|
|
|
37
37
|
type closureSignalBuilder = (closure: Binding, render: t.Expression) => t.Expression;
|
|
38
38
|
export declare const getSignals: (section: Section) => Map<unknown, Signal>;
|
|
39
39
|
export declare function setClosureSignalBuilder(tag: t.NodePath<t.MarkoTag>, builder: closureSignalBuilder): void;
|
|
40
|
-
export declare const getTryHasPlaceholder: (section: Section) => true | undefined, setTryHasPlaceholder: (section: Section, value: true | undefined) => void;
|
|
41
40
|
export declare function setSectionOwnerResumedByMarker(section: Section): void;
|
|
41
|
+
export declare function getContentClosureValues(bodySection: Section): {
|
|
42
|
+
scope: t.Identifier;
|
|
43
|
+
levels: t.Expression[];
|
|
44
|
+
} | undefined;
|
|
42
45
|
export declare function setSectionSerializedValue(section: Section, prop: AccessorProp, expression: t.Expression): void;
|
|
43
46
|
export declare function setBindingSerializedValue(section: Section, binding: Binding, expression: t.Expression, prefix?: AccessorPrefix): void;
|
|
44
47
|
export declare function setSectionDebugVar(section: Section, accessor: string, name: string, loc: t.SourceLocation | null | undefined): void;
|
|
@@ -19,9 +19,9 @@ export declare function resolveStructure(section: Section): ResolvedStructure;
|
|
|
19
19
|
interface SectionMeta {
|
|
20
20
|
walks: t.Expression | undefined;
|
|
21
21
|
writes: t.Expression | undefined;
|
|
22
|
-
decls: t.VariableDeclarator[] | undefined;
|
|
23
22
|
}
|
|
24
23
|
export declare const getSectionMeta: (section: Section) => SectionMeta;
|
|
24
|
+
export declare function writeStructureExports(program: t.NodePath<t.Program>): void;
|
|
25
25
|
export declare function getSectionMetaIdentifiers(section: Section): SectionMeta;
|
|
26
26
|
/** `_content` strips trailing exit codes before it walks, so a renderer that
|
|
27
27
|
* reaches the runtime through it never needs them on the wire. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import type
|
|
2
|
+
import { type LoadImportConfig } from "../visitors/import-declaration";
|
|
3
3
|
import * as TagNameType from "./constants/tag-name-type";
|
|
4
4
|
declare module "@marko/compiler/dist/types" {
|
|
5
5
|
interface ProgramExtra {
|
|
@@ -17,6 +17,7 @@ declare const _default: {
|
|
|
17
17
|
analyze(this: unknown, fn: t.NodePath<t.Function>): void;
|
|
18
18
|
};
|
|
19
19
|
export default _default;
|
|
20
|
+
export declare function resolveFunctionRegisterReasons(): void;
|
|
20
21
|
export declare function finalizeFunctionRegistry(): void;
|
|
21
22
|
/**
|
|
22
23
|
* Tracks a function imported from another template that reserved a register id.
|
|
@@ -17,4 +17,9 @@ declare const _default: {
|
|
|
17
17
|
};
|
|
18
18
|
export default _default;
|
|
19
19
|
export declare function getTagRelativePath(tag: t.NodePath<t.MarkoTag>): string;
|
|
20
|
+
/**
|
|
21
|
+
* A known wrong tag that resolves to nothing, eg `interface P { id: number }`,
|
|
22
|
+
* whose body lands in attribute position before tag resolution would run.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isUnresolvedKnownWrongTag(tag: t.NodePath<t.MarkoTag>): boolean;
|
|
20
25
|
export declare function tagNotFoundError(tag: t.NodePath<t.MarkoTag>): Error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.54",
|
|
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.
|
|
54
|
+
"@marko/compiler": "^5.42.7",
|
|
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.3.
|
|
61
|
-
"marko": "5.39.
|
|
60
|
+
"@marko/runtime-tags": "npm:marko@6.3.54",
|
|
61
|
+
"marko": "5.39.43"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22"
|
package/tags/try.d.marko
CHANGED
|
@@ -3,5 +3,7 @@
|
|
|
3
3
|
export interface Input {
|
|
4
4
|
content: Marko.Body,
|
|
5
5
|
placeholder?: Marko.AttrTag<{ content?: Marko.Body }>,
|
|
6
|
+
// `any` keeps the documented `${err.message}` working; annotating the
|
|
7
|
+
// parameter as `|err: unknown|` opts a catch into narrowing.
|
|
6
8
|
catch?: Marko.AttrTag<{ content?: Marko.Body<[any]> }>,
|
|
7
9
|
}
|
package/tags-html.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ declare global {
|
|
|
94
94
|
s: NativeTag<Marko.HTML.S, HTMLElement>;
|
|
95
95
|
samp: NativeTag<Marko.HTML.Samp, HTMLElement>;
|
|
96
96
|
script: NativeTag<Marko.HTML.Script, HTMLScriptElement>;
|
|
97
|
+
search: NativeTag<Marko.HTML.Search, HTMLElement>;
|
|
97
98
|
section: NativeTag<Marko.HTML.Section, HTMLElement>;
|
|
98
99
|
select: NativeTag<Marko.HTML.Select, HTMLSelectElement>;
|
|
99
100
|
slot: NativeTag<Marko.HTML.Slot, HTMLSlotElement>;
|
|
@@ -1986,6 +1987,7 @@ declare global {
|
|
|
1986
1987
|
language?: AttrString;
|
|
1987
1988
|
}
|
|
1988
1989
|
|
|
1990
|
+
interface Search extends HTMLAttributes<HTMLElement> {}
|
|
1989
1991
|
interface Section extends HTMLAttributes<HTMLElement> {}
|
|
1990
1992
|
interface Select extends HTMLAttributes<HTMLSelectElement> {
|
|
1991
1993
|
/**
|
|
@@ -4406,6 +4408,8 @@ declare global {
|
|
|
4406
4408
|
|
|
4407
4409
|
/**
|
|
4408
4410
|
* Provide body content for the tag as a Marko.Body.
|
|
4411
|
+
* Native tags render it without params; a component whose body receives values
|
|
4412
|
+
* should `Omit<Marko.HTML.Div, "content">` and declare its own `content`.
|
|
4409
4413
|
* @see Marko.Body
|
|
4410
4414
|
*/
|
|
4411
4415
|
content?:
|
|
@@ -4457,6 +4461,8 @@ declare global {
|
|
|
4457
4461
|
|
|
4458
4462
|
/**
|
|
4459
4463
|
* Provide body content for the tag as a Marko.Body.
|
|
4464
|
+
* Native tags render it without params; a component whose body receives values
|
|
4465
|
+
* should `Omit<Marko.SVG.Path, "content">` and declare its own `content`.
|
|
4460
4466
|
* @see Marko.Body
|
|
4461
4467
|
*/
|
|
4462
4468
|
content?:
|