marko 6.3.56 → 6.4.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.
- package/cheatsheet.md +3 -3
- package/dist/common/constants/accessor-prefix.d.ts +2 -0
- package/dist/common/constants/accessor-prefix.debug.d.ts +2 -0
- package/dist/common/constants/accessor-prop.d.ts +3 -0
- package/dist/common/constants/accessor-prop.debug.d.ts +3 -0
- package/dist/common/constants/reserved-id.d.ts +5 -0
- package/dist/common/errors.d.ts +1 -1
- package/dist/common/types.d.ts +11 -2
- package/dist/debug/dom/catch.feat.js +12 -14
- package/dist/debug/dom/catch.feat.mjs +12 -14
- 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 +1 -1
- package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/debug/dom/lazy.feat.js +4 -0
- package/dist/debug/dom/lazy.feat.mjs +4 -0
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-DcwejnYg.js → dom-ClV4kVOO.js} +263 -193
- package/dist/debug/{dom-BeCNT5R5.mjs → dom-LFrKxOk5.mjs} +246 -182
- package/dist/debug/dom.js +14 -12
- package/dist/debug/dom.mjs +14 -12
- package/dist/debug/html.js +826 -685
- package/dist/debug/html.mjs +822 -683
- package/dist/dom/abort-signal.d.ts +2 -0
- package/dist/dom/catch.feat.js +6 -7
- package/dist/dom/catch.feat.mjs +5 -7
- package/dist/dom/control-flow.d.ts +3 -5
- package/dist/dom/controllable-input.feat.js +3 -2
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +3 -2
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +3 -2
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +3 -2
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +3 -2
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-script.feat.js +3 -2
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +2 -1
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/lazy.feat.d.ts +1 -0
- package/dist/dom/lazy.feat.js +4 -0
- package/dist/dom/lazy.feat.mjs +4 -0
- package/dist/dom/load.d.ts +3 -3
- package/dist/dom/placeholder.feat.js +4 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/queue.d.ts +2 -4
- package/dist/dom/resume.d.ts +1 -1
- package/dist/dom/scope.d.ts +0 -1
- package/dist/dom/signals.d.ts +3 -2
- package/dist/{dom-QEF0csuC.js → dom-CNglVi8P.js} +222 -185
- package/dist/{dom-BwNsIevR.mjs → dom-DfP3MCo0.mjs} +126 -90
- package/dist/dom.js +59 -56
- package/dist/dom.mjs +34 -32
- package/dist/html/attrs.d.ts +4 -2
- package/dist/html/dynamic-tag.d.ts +1 -1
- package/dist/html/inlined-runtimes.d.ts +1 -1
- package/dist/html/inlined-runtimes.debug.d.ts +1 -1
- package/dist/html/serializer.d.ts +1 -1
- package/dist/html/writer.d.ts +39 -33
- package/dist/html.d.ts +2 -2
- package/dist/html.js +526 -424
- package/dist/html.mjs +524 -423
- package/dist/translator/core/html-comment.d.ts +0 -7
- package/dist/translator/core/let.d.ts +0 -5
- package/dist/translator/core/show.d.ts +2 -5
- package/dist/translator/core/style.d.ts +6 -8
- package/dist/translator/index.d.ts +9 -0
- package/dist/translator/index.js +8195 -7939
- package/dist/translator/util/binding-has-prop.d.ts +3 -1
- package/dist/translator/util/binding-prop-tree.d.ts +4 -4
- package/dist/translator/util/bindings.d.ts +127 -0
- package/dist/translator/util/body-to-text-literal.d.ts +1 -2
- package/dist/translator/util/branch-tag.d.ts +7 -7
- package/dist/translator/util/constants/binding-type.d.ts +5 -6
- package/dist/translator/util/constants/slot-kind.d.ts +14 -0
- package/dist/translator/util/constants/structure-kind.d.ts +1 -1
- package/dist/translator/util/entry-builder.d.ts +2 -0
- package/dist/translator/util/evaluate.d.ts +11 -10
- package/dist/translator/util/finalize-references.d.ts +4 -0
- package/dist/translator/util/for-selector.d.ts +1 -1
- package/dist/translator/util/generate-uid.d.ts +7 -0
- package/dist/translator/util/get-declared-binding-expression.d.ts +2 -2
- package/dist/translator/util/is-core-tag.d.ts +0 -3
- package/dist/translator/util/is-only-child-in-parent.d.ts +2 -7
- package/dist/translator/util/known-tag.d.ts +8 -7
- package/dist/translator/util/read-replacement.d.ts +3 -0
- package/dist/translator/util/reasons.d.ts +32 -0
- package/dist/translator/util/references.d.ts +69 -167
- package/dist/translator/util/runtime.d.ts +3 -3
- package/dist/translator/util/scope-accessor.d.ts +14 -0
- package/dist/translator/util/scope-read.d.ts +1 -1
- package/dist/translator/util/sections.d.ts +56 -50
- package/dist/translator/util/set-tag-derived-from.d.ts +7 -0
- package/dist/translator/util/setup-work.d.ts +4 -0
- package/dist/translator/util/signals.d.ts +8 -12
- package/dist/translator/util/slots.d.ts +50 -0
- package/dist/translator/util/solve-reasons.d.ts +10 -0
- package/dist/translator/util/sources.d.ts +21 -0
- package/dist/translator/util/structure.d.ts +5 -2
- package/dist/translator/util/tag-facts.d.ts +21 -0
- package/dist/translator/util/tag-name-type.d.ts +4 -1
- package/dist/translator/util/translate-attrs.d.ts +2 -0
- package/dist/translator/util/translate-var.d.ts +3 -0
- package/dist/translator/util/write-guard.d.ts +12 -0
- package/dist/translator/util/writer.d.ts +3 -3
- package/dist/translator/visitors/export-declaration.d.ts +9 -0
- package/dist/translator/visitors/function.d.ts +5 -4
- package/dist/translator/visitors/import-declaration.d.ts +2 -2
- package/dist/translator/visitors/placeholder.d.ts +0 -3
- package/dist/translator/visitors/program/index.d.ts +13 -3
- package/dist/translator/visitors/referenced-identifier.d.ts +2 -1
- package/dist/translator/visitors/tag/custom-tag.d.ts +1 -1
- package/dist/translator/visitors/tag/dynamic-tag.d.ts +0 -3
- package/dist/translator/visitors/tag/index.d.ts +2 -1
- package/dist/translator/visitors/tag/native-tag.d.ts +26 -11
- package/package.json +3 -3
- package/dist/translator/util/insertion-context.d.ts +0 -1
- package/dist/translator/util/is-non-html-text.d.ts +0 -3
- package/dist/translator/util/serialize-guard.d.ts +0 -11
- package/dist/translator/util/serialize-reasons.d.ts +0 -37
- package/dist/translator/util/set-tag-sections-downstream.d.ts +0 -6
- package/dist/translator/util/setup-statements.d.ts +0 -5
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { types as t } from "@marko/compiler";
|
|
2
|
+
import { type Binding } from "./bindings";
|
|
1
3
|
import { type Opt } from "./optional";
|
|
2
|
-
import type { Binding } from "./references";
|
|
3
4
|
import type { Section } from "./sections";
|
|
5
|
+
export declare function getSectionRendererIdentifier(section: Section): t.Identifier | undefined;
|
|
4
6
|
export declare function isSectionRendererElided(section: Section): boolean;
|
|
5
7
|
export declare function bindingHasProperty(binding: Binding, properties: Opt<string>): boolean;
|
|
6
8
|
export declare function getPropertyPathAlias(binding: Binding, properties: Opt<string>): Binding;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Binding } from "./
|
|
1
|
+
import { type Binding } from "./bindings";
|
|
2
2
|
export type BindingPropTree = {
|
|
3
3
|
binding: Binding;
|
|
4
4
|
props: {
|
|
@@ -6,13 +6,13 @@ export type BindingPropTree = {
|
|
|
6
6
|
} | undefined;
|
|
7
7
|
rest: BindingPropTree | undefined;
|
|
8
8
|
};
|
|
9
|
-
export declare const kDirectContent: unique symbol;
|
|
10
9
|
declare module "@marko/compiler/dist/types" {
|
|
11
10
|
interface NodeExtra {
|
|
12
|
-
|
|
11
|
+
directContent?: true;
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
|
-
export declare function getBindingPropTree(binding: Binding): BindingPropTree
|
|
14
|
+
export declare function getBindingPropTree(binding: Binding, bodyAnalyzed?: boolean): BindingPropTree;
|
|
15
|
+
export declare function getSettledPropTree(propTree: BindingPropTree | undefined): BindingPropTree | undefined;
|
|
16
16
|
export declare function getKnownFromPropTree(propTree: BindingPropTree | true, name: string): BindingPropTree | true | undefined;
|
|
17
17
|
export declare function getAllKnownPropNames(propTree: BindingPropTree): string[];
|
|
18
18
|
export declare function hasAllKnownProps(propTree: BindingPropTree): boolean | undefined;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { types as t } from "@marko/compiler";
|
|
2
|
+
import { ReservedId } from "../../common/types";
|
|
3
|
+
import * as BindingType from "./constants/binding-type";
|
|
4
|
+
import { type Opt, type SortedMany, type SortedOpt, Sorted } from "./optional";
|
|
5
|
+
import { type AssignedBindingExtra, type Read, type ReferencedExtra } from "./references";
|
|
6
|
+
import { type Section } from "./sections";
|
|
7
|
+
import { type Sources } from "./sources";
|
|
8
|
+
type BindingType = BindingType.Value;
|
|
9
|
+
export { BindingType };
|
|
10
|
+
export interface Binding {
|
|
11
|
+
/** Its scope accessor id, allocated per section once references finalize. */
|
|
12
|
+
id: number;
|
|
13
|
+
/** Creation order, never renumbered: the order `bindingUtil` sorts by. */
|
|
14
|
+
uid: number;
|
|
15
|
+
name: string;
|
|
16
|
+
originalName: string | undefined;
|
|
17
|
+
type: BindingType;
|
|
18
|
+
loc: t.SourceLocation | null;
|
|
19
|
+
section: Section;
|
|
20
|
+
closureSections: SortedOpt<Section>;
|
|
21
|
+
/** The id its closure accessors take, past its section's and ancestors' ids. */
|
|
22
|
+
closureId: number | undefined;
|
|
23
|
+
/** The identifier of each emitted assignment to it (set in finalize). */
|
|
24
|
+
assignments: Opt<AssignedBindingExtra>;
|
|
25
|
+
sources: undefined | Sources;
|
|
26
|
+
/** The intersection whose work computes it, or the nearest one it derives
|
|
27
|
+
* from. Set on alias roots only. */
|
|
28
|
+
intersection: Intersection | undefined;
|
|
29
|
+
/** The expressions its value is computed from, `false` for none; unset when
|
|
30
|
+
* analysis cannot see them, which makes it its own source. */
|
|
31
|
+
derivedFrom: Opt<t.NodeExtra> | false;
|
|
32
|
+
/** Complete only once `finalizeReferences` runs at program analyze exit. */
|
|
33
|
+
/** Its reads, by the expression each is in; pruning hands an expression's reads
|
|
34
|
+
* to the nearest ancestor it also reads, which they then resolve to. */
|
|
35
|
+
reads: Map<ReferencedExtra, Opt<Read>>;
|
|
36
|
+
aliases: Set<Binding>;
|
|
37
|
+
hoists: SortedOpt<Section>;
|
|
38
|
+
getters: Map<Getter["hoisted"], boolean>;
|
|
39
|
+
property: string | undefined;
|
|
40
|
+
propertyAliases: Map<string, Binding>;
|
|
41
|
+
excludeProperties: SortedOpt<string>;
|
|
42
|
+
aliasOf: Binding | undefined;
|
|
43
|
+
/** The value these `<for>` params iterate, by `of` or `in`. */
|
|
44
|
+
iterates: {
|
|
45
|
+
expr: t.NodeExtra;
|
|
46
|
+
type: "of" | "in";
|
|
47
|
+
} | undefined;
|
|
48
|
+
restOffset: number | undefined;
|
|
49
|
+
/** For a tag variable a child's `<return>` writes, the node binding of the
|
|
50
|
+
* tag rendering that child. */
|
|
51
|
+
returnedBy: Binding | undefined;
|
|
52
|
+
/** Scope ids it holds right after its own, up to its highest `ReservedId`:
|
|
53
|
+
* a controllable `<let>`'s change handler, or a tag's scope offset. */
|
|
54
|
+
reserveSize: number;
|
|
55
|
+
scopeAccessor: string | undefined;
|
|
56
|
+
/** A name declared for this value, or all of it but its `excludeProperties`
|
|
57
|
+
* (a rest element), even once pruned. */
|
|
58
|
+
declaredAlias: Binding | undefined;
|
|
59
|
+
/** The attribute tag `<for>` param a local closure holds in its section. */
|
|
60
|
+
localOf: Binding | undefined;
|
|
61
|
+
/** An attribute tag `<for>` param's local closure in each content the loop
|
|
62
|
+
* creates that reads it. */
|
|
63
|
+
localClosures: Map<Section, Binding> | undefined;
|
|
64
|
+
/** Declared by its own name in its own section; an alias only in a pattern
|
|
65
|
+
* holding a rest or where what it reads from is hidden from a read of it. */
|
|
66
|
+
declared: boolean;
|
|
67
|
+
nullable: boolean;
|
|
68
|
+
/** Settled only once `finalizeReferences` runs at program analyze exit. */
|
|
69
|
+
pruned: boolean | undefined;
|
|
70
|
+
/** In a template's or `<define>`'s params tree, which known call sites set
|
|
71
|
+
* directly. */
|
|
72
|
+
exposed: boolean;
|
|
73
|
+
/** Read on invocation from its own scope slot, which must persist. */
|
|
74
|
+
hasLazyReads: boolean;
|
|
75
|
+
}
|
|
76
|
+
/** A param of a template or of a tag body, which its caller supplies. */
|
|
77
|
+
export interface ParamBinding extends Binding {
|
|
78
|
+
type: typeof BindingType.param;
|
|
79
|
+
}
|
|
80
|
+
export type ReferencedBindings = SortedOpt<Binding>;
|
|
81
|
+
export type Intersection = SortedMany<Binding>;
|
|
82
|
+
/** Every member computed from one local source in the same pass, or the
|
|
83
|
+
* intersection's own render id and the tag whose scope offset it renders after. */
|
|
84
|
+
export type IntersectionMeta = {
|
|
85
|
+
source: Binding;
|
|
86
|
+
id?: undefined;
|
|
87
|
+
returnedBy?: undefined;
|
|
88
|
+
} | {
|
|
89
|
+
source: undefined;
|
|
90
|
+
id: number;
|
|
91
|
+
returnedBy: Binding | undefined;
|
|
92
|
+
};
|
|
93
|
+
export interface Getter {
|
|
94
|
+
hoisted: Section | false;
|
|
95
|
+
invoked: boolean;
|
|
96
|
+
}
|
|
97
|
+
export declare const getBindings: () => Set<Binding>;
|
|
98
|
+
export declare function createBinding(name: string, type: Binding["type"], refSection: Section, aliased?: Binding["aliasOf"], property?: string, excludeProperties?: SortedOpt<string>, loc?: t.SourceLocation | null, refDeclared?: boolean): Binding;
|
|
99
|
+
export declare function reserveId(binding: Binding, offset: ReservedId): void;
|
|
100
|
+
export declare function getOrCreatePropertyAlias(binding: Binding, property: string): Binding;
|
|
101
|
+
export declare function getPropertyAlias(binding: Binding | undefined, properties: Opt<string>): Binding | undefined;
|
|
102
|
+
export declare function compareReferences(a: ReferencedBindings, b: ReferencedBindings): number;
|
|
103
|
+
/**
|
|
104
|
+
* reference group priority is sorted by number of references,
|
|
105
|
+
* then if needed by reference order.
|
|
106
|
+
*/
|
|
107
|
+
export declare function compareIntersections(a: Intersection, b: Intersection): number;
|
|
108
|
+
export declare function getAliasRoot(binding: Binding): Binding | undefined;
|
|
109
|
+
export declare const bindingUtil: Sorted<Binding>;
|
|
110
|
+
export declare const propsUtil: Sorted<string>;
|
|
111
|
+
export declare function getCanonicalBinding(binding: Binding): Binding;
|
|
112
|
+
export declare function someAlias<A>(binding: Binding, test: (binding: Binding, arg: A) => boolean, arg: A, directOnly?: boolean): boolean;
|
|
113
|
+
export declare function someAliased<A>(binding: Binding | undefined, test: (binding: Binding, arg: A) => boolean, arg: A): boolean;
|
|
114
|
+
export declare function getNearestDeclared(binding: Binding): Binding | undefined;
|
|
115
|
+
export declare function isDirectAlias(binding: Binding): boolean;
|
|
116
|
+
export declare function getDebugScopeAccess(binding: Binding): {
|
|
117
|
+
root: Binding;
|
|
118
|
+
access: string;
|
|
119
|
+
};
|
|
120
|
+
export declare function isTemplateParam(binding: Binding): boolean;
|
|
121
|
+
export declare function getDebugName(binding: Binding): string;
|
|
122
|
+
export declare function getDebugNames(refs: ReferencedBindings): string;
|
|
123
|
+
export declare function getDebugNamesAsIdentifier(refs: ReferencedBindings): string;
|
|
124
|
+
export declare function isInvokeOnlyBinding(binding: Binding): boolean;
|
|
125
|
+
export declare function hasNonConstantPropertyAlias(ref: Binding): boolean;
|
|
126
|
+
export declare function getPropertyPath(binding: Binding, ancestor: Binding): Opt<string>;
|
|
127
|
+
export declare function isIndexProperty(property: string): boolean;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
export declare const kRawText: unique symbol;
|
|
3
2
|
declare module "@marko/compiler/dist/types" {
|
|
4
3
|
interface MarkoPlaceholderExtra {
|
|
5
|
-
|
|
4
|
+
rawText?: true;
|
|
6
5
|
}
|
|
7
6
|
}
|
|
8
7
|
export declare function bodyToTextLiteral(body: t.MarkoTagBody, decodeEntities?: boolean): t.ArrayExpression | t.ArrowFunctionExpression | t.AssignmentExpression | t.AwaitExpression | t.BigIntLiteral | t.BinaryExpression | t.BindExpression | t.BooleanLiteral | t.CallExpression | t.ClassExpression | t.ConditionalExpression | t.DecimalLiteral | t.DoExpression | t.FunctionExpression | t.Identifier | t.Import | t.ImportExpression | t.JSXElement | t.JSXFragment | t.LogicalExpression | t.MarkoParseError | t.MemberExpression | t.MetaProperty | t.ModuleExpression | t.NewExpression | t.NullLiteral | t.NumericLiteral | t.ObjectExpression | t.OptionalCallExpression | t.OptionalMemberExpression | t.ParenthesizedExpression | t.PipelineBareFunction | t.PipelinePrimaryTopicReference | t.PipelineTopicExpression | t.RecordExpression | t.RegExpLiteral | t.SequenceExpression | t.StringLiteral | t.Super | t.TSAsExpression | t.TSInstantiationExpression | t.TSNonNullExpression | t.TSSatisfiesExpression | t.TSTypeAssertion | t.TaggedTemplateExpression | t.TemplateLiteral | t.ThisExpression | t.TopicReference | t.TupleExpression | t.TypeCastExpression | t.UnaryExpression | t.UpdateExpression | t.YieldExpression;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Binding } from "./
|
|
2
|
+
import { type Binding } from "./bindings";
|
|
3
|
+
import { type Reasons } from "./reasons";
|
|
3
4
|
import { type Section } from "./sections";
|
|
4
|
-
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
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)[];
|
|
5
|
+
export declare function initBranchSection(bodySection: Section, branchExpr: Section["branchExpr"], branch: NonNullable<Section["branch"]>): void;
|
|
6
|
+
export declare function resumeOwnerByMarkerWhenStatic(bodySection: Section, nodeBinding: Binding): void;
|
|
7
|
+
export declare function getBranchResumeArgs(tagSection: Section, nodeBinding: Binding, branchReasons: Reasons, onlyChildParentTagName: string | false | undefined, singleNode: boolean): (t.Expression | undefined)[];
|
|
8
|
+
export declare function getBranchEndArgs(tagSection: Section, nodeBinding: Binding, onlyChildParentTagName: string | false | undefined, singleNode: boolean | undefined): (t.Expression | undefined)[];
|
|
9
|
+
export declare function isEndTagWrittenByBranch(nodeBinding: Binding | undefined): boolean;
|
|
10
10
|
export declare function isSingleNodeBranch(bodySection: Section | undefined): boolean;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
export declare const dom = 0;
|
|
2
2
|
declare const let_ = 1;
|
|
3
3
|
export { let_ as let };
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const global = 7;
|
|
4
|
+
export declare const param = 2;
|
|
5
|
+
export declare const local = 3;
|
|
6
|
+
export declare const derived = 4;
|
|
7
|
+
export declare const constant = 5;
|
|
8
|
+
export declare const global = 6;
|
|
10
9
|
type Self = typeof import("./binding-type");
|
|
11
10
|
export type Value = Self[keyof Self];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const Value = 0;
|
|
2
|
+
export declare const ChangeHandler = 1;
|
|
3
|
+
export declare const ClosureScopes = 2;
|
|
4
|
+
export declare const ClosureSignalIndex = 3;
|
|
5
|
+
export declare const BranchExpr = 4;
|
|
6
|
+
export declare const ParamGroup = 5;
|
|
7
|
+
export declare const Scope = 6;
|
|
8
|
+
export declare const Owner = 7;
|
|
9
|
+
export declare const ReturnChangeHandler = 8;
|
|
10
|
+
export declare const Branch = 9;
|
|
11
|
+
export declare const Instances = 10;
|
|
12
|
+
type Self = typeof import("./slot-kind");
|
|
13
|
+
export type Value = Self[keyof Self];
|
|
14
|
+
export {};
|
|
@@ -10,6 +10,8 @@ declare module "@marko/compiler/dist/types" {
|
|
|
10
10
|
interface EntryState {
|
|
11
11
|
init: boolean;
|
|
12
12
|
load: boolean;
|
|
13
|
+
/** Whether a reached template lazily imports another. */
|
|
14
|
+
lazy: boolean;
|
|
13
15
|
/** Depth of enclosing templates whose modules the bundle already loads:
|
|
14
16
|
* below a root everything arrives through its imports, and a lazy subtree
|
|
15
17
|
* is loaded by its own load entry. */
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import type { types as t } from "@marko/compiler";
|
|
2
|
+
interface Evaluated {
|
|
3
|
+
confident: boolean;
|
|
4
|
+
computed: unknown;
|
|
5
|
+
nullable: boolean;
|
|
6
|
+
/** Evaluating it has no side effects. */
|
|
7
|
+
pure: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const kEvaluated: unique symbol;
|
|
2
10
|
declare module "@marko/compiler/dist/types" {
|
|
3
11
|
interface NodeExtra {
|
|
4
|
-
|
|
5
|
-
computed?: unknown;
|
|
6
|
-
nullable?: boolean;
|
|
7
|
-
/** Evaluating it has no side effects, so an unread value can go. */
|
|
8
|
-
pure?: boolean;
|
|
12
|
+
[kEvaluated]?: Evaluated;
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
|
-
export default function evaluate
|
|
12
|
-
|
|
13
|
-
nullable: boolean;
|
|
14
|
-
computed: unknown;
|
|
15
|
-
};
|
|
15
|
+
export default function evaluate(value: t.Expression): Evaluated;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Binding, type ReferencedBindings } from "./bindings";
|
|
2
|
+
export declare function finalizeReferences(): void;
|
|
3
|
+
export declare function getValueInputs(binding: Binding): ReferencedBindings;
|
|
4
|
+
export declare function hasEmittedAssignment(binding: Binding): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Binding } from "./
|
|
1
|
+
import { type Binding } from "./bindings";
|
|
2
2
|
import { type Section } from "./sections";
|
|
3
3
|
export declare function getForSelectorKey(bodySection: Section, closure: Binding): Binding | undefined;
|
|
4
4
|
export declare function isForSelectorValue(binding: Binding): boolean;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import type { Section } from "./sections";
|
|
3
|
+
declare const kUidCounts: unique symbol;
|
|
4
|
+
declare module "@marko/compiler/dist/types" {
|
|
5
|
+
interface ProgramExtra {
|
|
6
|
+
[kUidCounts]?: Map<string, number>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
3
9
|
export declare function generateUid(name?: string): string;
|
|
4
10
|
export declare function generateUidIdentifier(name?: string): t.Identifier;
|
|
5
11
|
export declare function getSharedUid(name: string, section?: Section): string;
|
|
6
12
|
export declare function usedSharedUid(name: string): boolean;
|
|
13
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Binding } from "./
|
|
3
|
-
export declare function getDeclaredBindingExpression(binding: Binding): t.Identifier | t.MemberExpression | t.OptionalMemberExpression;
|
|
2
|
+
import { type Binding } from "./bindings";
|
|
3
|
+
export declare function getDeclaredBindingExpression(binding: Binding, inPlace?: boolean): t.Identifier | t.MemberExpression | t.OptionalMemberExpression;
|
|
@@ -8,6 +8,3 @@ export declare function isCoreTagName(tag: t.NodePath, name: string): tag is t.N
|
|
|
8
8
|
export declare function isConditionTag(tag: t.NodePath): tag is t.NodePath<t.MarkoTag & {
|
|
9
9
|
name: t.StringLiteral;
|
|
10
10
|
}>;
|
|
11
|
-
export declare function isControlFlowTag(tag: t.NodePath): tag is t.NodePath<t.MarkoTag & {
|
|
12
|
-
name: t.StringLiteral;
|
|
13
|
-
}>;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Binding } from "./references";
|
|
3
|
-
import type { Section } from "./sections";
|
|
4
2
|
declare const kOnlyChildInParent: unique symbol;
|
|
5
|
-
declare const kNodeRef: unique symbol;
|
|
6
3
|
declare module "@marko/compiler/dist/types" {
|
|
7
|
-
interface
|
|
4
|
+
interface MarkoTagExtra {
|
|
8
5
|
[kOnlyChildInParent]?: false | string;
|
|
9
|
-
[kNodeRef]?: Binding;
|
|
10
6
|
}
|
|
11
7
|
}
|
|
12
|
-
export declare function getOnlyChildParentTagName(tag: t.NodePath<t.MarkoTag
|
|
13
|
-
export declare function getOptimizedOnlyChildNodeBinding(tag: t.NodePath<t.MarkoTag>, section: Section, branchSize?: number): Binding;
|
|
8
|
+
export declare function getOnlyChildParentTagName(tag: t.NodePath<t.MarkoTag>): string | false;
|
|
14
9
|
export {};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import { type BindingPropTree } from "./binding-prop-tree";
|
|
3
|
-
import { type Binding
|
|
3
|
+
import { type Binding } from "./bindings";
|
|
4
|
+
import { type KnownExprs } from "./references";
|
|
4
5
|
import { type Section } from "./sections";
|
|
5
6
|
declare const kContentSection: unique symbol;
|
|
6
|
-
declare const
|
|
7
|
-
declare const kChildOffsetScopeBinding: unique symbol;
|
|
7
|
+
declare const kPropTree: unique symbol;
|
|
8
8
|
declare const kKnownExprs: unique symbol;
|
|
9
9
|
declare module "@marko/compiler/dist/types" {
|
|
10
10
|
interface MarkoTagExtra {
|
|
11
11
|
[kContentSection]?: Section;
|
|
12
|
-
|
|
13
|
-
[
|
|
12
|
+
/** The child's params tree the call site was analyzed against. */
|
|
13
|
+
[kPropTree]?: BindingPropTree;
|
|
14
14
|
[kKnownExprs]?: KnownExprs;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
export declare function knownTagAnalyze(tag: t.NodePath<t.MarkoTag>, contentSection: Section, propTree: BindingPropTree | undefined): void;
|
|
18
|
-
export declare function knownTagTranslateHTML(tag: t.NodePath<t.MarkoTag>, tagIdentifier: t.Expression
|
|
19
|
-
export declare function knownTagTranslateDOM(tag: t.NodePath<t.MarkoTag>,
|
|
18
|
+
export declare function knownTagTranslateHTML(tag: t.NodePath<t.MarkoTag>, tagIdentifier: t.Expression): void;
|
|
19
|
+
export declare function knownTagTranslateDOM(tag: t.NodePath<t.MarkoTag>, getBindingIdentifier: (binding: Binding, preferredName?: string, directContent?: boolean) => t.Identifier, callSetup: ((section: Section, childBinding: Binding) => void) | undefined): void;
|
|
20
20
|
export declare function finalizeKnownTags(section: Section): void;
|
|
21
|
+
export declare function callsOtherTemplateSetup(section: Section): boolean;
|
|
21
22
|
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { types as t } from "@marko/compiler";
|
|
2
|
+
import { type ReferencedBindings } from "./bindings";
|
|
3
|
+
import { type Opt, Sorted, type SortedOneMany } from "./optional";
|
|
4
|
+
import { type KnownExprs } from "./references";
|
|
5
|
+
import { type ParamReasonGroups, type Section } from "./sections";
|
|
6
|
+
import { type Slot } from "./slots";
|
|
7
|
+
import { type Sources } from "./sources";
|
|
8
|
+
export type Reasons = SortedOneMany<Sources>;
|
|
9
|
+
export declare const sourcesUtil: Sorted<Sources>;
|
|
10
|
+
export type Reason = Sources;
|
|
11
|
+
export declare function addReason(slot: Slot, reason: undefined | false | Reason): void;
|
|
12
|
+
export declare function addReasonExprs(slot: Slot, expr: Opt<t.NodeExtra>): void;
|
|
13
|
+
export declare function addOwnerReason(from: Section, to: Section, reason: undefined | false | Reason): void;
|
|
14
|
+
export declare function isConditionalReason(reason: undefined | Reason): reason is Sources & {
|
|
15
|
+
state: undefined;
|
|
16
|
+
always: undefined;
|
|
17
|
+
};
|
|
18
|
+
export declare function isUnconditionalReason(reason: undefined | Reason): reason is Reason;
|
|
19
|
+
export declare function isStateReason(reason: undefined | Reason): reason is Sources;
|
|
20
|
+
export declare function getSourcesForExpr(expr: t.NodeExtra): Sources | undefined;
|
|
21
|
+
export declare function getSourcesForExprs(exprs: Opt<t.NodeExtra> | boolean): Sources | undefined;
|
|
22
|
+
export declare function getSourcesForRef(ref: ReferencedBindings): Sources | undefined;
|
|
23
|
+
export declare function getSourcesForDerived({ binding, exprs, properties, }: NonNullable<Section["derives"]>): Sources | undefined;
|
|
24
|
+
export declare function mapParamReason(program: Section, reason: Sources, exprs: KnownExprs | undefined, ownParams: boolean): Reason | undefined;
|
|
25
|
+
export declare function mergeReasons(a: Reason, b: undefined | Reason): Reason;
|
|
26
|
+
export declare function mergeReasons(a: undefined | Reason, b: Reason): Reason;
|
|
27
|
+
export declare function mergeReasons(a: undefined | Reason, b: undefined | Reason): Reason | undefined;
|
|
28
|
+
export declare function applyReasonExprs(section: Section): void;
|
|
29
|
+
export declare function finalizeReason(section: Section): void;
|
|
30
|
+
export declare function getNodeReasons(section: Section): Sources | import("./optional").SortedMany<Sources> | undefined;
|
|
31
|
+
export declare function getReasonsVersion(): number;
|
|
32
|
+
export declare function setParamReasonGroups(section: Section, groups: ParamReasonGroups): void;
|