marko 6.4.9 → 6.4.11
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 -1
- package/dist/common/accessor.d.ts +0 -3
- package/dist/common/accessor.debug.d.ts +0 -3
- package/dist/common/helpers.d.ts +1 -1
- package/dist/common/types.d.ts +4 -3
- package/dist/debug/dom/catch.feat.js +2 -3
- package/dist/debug/dom/catch.feat.mjs +2 -3
- package/dist/debug/dom/controllable-input.feat.js +2 -3
- package/dist/debug/dom/controllable-input.feat.mjs +2 -3
- package/dist/debug/dom/controllable-open.feat.js +2 -3
- package/dist/debug/dom/controllable-open.feat.mjs +2 -3
- package/dist/debug/dom/controllable-select.feat.js +2 -3
- package/dist/debug/dom/controllable-select.feat.mjs +2 -3
- package/dist/debug/dom/controllable-textarea.feat.js +2 -3
- package/dist/debug/dom/controllable-textarea.feat.mjs +2 -3
- package/dist/debug/dom/controllable.feat.js +2 -3
- package/dist/debug/dom/controllable.feat.mjs +2 -3
- package/dist/debug/dom/dynamic-tag-script.feat.js +2 -3
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +2 -3
- 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/lazy.feat.js +2 -3
- package/dist/debug/dom/lazy.feat.mjs +2 -3
- package/dist/debug/dom/placeholder.feat.js +2 -3
- package/dist/debug/dom/placeholder.feat.mjs +2 -3
- package/dist/debug/{dom-VKjkbuuo.mjs → dom-DjUZd-9y.mjs} +221 -261
- package/dist/debug/{dom-QkYva5Qx.js → dom-mQ5mPBTF.js} +226 -260
- package/dist/debug/dom.js +10 -18
- package/dist/debug/dom.mjs +10 -19
- package/dist/debug/html.js +87 -125
- package/dist/debug/html.mjs +87 -125
- package/dist/dom/abort-signal.d.ts +1 -1
- package/dist/dom/catch.feat.js +4 -5
- package/dist/dom/catch.feat.mjs +2 -3
- package/dist/dom/control-flow.d.ts +4 -4
- package/dist/dom/controllable-input.feat.js +1 -2
- package/dist/dom/controllable-input.feat.mjs +1 -2
- package/dist/dom/controllable-open.feat.js +2 -3
- package/dist/dom/controllable-open.feat.mjs +2 -3
- package/dist/dom/controllable-select.feat.js +2 -3
- package/dist/dom/controllable-select.feat.mjs +2 -3
- package/dist/dom/controllable-textarea.feat.js +2 -3
- package/dist/dom/controllable-textarea.feat.mjs +2 -3
- package/dist/dom/controllable.feat.js +1 -2
- package/dist/dom/controllable.feat.mjs +1 -2
- package/dist/dom/dynamic-tag-script.feat.js +3 -4
- package/dist/dom/dynamic-tag-script.feat.mjs +2 -3
- package/dist/dom/dynamic-tag-var.feat.js +3 -4
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -2
- package/dist/dom/lazy.feat.js +2 -3
- package/dist/dom/lazy.feat.mjs +2 -3
- package/dist/dom/load.d.ts +3 -4
- package/dist/dom/placeholder.feat.js +2 -3
- package/dist/dom/placeholder.feat.mjs +2 -3
- package/dist/dom/queue.d.ts +1 -2
- package/dist/dom/signals.d.ts +5 -7
- package/dist/{dom-IujlfJ6b.js → dom-B8j2453O.js} +158 -190
- package/dist/{dom-DtKQb840.mjs → dom-HEWdZCCb.mjs} +134 -172
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +22 -30
- package/dist/dom.mjs +10 -19
- package/dist/html/assets.d.ts +3 -4
- package/dist/html/for.d.ts +0 -1
- package/dist/html/writer.d.ts +2 -2
- package/dist/html.d.ts +1 -1
- package/dist/html.js +99 -131
- package/dist/html.mjs +99 -132
- package/dist/translator/index.d.ts +0 -1
- package/dist/translator/index.js +4771 -4760
- package/dist/translator/interop/out-global.d.ts +5 -0
- package/dist/translator/util/assert.d.ts +13 -2
- package/dist/translator/util/entry-builder.d.ts +1 -1
- package/dist/translator/util/finalize-references.d.ts +2 -1
- package/dist/translator/util/for-selector.d.ts +1 -1
- package/dist/translator/util/known-tag.d.ts +10 -1
- package/dist/translator/util/references.d.ts +11 -5
- package/dist/translator/util/runtime.d.ts +1 -0
- package/dist/translator/util/sections.d.ts +6 -1
- package/dist/translator/util/signals.d.ts +2 -1
- package/dist/translator/util/sources.d.ts +1 -1
- package/dist/translator/util/style-interpolation.d.ts +1 -1
- package/dist/translator/util/tag-name-type.d.ts +4 -0
- package/dist/translator/util/visitors.d.ts +1 -1
- package/dist/translator/util/write-guard.d.ts +2 -0
- package/dist/translator/visitors/program/index.d.ts +0 -4
- package/dist/translator/visitors/referenced-identifier.d.ts +3 -1
- package/package.json +6 -6
- package/tags/lifecycle.d.marko +2 -0
- package/dist/common/constants/keyed-scopes-prop.d.ts +0 -4
- package/dist/common/constants/keyed-scopes-prop.debug.d.ts +0 -4
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import { type ForType } from "./branch-tag";
|
|
3
3
|
export declare function assertNoSpreadAttrs(tag: t.NodePath<t.MarkoTag>): void;
|
|
4
|
-
export declare function assertOnlyValueAttr(tag: t.NodePath<t.MarkoTag>, required: true, change?: boolean, hint?: (attr: t.MarkoAttribute) => string | undefined):
|
|
5
|
-
|
|
4
|
+
export declare function assertOnlyValueAttr(tag: t.NodePath<t.MarkoTag>, required: true, change?: boolean, hint?: (attr: t.MarkoAttribute) => string | undefined): {
|
|
5
|
+
valueAttr: t.MarkoAttribute;
|
|
6
|
+
valueChangeAttr: t.MarkoAttribute | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare function assertOnlyValueAttr(tag: t.NodePath<t.MarkoTag>, required?: boolean, change?: boolean, hint?: (attr: t.MarkoAttribute) => string | undefined): {
|
|
9
|
+
valueAttr: t.MarkoAttribute | undefined;
|
|
10
|
+
valueChangeAttr: t.MarkoAttribute | undefined;
|
|
11
|
+
};
|
|
6
12
|
export declare function assertHasVar(tag: t.NodePath<t.MarkoTag>, hint?: string | ((tag: t.NodePath<t.MarkoTag>) => string)): void;
|
|
7
13
|
export declare function assertIdentifierVar(tag: t.NodePath<t.MarkoTag>): void;
|
|
8
14
|
export declare function assertNoTagVarMutation(tag: t.NodePath<t.MarkoTag>): void;
|
|
9
15
|
export declare function assertHasBody(tag: t.NodePath<t.MarkoTag>): void;
|
|
10
16
|
export declare function assertNoBodyContent(tag: t.NodePath<t.MarkoTag>): void;
|
|
11
17
|
export declare function buildAttrsError(tag: t.NodePath<t.MarkoTag>, attrs: t.MarkoTag["attributes"], msg: string): Error;
|
|
18
|
+
export declare function buildAttrError(tag: t.NodePath<t.MarkoTag>, attr: t.MarkoTag["attributes"][number], msg: string): Error;
|
|
12
19
|
export declare function buildAttrNameError(tag: t.NodePath<t.MarkoTag>, attr: t.MarkoAttribute, msg: string): Error;
|
|
20
|
+
export declare function buildDuplicateAttrError(tag: t.NodePath<t.MarkoTag>, attr: t.MarkoAttribute): Error;
|
|
13
21
|
/** The loop a `<for>` tag's attributes run, which it requires. */
|
|
14
22
|
export declare function assertForType(tag: t.NodePath<t.MarkoTag>): ForType;
|
|
15
23
|
/** The attributes a loop of `type` takes, besides `by=`. */
|
|
16
24
|
export declare function getForAttrs(type: ForType): string[];
|
|
17
25
|
/** Throws for a param that a loop of `type` never supplies. */
|
|
18
26
|
export declare function assertForParams(tag: t.NodePath<t.MarkoTag>, type: ForType): void;
|
|
27
|
+
export declare function coreTagLink(tag: t.NodePath<t.MarkoTag>): string;
|
|
28
|
+
export declare function isValueAttr(attr: t.MarkoTag["attributes"][number]): attr is t.MarkoAttribute;
|
|
29
|
+
export declare function isValueChangeAttr(attr: t.MarkoTag["attributes"][number]): attr is t.MarkoAttribute;
|
|
@@ -34,7 +34,7 @@ export type Reach = 0 | 1 | 2;
|
|
|
34
34
|
type EntryFile = t.BabelFile & {
|
|
35
35
|
[kState]?: EntryState;
|
|
36
36
|
};
|
|
37
|
-
type VisitChild = (id: string, reach?: Reach) => void;
|
|
37
|
+
export type VisitChild = (id: string, reach?: Reach) => void;
|
|
38
38
|
declare const kState: unique symbol;
|
|
39
39
|
declare const builder: {
|
|
40
40
|
build(entryFile: EntryFile, exportInit?: boolean): t.Statement[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Binding, type Intersection } from "./bindings";
|
|
2
|
+
import { type Binding, type Intersection, type ReferencedBindings } from "./bindings";
|
|
3
3
|
import { type Section } from "./sections";
|
|
4
4
|
export declare function finalizeReferences(): Map<Section, Intersection[]>;
|
|
5
5
|
export declare function allocateIds(intersectionsBySection: Map<Section, Intersection[]>): void;
|
|
6
|
+
export declare function getLastOwnSourceReturn(bindings: ReferencedBindings, section: Section): Binding | undefined;
|
|
6
7
|
export declare function readsValuesOnResume(expr: t.NodeExtra): boolean;
|
|
7
8
|
export declare function hasEmittedAssignment(binding: Binding): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Binding } from "./bindings";
|
|
2
|
-
import {
|
|
2
|
+
import type { Section } from "./sections";
|
|
3
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;
|
|
@@ -6,6 +6,7 @@ import { type Section } from "./sections";
|
|
|
6
6
|
import { type Sources } from "./sources";
|
|
7
7
|
declare const kParamsTree: unique symbol;
|
|
8
8
|
declare const kKnownExprs: unique symbol;
|
|
9
|
+
declare const kPassesInput: unique symbol;
|
|
9
10
|
declare module "@marko/compiler/dist/types" {
|
|
10
11
|
interface MarkoTagExtra {
|
|
11
12
|
/** The dom binding a known tag holds its child's scope in. */
|
|
@@ -15,6 +16,8 @@ declare module "@marko/compiler/dist/types" {
|
|
|
15
16
|
/** The child's params tree the call site was analyzed against. */
|
|
16
17
|
[kParamsTree]?: ParamsTree;
|
|
17
18
|
[kKnownExprs]?: KnownExprs;
|
|
19
|
+
/** The call passes its input after its arguments, as written in source. */
|
|
20
|
+
[kPassesInput]?: boolean;
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
export interface KnownTagExtra extends t.MarkoTagExtra {
|
|
@@ -24,9 +27,15 @@ export interface KnownTagExtra extends t.MarkoTagExtra {
|
|
|
24
27
|
export declare function knownTagAnalyze(tag: t.NodePath<t.MarkoTag>, childSection: Section, childParamsTree?: ParamsTree): void;
|
|
25
28
|
export declare function analyzeRecursiveTags(): void;
|
|
26
29
|
export declare function knownTagTranslateHTML(tag: t.NodePath<t.MarkoTag>, tagIdentifier: t.Expression): void;
|
|
27
|
-
export declare function knownTagTranslateDOM(tag: t.NodePath<t.MarkoTag>, getBindingIdentifier:
|
|
30
|
+
export declare function knownTagTranslateDOM(tag: t.NodePath<t.MarkoTag>, getBindingIdentifier: TranslateDOMInfo["getBindingIdentifier"], callSetup: ((section: Section, childBinding: Binding) => void) | undefined): void;
|
|
28
31
|
export declare function getCallSiteSources(param: ParamBinding): Sources | undefined;
|
|
29
32
|
export declare function addTagVarBindings(section: Section): void;
|
|
30
33
|
export declare function addKnownTagReasons(section: Section): void;
|
|
31
34
|
export declare function callsOtherTemplateSetup(section: Section): boolean;
|
|
35
|
+
type TranslateDOMInfo = {
|
|
36
|
+
tagSection: Section;
|
|
37
|
+
knownExprs: KnownExprs;
|
|
38
|
+
getBindingIdentifier: (binding: Binding, preferredName?: string, directContent?: boolean) => t.Identifier;
|
|
39
|
+
childScopeBinding: Binding;
|
|
40
|
+
};
|
|
32
41
|
export {};
|
|
@@ -7,7 +7,7 @@ interface ReferencedFunctionExtra extends t.FunctionExtra, ReferencedExtra {
|
|
|
7
7
|
}
|
|
8
8
|
export interface Read {
|
|
9
9
|
binding: Binding;
|
|
10
|
-
extra:
|
|
10
|
+
extra: ReadExtra;
|
|
11
11
|
inOwnBody: boolean;
|
|
12
12
|
getter: Getter | undefined;
|
|
13
13
|
comparedTo: t.Node | undefined;
|
|
@@ -53,8 +53,9 @@ declare module "@marko/compiler/dist/types" {
|
|
|
53
53
|
/** The initial value of the binding it derives, which keeps it rather than
|
|
54
54
|
* following it, so the binding derives no sources from it. */
|
|
55
55
|
initialValue?: true;
|
|
56
|
-
/** Its value has no side effect to evaluate, so an unread one can go
|
|
57
|
-
* expression's from `evaluate`, a tag's from its
|
|
56
|
+
/** Its value has no side effect to evaluate, so an unread one can go and
|
|
57
|
+
* a read one can move: an expression's from `evaluate`, a tag's from its
|
|
58
|
+
* value attributes. */
|
|
58
59
|
pure?: boolean;
|
|
59
60
|
/** The tag-root `KnownExprs` of the call site that linked this expression
|
|
60
61
|
* to a derives template's binding, for dereferencing its reasons. */
|
|
@@ -107,7 +108,7 @@ declare module "@marko/compiler/dist/types" {
|
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
export declare function isTagVarUsed(tag: t.NodePath<t.MarkoTag>): boolean;
|
|
110
|
-
export declare function trackDomVarReferences(tag: t.NodePath<t.MarkoTag>, binding: Binding):
|
|
111
|
+
export declare function trackDomVarReferences(tag: t.NodePath<t.MarkoTag>, binding: Binding): void;
|
|
111
112
|
export declare function trackVarReferences(tag: t.NodePath<t.MarkoTag>, type: BindingType, aliased?: Binding["aliasOf"]): Binding | undefined;
|
|
112
113
|
export declare function trackParamsReferences(body: t.NodePath<t.MarkoTagBody | t.Program>, type: BindingType): Binding | undefined;
|
|
113
114
|
export declare function isReferenceHoisted(bindingPath: t.NodePath, reference: t.NodePath): boolean;
|
|
@@ -123,17 +124,21 @@ export declare const getReadsByExpression: () => Map<ReferencedExtra, Opt<Read>>
|
|
|
123
124
|
export declare const getFunctionReadsByExpression: () => Map<ReferencedExtra, Map<ReferencedFunctionExtra, OneMany<Read>>>;
|
|
124
125
|
export declare const getReferenceFinalizers: () => (() => void)[];
|
|
125
126
|
export declare function onFinalizeReferences(finalize: () => void): void;
|
|
126
|
-
export declare function addRead(exprExtra: ReferencedExtra, extra: t.NodeExtra, binding: Binding, section: Section, getter: Getter | undefined): Read;
|
|
127
|
+
export declare function addRead(exprExtra: ReferencedExtra, extra: t.NodeExtra, exprRoot: t.NodeExtra, binding: Binding, section: Section, getter: Getter | undefined): Read;
|
|
127
128
|
export declare function dropNodes(node: t.Node | t.Node[]): void;
|
|
128
129
|
export declare function dropExpr(exprExtra: ReferencedExtra): void;
|
|
129
130
|
export declare function dropContent(body: t.MarkoTagBody): void;
|
|
130
131
|
export declare function getAllTagReferenceNodes(tag: t.MarkoTag, referenceNodes?: t.Node[], collectAttrTag?: (attrTag: t.MarkoTag) => void): t.Node[];
|
|
132
|
+
export declare function getChildTagReferenceNodes(tag: t.MarkoTag, referenceNodes: t.Node[], collectAttrTag?: (attrTag: t.MarkoTag) => void): t.Node[];
|
|
131
133
|
export declare function createResolvedRead(binding: Binding, properties: Opt<string>, inOwnBody?: boolean): ResolvedRead;
|
|
132
134
|
export declare function createResolvedGetterRead(binding: Binding, properties: Opt<string>, getter: Getter): ResolvedRead;
|
|
133
135
|
export interface ReferencedExtra extends t.NodeExtra {
|
|
134
136
|
section: Section;
|
|
135
137
|
}
|
|
136
138
|
export declare function isReferencedExtra(extra: t.NodeExtra | undefined): extra is ReferencedExtra;
|
|
139
|
+
export interface ReadExtra extends t.NodeExtra {
|
|
140
|
+
exprRoot: t.NodeExtra;
|
|
141
|
+
}
|
|
137
142
|
export interface AssignedBindingExtra extends ReferencedExtra {
|
|
138
143
|
assignment: Binding;
|
|
139
144
|
exprRoot: t.NodeExtra;
|
|
@@ -152,6 +157,7 @@ export declare function isRegisteredFnExtra(extra: t.NodeExtra | undefined): ext
|
|
|
152
157
|
export declare function getReferencedBindings(extra: t.NodeExtra | undefined): ReferencedBindings;
|
|
153
158
|
export declare function getBindingsDerivedFrom(binding: Binding): ReferencedBindings;
|
|
154
159
|
export declare function getValueReferences(exprs: Opt<t.NodeExtra>): ReferencedBindings;
|
|
160
|
+
export declare function isPureExpr(expr: t.NodeExtra): boolean;
|
|
155
161
|
export declare function getLazyBindings(extra: t.NodeExtra | undefined): ReferencedBindings;
|
|
156
162
|
export declare function getReferencedBindingsInFunction(extra: t.FunctionExtra): ReferencedBindings;
|
|
157
163
|
export declare function getConstantBindingsInFunction(extra: t.FunctionExtra): ReferencedBindings;
|
|
@@ -12,4 +12,5 @@ export declare function importRuntimeFeature(feature: DOMRuntimeFeature): void;
|
|
|
12
12
|
export declare function getRuntimeFeatureImport(feature: DOMRuntimeFeature): t.ImportDeclaration;
|
|
13
13
|
export declare function getRuntimePath(output: string): string;
|
|
14
14
|
export declare function absentArg(value: 0 | 1): t.NumericLiteral;
|
|
15
|
+
export declare function trimFalsyArgs<A extends t.Node>(args: (A | Falsy)[]): A[];
|
|
15
16
|
export declare function getCompatRuntimeFile(): string;
|
|
@@ -59,7 +59,12 @@ export interface Section {
|
|
|
59
59
|
/** The attribute tag `<for>` params this content reads, held as its own
|
|
60
60
|
* bindings that the loop binds as it creates it. */
|
|
61
61
|
localClosures: ReferencedBindings;
|
|
62
|
+
/** The closures it reads from enclosing sections, each notifying it through
|
|
63
|
+
* its signal, which its setup subscribes to. */
|
|
62
64
|
referencedClosures: ReferencedBindings;
|
|
65
|
+
/** The loop keys it reads from enclosing sections, in place through its owner
|
|
66
|
+
* chain: a key never changes, so it is no closure. */
|
|
67
|
+
referencedConstants: ReferencedBindings;
|
|
63
68
|
bindings: ReferencedBindings;
|
|
64
69
|
hoisted: ReferencedBindings;
|
|
65
70
|
/** The closures its `<for>` rows read only by comparing them to the row's
|
|
@@ -155,7 +160,6 @@ export declare function getContentInfo(path: t.NodePath<t.Program | t.MarkoTagBo
|
|
|
155
160
|
export declare function getNodeContentType(path: t.NodePath<t.Statement>, edge: "startType" | "endType"): ContentType.Value | null;
|
|
156
161
|
export declare function isKnownChild(section: Section): boolean;
|
|
157
162
|
export declare const getSectionTextBefore: (key: Section) => boolean | undefined;
|
|
158
|
-
export declare function mayEndWithText(section: Section): boolean;
|
|
159
163
|
export declare function mayMergeWithText(path: t.NodePath, before: boolean): boolean | undefined;
|
|
160
164
|
export declare function getRendererReason(section: Section): false | Sources;
|
|
161
165
|
export declare function isOptionalBranch(section: Section): section is Section & {
|
|
@@ -165,6 +169,7 @@ export declare function isInParentSection(binding: Binding, section: Section): b
|
|
|
165
169
|
export declare function isDirectClosure(section: Section, closure: Binding): boolean;
|
|
166
170
|
export declare function isDynamicClosure(section: Section, closure: Binding): boolean;
|
|
167
171
|
export declare function getDynamicClosureIndex(closure: Binding, closureSection: Section): number;
|
|
172
|
+
export declare function getForClosureIndex(closure: Binding, closureSection?: Section): number;
|
|
168
173
|
export declare function getDirectClosures(section: Section): import("./optional").SortedOpt<Binding>;
|
|
169
174
|
export declare function isSameOrAncestorSection(section: Section, other: Section): boolean;
|
|
170
175
|
export declare function getCommonSection(section: Section, other: Section): Section;
|
|
@@ -35,7 +35,8 @@ export interface Signal {
|
|
|
35
35
|
type closureSignalBuilder = (closure: Binding, render: t.Expression) => t.Expression;
|
|
36
36
|
export declare const getSignals: (section: Section) => Map<unknown, Signal>;
|
|
37
37
|
export declare function setClosureSignalBuilder(tag: t.NodePath<t.MarkoTag>, build?: closureSignalBuilder): void;
|
|
38
|
-
export declare function buildClosureHop(section: Section, render: t.Expression): t.CallExpression;
|
|
38
|
+
export declare function buildClosureHop(section: Section, closure: Binding, render: t.Expression): t.CallExpression;
|
|
39
|
+
export declare function getLoopRenderOrder(bodySection: Section): t.NumericLiteral | t.StringLiteral | undefined;
|
|
39
40
|
export declare function setSectionOwnerResumedByMarker(section: Section): void;
|
|
40
41
|
export declare function getContentClosureValues(bodySection: Section): {
|
|
41
42
|
scope: t.Identifier;
|
|
@@ -18,5 +18,5 @@ export declare function compareSources(a: Sources, b: Sources): number;
|
|
|
18
18
|
export declare function mergeSources(a: Sources, b: undefined | Sources): Sources;
|
|
19
19
|
export declare function mergeSources(a: undefined | Sources, b: Sources): Sources;
|
|
20
20
|
export declare function mergeSources(a: undefined | Sources, b: undefined | Sources): Sources | undefined;
|
|
21
|
-
export declare function isInParams(binding: Binding, params: Sources["param"]): boolean;
|
|
22
21
|
export declare function isSupersetSources(a: Binding, b: Binding): boolean;
|
|
22
|
+
export declare function isCoveredParam(binding: Binding | undefined, params: Sources["param"]): boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
export declare const htmlStyleTagAlternateMsg = " For a native html
|
|
2
|
+
export declare const htmlStyleTagAlternateMsg = " For a native html `<style>` tag use the [`html-style` core tag](https://markojs.com/docs/reference/core-tag#html-script--html-style) instead.";
|
|
3
3
|
export declare function checkStyleInterpolations(tag: t.NodePath<t.MarkoTag>): void;
|
|
@@ -27,7 +27,11 @@ declare module "@marko/compiler/dist/types" {
|
|
|
27
27
|
}
|
|
28
28
|
type TagNameType = TagNameType.Value;
|
|
29
29
|
export { TagNameType };
|
|
30
|
+
export declare function getTagNameBinding(tag: t.NodePath<t.MarkoTag>): t.Binding | undefined;
|
|
30
31
|
export default function analyzeTagNameType(tag: t.NodePath<t.MarkoTag>): TagNameType.Value;
|
|
32
|
+
/** A native element by its name alone: the tag lookup's verdict on a string, or
|
|
33
|
+
* a template literal without expressions. Loads no template, so pre-analyze may ask. */
|
|
34
|
+
export declare function isStaticNativeTag(tag: t.NodePath<t.MarkoTag>): boolean;
|
|
31
35
|
export declare function getTagRelativePath(tag: t.NodePath<t.MarkoTag>): string;
|
|
32
36
|
/**
|
|
33
37
|
* A known wrong tag that resolves to nothing, eg `interface P { id: number }`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import type { Plugin } from "@marko/compiler/babel-utils";
|
|
3
|
-
export type VisitorType = "
|
|
3
|
+
export type VisitorType = "transform" | "analyze" | "translate";
|
|
4
4
|
export type TemplateVisitor<T extends t.Node> = Partial<Record<VisitorType, t.VisitNode<unknown, T>>>;
|
|
5
5
|
export declare function extractVisitors<Visitors extends Partial<Record<keyof t.Visitor, TemplateVisitor<any>>>>(visitors: Visitors): Record<VisitorType, t.Visitor<unknown>>;
|
|
6
6
|
export declare function translateByTarget<T extends t.Node>({ html, dom, }: {
|
|
@@ -11,9 +11,11 @@ export declare function buildGroupMask(groups: {
|
|
|
11
11
|
export declare function getScopeReasonStatement(section: Section): t.Statement;
|
|
12
12
|
export declare function getWriteReason(binding: Binding): Sources | undefined;
|
|
13
13
|
export declare function getBranchWriteReason(section: Section): Sources | undefined;
|
|
14
|
+
export declare function isBranchAlwaysMarked(section: Section): boolean;
|
|
14
15
|
export declare function getWriteGuard(section: Section, reason: undefined | Reason, omitUnconditional: boolean): t.Expression | undefined;
|
|
15
16
|
export declare function getWriteGuardForAny(section: Section, reasons: undefined | Reasons, omitUnconditional: boolean): t.Expression | undefined;
|
|
16
17
|
export declare function getExprIfWritten(section: Section, reason: undefined | Reason, expr: t.Expression): t.Expression | undefined;
|
|
17
18
|
export declare function isEverWritten(section: Section, reason: undefined | Reason): boolean;
|
|
18
19
|
export declare function isWrittenForCall(section: Section, reason: undefined | Reason, call: t.MarkoTagExtra, callSection: Section): boolean;
|
|
19
20
|
export declare function getWriteBit(section: Section, reason: undefined | Reason): number | undefined;
|
|
21
|
+
export declare function andGuard(guard: t.Expression | undefined | false, expr: t.Expression): t.Expression;
|
|
@@ -26,10 +26,6 @@ declare module "@marko/compiler/dist/types" {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
declare const _default: {
|
|
29
|
-
migrate: {
|
|
30
|
-
enter(this: unknown, program: t.NodePath<t.Program>): void;
|
|
31
|
-
exit(this: unknown, program: t.NodePath<t.Program>): void;
|
|
32
|
-
};
|
|
33
29
|
transform: {
|
|
34
30
|
exit: typeof preAnalyze;
|
|
35
31
|
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
declare const kAbortId: unique symbol;
|
|
3
|
+
declare const kAbortCleanupOnly: unique symbol;
|
|
3
4
|
declare module "@marko/compiler/dist/types" {
|
|
4
5
|
interface NodeExtra {
|
|
5
6
|
/** `$signal` abort id for this expression root, allocated in analyze
|
|
6
7
|
* (see below) so every translate reads the same id. */
|
|
7
8
|
[kAbortId]?: number;
|
|
9
|
+
/** Its every `$signal` only sets `onabort`, so it needs no controller. */
|
|
10
|
+
[kAbortCleanupOnly]?: boolean;
|
|
8
11
|
}
|
|
9
12
|
}
|
|
10
13
|
declare const _default: {
|
|
11
|
-
migrate(this: unknown, identifier: t.NodePath<t.Identifier>): void;
|
|
12
14
|
analyze(this: unknown, identifier: t.NodePath<t.Identifier>): void;
|
|
13
15
|
translate(this: unknown, identifier: t.NodePath<t.Identifier>): void;
|
|
14
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.11",
|
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@marko/compiler": "^5.42.
|
|
54
|
+
"@marko/compiler": "^5.42.17",
|
|
55
55
|
"csstype": "^3.2.3",
|
|
56
56
|
"fastest-levenshtein": "^1.0.16",
|
|
57
|
-
"magic-string": "^
|
|
57
|
+
"magic-string": "^1.4.5"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@marko/runtime-tags": "npm:marko@6.4.
|
|
61
|
-
"marko": "5.39.
|
|
60
|
+
"@marko/runtime-tags": "npm:marko@6.4.11",
|
|
61
|
+
"marko": "5.39.50"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
|
-
"node": ">=22"
|
|
64
|
+
"node": ">=22.12.0"
|
|
65
65
|
},
|
|
66
66
|
"exports:override": {
|
|
67
67
|
".": {
|
package/tags/lifecycle.d.marko
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** File for types only, not actual implementation **/
|
|
2
2
|
|
|
3
|
+
/* `R` is inferred from what `onMount` returns, so a return value read from `this`
|
|
4
|
+
is circular; such a tag passes its type explicitly (`<lifecycle<{ … }>>`). */
|
|
3
5
|
export type Input<
|
|
4
6
|
T extends object,
|
|
5
7
|
R extends object = {},
|