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,103 +1,20 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type
|
|
3
|
-
import
|
|
4
|
-
import { type
|
|
2
|
+
import { type Binding, BindingType, type Getter, type ParamBinding, type ReferencedBindings } from "./bindings";
|
|
3
|
+
import { type OneMany, type Opt, type SortedOpt } from "./optional";
|
|
4
|
+
import { type Reason } from "./reasons";
|
|
5
5
|
import { type Section } from "./sections";
|
|
6
|
-
import { type SerializeKey, type SerializeReason } from "./serialize-reasons";
|
|
7
|
-
import { type Signal } from "./signals";
|
|
8
|
-
export declare const kBranchSerializeReason: unique symbol;
|
|
9
|
-
export type Aliases = undefined | Binding | {
|
|
10
|
-
[property: string]: Aliases;
|
|
11
|
-
};
|
|
12
|
-
type BindingType = BindingType.Value;
|
|
13
|
-
export { BindingType };
|
|
14
|
-
export interface Sources {
|
|
15
|
-
state: SortedOpt<Binding>;
|
|
16
|
-
param: SortedOpt<InputBinding | ParamBinding>;
|
|
17
|
-
global: true | undefined;
|
|
18
|
-
/** Serialized unconditionally; the sources still say what it reads. */
|
|
19
|
-
forced: true | undefined;
|
|
20
|
-
}
|
|
21
|
-
export declare const FORCED: Sources;
|
|
22
|
-
export declare const globalSources: Sources;
|
|
23
|
-
export interface Binding {
|
|
24
|
-
id: number;
|
|
25
|
-
uid: number;
|
|
26
|
-
name: string;
|
|
27
|
-
originalName: string | undefined;
|
|
28
|
-
type: BindingType;
|
|
29
|
-
loc: t.SourceLocation | null;
|
|
30
|
-
section: Section;
|
|
31
|
-
closureSections: SortedOpt<Section>;
|
|
32
|
-
/** The identifier of each emitted assignment to it (set in finalize). */
|
|
33
|
-
assignments: Opt<AssignedBindingExtra>;
|
|
34
|
-
/** Emitted code the graph stopped tracking still names it. */
|
|
35
|
-
untracked?: true;
|
|
36
|
-
sources: undefined | Sources;
|
|
37
|
-
/** The intersection whose work computes it, or the nearest one upstream. Set on alias roots only. */
|
|
38
|
-
upstreamIntersection: Intersection | undefined;
|
|
39
|
-
/** Complete only once `finalizeReferences` runs at program analyze exit. */
|
|
40
|
-
reads: Set<ReferencedExtra>;
|
|
41
|
-
aliases: Set<Binding>;
|
|
42
|
-
hoists: SortedOpt<Section>;
|
|
43
|
-
getters: Map<Getter["hoisted"], boolean>;
|
|
44
|
-
property: string | undefined;
|
|
45
|
-
propertyAliases: Map<string, Binding>;
|
|
46
|
-
excludeProperties: SortedOpt<string>;
|
|
47
|
-
upstreamAlias: Binding | undefined;
|
|
48
|
-
/** The value these `<for>` params iterate, by `of` or `in`. */
|
|
49
|
-
iterates: {
|
|
50
|
-
expr: t.NodeExtra;
|
|
51
|
-
type: "of" | "in";
|
|
52
|
-
} | undefined;
|
|
53
|
-
restOffset: number | undefined;
|
|
54
|
-
scopeOffset: Binding | undefined;
|
|
55
|
-
scopeAccessor: string | undefined;
|
|
56
|
-
export: string | undefined;
|
|
57
|
-
directContentExport: string | undefined;
|
|
58
|
-
/** A name declared for this value, or all of it but its `excludeProperties`
|
|
59
|
-
* (a rest element), even once pruned. */
|
|
60
|
-
declaredAlias: Binding | undefined;
|
|
61
|
-
/** The attribute tag `<for>` param a local closure holds in its section. */
|
|
62
|
-
upstreamLocal: Binding | undefined;
|
|
63
|
-
/** An attribute tag `<for>` param's local closure in each content the loop
|
|
64
|
-
* creates that reads it. */
|
|
65
|
-
localClosures: Map<Section, Binding> | undefined;
|
|
66
|
-
declared: boolean;
|
|
67
|
-
nullable: boolean;
|
|
68
|
-
/** Settled only once `finalizeReferences` runs at program analyze exit. */
|
|
69
|
-
pruned: boolean | undefined;
|
|
70
|
-
exposed: boolean;
|
|
71
|
-
forcePersist: boolean;
|
|
72
|
-
/** Binding-side counterpart of `Section.serializePropKeys`, keyed by
|
|
73
|
-
* accessor prefix (`undefined` is the plain binding key). */
|
|
74
|
-
serializePropKeys: Map<AccessorPrefix | symbol | undefined, SerializeKey> | undefined;
|
|
75
|
-
reserveSize: number;
|
|
76
|
-
}
|
|
77
|
-
export interface InputBinding extends Binding {
|
|
78
|
-
type: typeof BindingType.input;
|
|
79
|
-
}
|
|
80
|
-
export interface ParamBinding extends Binding {
|
|
81
|
-
type: typeof BindingType.param;
|
|
82
|
-
}
|
|
83
|
-
export type ReferencedBindings = SortedOpt<Binding>;
|
|
84
|
-
export type Intersection = SortedMany<Binding>;
|
|
85
6
|
interface ReferencedFunctionExtra extends t.FunctionExtra, ReferencedExtra {
|
|
86
7
|
}
|
|
87
|
-
export interface
|
|
88
|
-
hoisted: Section | false;
|
|
89
|
-
invoked: boolean;
|
|
90
|
-
}
|
|
91
|
-
interface Read {
|
|
8
|
+
export interface Read {
|
|
92
9
|
binding: Binding;
|
|
93
10
|
extra: t.NodeExtra;
|
|
94
11
|
ownVar: boolean;
|
|
95
12
|
getter: Getter | undefined;
|
|
96
13
|
comparedTo: t.Node | undefined;
|
|
97
14
|
deferred: boolean;
|
|
98
|
-
|
|
15
|
+
inFunction: boolean;
|
|
99
16
|
}
|
|
100
|
-
interface ExtraRead {
|
|
17
|
+
export interface ExtraRead {
|
|
101
18
|
binding: Binding;
|
|
102
19
|
props: Opt<string>;
|
|
103
20
|
ownVar: boolean;
|
|
@@ -105,25 +22,42 @@ interface ExtraRead {
|
|
|
105
22
|
/** Set for same-section local reads: the function root that owns the read. */
|
|
106
23
|
localFn?: ReferencedFunctionExtra;
|
|
107
24
|
}
|
|
25
|
+
declare const kReferencedBindings: unique symbol;
|
|
26
|
+
declare const kLazyBindings: unique symbol;
|
|
27
|
+
declare const kGlobalBindings: unique symbol;
|
|
28
|
+
declare const kReferencedBindingsInFunction: unique symbol;
|
|
29
|
+
declare const kConstantBindingsInFunction: unique symbol;
|
|
108
30
|
declare module "@marko/compiler/dist/types" {
|
|
109
31
|
interface ProgramExtra {
|
|
110
|
-
/**
|
|
111
|
-
* for it. */
|
|
32
|
+
/** An expression reads `$global`, so HTML output declares a const for it. */
|
|
112
33
|
hasGlobalRead?: true;
|
|
113
34
|
}
|
|
35
|
+
interface MarkoTagExtra {
|
|
36
|
+
/** The dom binding the tag is addressed by: its node, marker or child
|
|
37
|
+
* scope; an only child control flow tag shares its parent's. */
|
|
38
|
+
nodeBinding?: Binding;
|
|
39
|
+
}
|
|
40
|
+
interface MarkoPlaceholderExtra {
|
|
41
|
+
/** The dom binding the placeholder's text node is held in. */
|
|
42
|
+
nodeBinding?: Binding;
|
|
43
|
+
}
|
|
114
44
|
interface NodeExtra {
|
|
115
45
|
section?: Section;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
46
|
+
[kReferencedBindings]?: ReferencedBindings;
|
|
47
|
+
[kLazyBindings]?: ReferencedBindings;
|
|
48
|
+
[kGlobalBindings]?: ReferencedBindings;
|
|
49
|
+
/** The bindings it feeds, in the order it feeds them: a call site's
|
|
50
|
+
* values feed the child template's, so no one template's order sorts them. */
|
|
51
|
+
derives?: Opt<Binding>;
|
|
121
52
|
/** The initial value of the binding it feeds, which keeps it rather than
|
|
122
53
|
* following it, so the binding derives no sources from it. */
|
|
123
54
|
initialValue?: true;
|
|
55
|
+
/** Its value has no side effect to evaluate, so an unread one can go: an
|
|
56
|
+
* expression's from `evaluate`, a tag's from its value attributes. */
|
|
57
|
+
pure?: boolean;
|
|
124
58
|
/** The tag-root `KnownExprs` of the call site that linked this expression
|
|
125
|
-
* to a
|
|
126
|
-
|
|
59
|
+
* to a derives template's binding, for dereferencing its reasons. */
|
|
60
|
+
callSiteExprs?: KnownExprs;
|
|
127
61
|
binding?: Binding;
|
|
128
62
|
assignment?: Binding;
|
|
129
63
|
assignmentTo?: Binding;
|
|
@@ -132,27 +66,31 @@ declare module "@marko/compiler/dist/types" {
|
|
|
132
66
|
/** The expression this node sits in: dropped or merged as one. */
|
|
133
67
|
exprRoot?: NodeExtra;
|
|
134
68
|
isEffect?: true;
|
|
135
|
-
/**
|
|
136
|
-
*
|
|
137
|
-
|
|
69
|
+
/** Retained past render (a change handler, a native spread, a dynamic tag's
|
|
70
|
+
* input), so client code may read a value here as it is, a function too. */
|
|
71
|
+
retained?: true;
|
|
72
|
+
/** Consumed where it is written (a handler its tag attaches, an
|
|
73
|
+
* effect's callback, a key function), so it reaches no client as is. */
|
|
74
|
+
consumed?: true;
|
|
75
|
+
/** Any function it holds is only ever invoked, never read as a value, so
|
|
76
|
+
* the reads inside resolve when it runs. */
|
|
138
77
|
invokeOnly?: true;
|
|
139
|
-
lazyBindings?: ReferencedBindings;
|
|
140
|
-
/** `$global` bindings this expression reads: the root means an opaque
|
|
141
|
-
* (dynamic/aliased) read, a property alias names the key. */
|
|
142
|
-
globalBindings?: ReferencedBindings;
|
|
143
78
|
/** The bindings this expression reads only by spreading them as is. */
|
|
144
79
|
spreadFrom?: SortedOpt<Binding>;
|
|
145
|
-
|
|
80
|
+
/** A `content` it spreads is rendered (as the element's body, or as a
|
|
81
|
+
* `<meta>`'s attribute), so its effect never reads it. */
|
|
82
|
+
rendersContent?: true;
|
|
146
83
|
merged?: NodeExtra;
|
|
147
84
|
}
|
|
148
85
|
interface FunctionExtra {
|
|
149
86
|
referencesScope?: boolean;
|
|
150
|
-
|
|
87
|
+
[kReferencedBindingsInFunction]?: ReferencedBindings;
|
|
151
88
|
referencedLocalBindingsInFunction?: SortedOpt<Binding>;
|
|
152
|
-
|
|
89
|
+
[kConstantBindingsInFunction]?: ReferencedBindings;
|
|
153
90
|
name?: string;
|
|
154
91
|
registerId?: string;
|
|
155
|
-
|
|
92
|
+
/** When client code reads the function itself, which registers it. */
|
|
93
|
+
reason?: Reason;
|
|
156
94
|
exportRegisterId?: string;
|
|
157
95
|
}
|
|
158
96
|
interface ArrowFunctionExpressionExtra extends FunctionExtra {
|
|
@@ -162,68 +100,27 @@ declare module "@marko/compiler/dist/types" {
|
|
|
162
100
|
interface FunctionExpressionExtra extends FunctionExtra {
|
|
163
101
|
}
|
|
164
102
|
}
|
|
165
|
-
export declare function
|
|
166
|
-
export declare function getOrCreatePropertyAlias(binding: Binding, property: string): Binding;
|
|
167
|
-
export declare function getPropertyAlias(binding: Binding | undefined, properties: Opt<string>): Binding | undefined;
|
|
168
|
-
export declare function isTagVarRead(tag: t.NodePath<t.MarkoTag>): boolean;
|
|
103
|
+
export declare function isTagVarUsed(tag: t.NodePath<t.MarkoTag>): boolean;
|
|
169
104
|
export declare function trackDomVarReferences(tag: t.NodePath<t.MarkoTag>, binding: Binding): Binding | undefined;
|
|
170
|
-
export declare function trackVarReferences(tag: t.NodePath<t.MarkoTag>, type: BindingType,
|
|
105
|
+
export declare function trackVarReferences(tag: t.NodePath<t.MarkoTag>, type: BindingType, aliased?: Binding["aliasOf"]): Binding | undefined;
|
|
171
106
|
export declare function trackParamsReferences(body: t.NodePath<t.MarkoTagBody | t.Program>, type: BindingType): Binding | undefined;
|
|
172
107
|
export declare function isReferenceInOwnBody(bindingPath: t.NodePath, reference: t.NodePath): boolean;
|
|
173
108
|
export declare function isReferenceHoisted(bindingPath: t.NodePath, reference: t.NodePath): boolean;
|
|
174
109
|
export declare function setReferencesScope(path: t.NodePath<any>): void;
|
|
175
110
|
export declare function trackGlobalReference(path: t.NodePath<t.Identifier>): void;
|
|
176
111
|
export declare function mergeReferences<T extends t.Node>(section: Section, target: T, nodes: (t.Node | undefined)[]): NonNullable<T["extra"]> & ReferencedExtra;
|
|
177
|
-
export declare function
|
|
178
|
-
export declare function
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
type IntersectionMeta = {
|
|
184
|
-
source: Binding;
|
|
185
|
-
id?: undefined;
|
|
186
|
-
scopeOffset?: undefined;
|
|
187
|
-
} | {
|
|
188
|
-
source: undefined;
|
|
189
|
-
id: number;
|
|
190
|
-
scopeOffset: Binding | undefined;
|
|
191
|
-
};
|
|
192
|
-
export declare const intersectionMeta: WeakMap<Intersection, IntersectionMeta>;
|
|
193
|
-
export declare function setBindingDownstream(binding: Binding, expr: boolean | Opt<t.NodeExtra>, exprs?: KnownExprs): void;
|
|
194
|
-
export declare function createSources(state: Sources["state"], param: Sources["param"], global?: Sources["global"], forced?: Sources["forced"]): Sources;
|
|
195
|
-
export declare function compareSources(a: Sources, b: Sources): number;
|
|
196
|
-
export declare function mergeSources(a: undefined | Sources, b: undefined | Sources): Sources | undefined;
|
|
197
|
-
export declare const bindingUtil: Sorted<Binding>;
|
|
198
|
-
export declare const propsUtil: Sorted<string>;
|
|
112
|
+
export declare function mergeReferenceGroup(section: Section, nodes: (t.Node | undefined)[]): ReferencedExtra;
|
|
113
|
+
export declare function setDerivedFrom(binding: Binding, expr: boolean | Opt<t.NodeExtra>, exprs?: KnownExprs): void;
|
|
114
|
+
export declare const getAssignments: () => AssignedBindingExtra[];
|
|
115
|
+
export declare const getReadsByExpression: () => Map<ReferencedExtra, Opt<Read>>;
|
|
116
|
+
export declare const getFunctionReadsByExpression: () => Map<ReferencedExtra, Map<ReferencedFunctionExtra, OneMany<Read>>>;
|
|
117
|
+
export declare const getReferenceFinalizers: () => (() => void)[];
|
|
199
118
|
export declare function onFinalizeReferences(finalize: () => void): void;
|
|
200
|
-
export declare function getExpressionReads(exprExtra: ReferencedExtra): Opt<Read>;
|
|
201
119
|
export declare function addRead(exprExtra: ReferencedExtra, extra: t.NodeExtra, binding: Binding, section: Section, getter: Getter | undefined): Read;
|
|
202
120
|
export declare function dropNodes(node: t.Node | t.Node[]): void;
|
|
203
|
-
export declare function
|
|
204
|
-
export declare function
|
|
205
|
-
export declare function
|
|
206
|
-
export declare function someUpstream<A>(binding: Binding | undefined, test: (binding: Binding, arg: A) => boolean, arg: A): boolean;
|
|
207
|
-
export declare function isDirectAlias(binding: Binding): boolean;
|
|
208
|
-
export declare function getAllTagReferenceNodes(tag: t.MarkoTag, referenceNodes?: t.Node[], getAttrTagNodes?: (attrTag: t.MarkoTag) => t.Node[]): t.Node[];
|
|
209
|
-
export declare function getScopeAccessorLiteral(binding: Binding, encoded?: boolean, includeId?: boolean): t.NumericLiteral | t.StringLiteral;
|
|
210
|
-
export declare function getScopeAccessor(binding: Binding, encoded?: boolean, includeId?: boolean): string;
|
|
211
|
-
export declare function getLocalsScopeAccessor(binding: Binding): string;
|
|
212
|
-
export declare function getPrefixedScopeAccessor(binding: Binding, prefix: AccessorPrefix): string;
|
|
213
|
-
export declare function getClosureAccessorId(binding: Binding): number;
|
|
214
|
-
export declare function getDebugScopeAccess(binding: Binding): {
|
|
215
|
-
root: Binding;
|
|
216
|
-
access: string;
|
|
217
|
-
};
|
|
218
|
-
export declare function getDebugName(binding: Binding): string;
|
|
219
|
-
export declare function getDebugNames(refs: ReferencedBindings): string;
|
|
220
|
-
export declare function getDebugNamesAsIdentifier(refs: ReferencedBindings): string;
|
|
221
|
-
export declare function getSectionInstancesAccessor(section: Section): string;
|
|
222
|
-
export declare function getSectionInstancesAccessorLiteral(section: Section): t.StringLiteral;
|
|
223
|
-
export declare function getReadReplacement(node: t.Identifier | t.MemberExpression | t.OptionalMemberExpression, signal?: Signal): t.Expression | undefined;
|
|
224
|
-
export declare function isInvokeOnlyBinding(binding: Binding): boolean;
|
|
225
|
-
export declare function hasNonConstantPropertyAlias(ref: Binding): boolean;
|
|
226
|
-
export declare function pruneBinding(binding: Binding, settled?: true): boolean;
|
|
121
|
+
export declare function dropExtra(exprExtra: ReferencedExtra): void;
|
|
122
|
+
export declare function dropContent(body: t.MarkoTagBody): void;
|
|
123
|
+
export declare function getAllTagReferenceNodes(tag: t.MarkoTag, referenceNodes?: t.Node[], collectAttrTag?: (attrTag: t.MarkoTag) => void): t.Node[];
|
|
227
124
|
export declare function createRead(binding: Binding, props: Opt<string>, ownVar?: boolean): ExtraRead;
|
|
228
125
|
export declare function createGetterRead(binding: Binding, props: Opt<string>, getter: Getter): ExtraRead;
|
|
229
126
|
export interface ReferencedExtra extends t.NodeExtra {
|
|
@@ -241,16 +138,21 @@ export declare function isAssignedBindingExtra(extra: t.NodeExtra | undefined):
|
|
|
241
138
|
export interface RegisteredFnExtra extends ReferencedExtra, t.FunctionExtra {
|
|
242
139
|
name: string;
|
|
243
140
|
registerId: string;
|
|
244
|
-
|
|
141
|
+
reason: Reason;
|
|
245
142
|
}
|
|
246
143
|
export declare function isRegisteredFnExtra(extra: t.NodeExtra | undefined): extra is RegisteredFnExtra;
|
|
144
|
+
export declare function getReferencedBindings(extra: t.NodeExtra | undefined): ReferencedBindings;
|
|
145
|
+
export declare function getLazyBindings(extra: t.NodeExtra | undefined): ReferencedBindings;
|
|
146
|
+
export declare function getGlobalBindings(extra: t.NodeExtra | undefined): ReferencedBindings;
|
|
147
|
+
export declare function getReferencedBindingsInFunction(extra: t.FunctionExtra): ReferencedBindings;
|
|
148
|
+
export declare function getConstantBindingsInFunction(extra: t.FunctionExtra): ReferencedBindings;
|
|
149
|
+
export declare function setResolvedFunctionReads(extra: t.FunctionExtra, referencedBindings: ReferencedBindings, constantBindings: ReferencedBindings): void;
|
|
150
|
+
export declare function setResolvedReads(extra: ReferencedExtra, referencedBindings: ReferencedBindings, lazyBindings: ReferencedBindings, globalBindings: ReferencedBindings): void;
|
|
247
151
|
export declare function getCanonicalExtra<T extends t.NodeExtra>(extra: T): T;
|
|
248
|
-
export declare function getAllSerializeReasonsForExtra(extra: t.NodeExtra): undefined | SerializeReason;
|
|
249
|
-
export declare function getAllSerializeReasonsForBinding(binding: Binding, properties?: Opt<string> | true): undefined | SerializeReason;
|
|
250
|
-
export declare function getRegisterReasonForExtra(extra: t.NodeExtra): undefined | SerializeReason;
|
|
251
152
|
export interface KnownExprs {
|
|
252
153
|
known?: Record<string, KnownExprs>;
|
|
253
154
|
value?: t.NodeExtra;
|
|
254
155
|
}
|
|
255
|
-
export declare function mapParamReasonToExpr(exprs: KnownExprs, reason: boolean | Opt<
|
|
256
|
-
export declare function mapParamBindingToExpr(exprs: KnownExprs, binding:
|
|
156
|
+
export declare function mapParamReasonToExpr(exprs: KnownExprs, reason: boolean | Opt<ParamBinding>): true | import("./optional").Many<t.NodeExtra> | t.NodeExtra | undefined;
|
|
157
|
+
export declare function mapParamBindingToExpr(exprs: KnownExprs, binding: ParamBinding): Opt<t.NodeExtra>;
|
|
158
|
+
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import type { Falsy } from "../../common/types";
|
|
3
|
-
import { _attr, _attr_class, _attr_style, _escape,
|
|
3
|
+
import { _attr, _attr_class, _attr_style, _escape, _escape_script, _escape_style, _unescaped } from "../../html";
|
|
4
4
|
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 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
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
|
+
export declare const domRuntimeFeatures: readonly ["catch", "controllable", "controllable-input", "controllable-open", "controllable-select", "controllable-textarea", "dynamic-tag-script", "dynamic-tag-var", "lazy", "placeholder"];
|
|
11
11
|
export type DOMRuntimeFeature = (typeof domRuntimeFeatures)[number];
|
|
12
12
|
export declare function importRuntimeFeature(feature: DOMRuntimeFeature): void;
|
|
13
|
+
export declare function getRuntimeFeatureImport(feature: DOMRuntimeFeature): t.ImportDeclaration;
|
|
13
14
|
export declare function getHTMLRuntime(): {
|
|
14
15
|
_escape: typeof _escape;
|
|
15
|
-
_escape_comment: typeof _escape_comment;
|
|
16
16
|
_unescaped: typeof _unescaped;
|
|
17
17
|
_attr: typeof _attr;
|
|
18
18
|
_attr_class: typeof _attr_class;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { types as t } from "@marko/compiler";
|
|
2
|
+
import { type AccessorPrefix } from "../../common/accessor.debug";
|
|
3
|
+
import { type Binding } from "./bindings";
|
|
4
|
+
import { type Section } from "./sections";
|
|
5
|
+
import { type PlaceSlot } from "./slots";
|
|
6
|
+
export declare function getSlotAccessor(slot: PlaceSlot): string;
|
|
7
|
+
export declare function getScopeOffsetAccessorLiteral(nodeBinding: Binding, encoded?: boolean): t.NumericLiteral | t.StringLiteral;
|
|
8
|
+
export declare function getScopeAccessorLiteral(binding: Binding, encoded?: boolean, includeId?: boolean): t.NumericLiteral | t.StringLiteral;
|
|
9
|
+
export declare function getScopeAccessor(binding: Binding, encoded?: boolean, includeId?: boolean): string;
|
|
10
|
+
export declare function getLocalsScopeAccessor(binding: Binding): string;
|
|
11
|
+
export declare function getPrefixedScopeAccessor(binding: Binding, prefix: AccessorPrefix): string;
|
|
12
|
+
export declare function getClosureAccessorLiteral(binding: Binding): t.NumericLiteral | t.StringLiteral;
|
|
13
|
+
export declare function getSectionInstancesAccessor(section: Section): string;
|
|
14
|
+
export declare function getSectionInstancesAccessorLiteral(section: Section): t.StringLiteral;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Binding } from "./
|
|
2
|
+
import { type Binding } from "./bindings";
|
|
3
3
|
import type { Section } from "./sections";
|
|
4
4
|
export declare function getScopeExpression(section: Section, targetSection: Section): t.Identifier | t.MemberExpression;
|
|
5
5
|
export declare function createScopeReadExpression(reference: Binding, section?: Section): t.MemberExpression;
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import type
|
|
3
|
-
import type { WalkCode } from "../../common/types";
|
|
2
|
+
import { type Binding, type Intersection, type IntersectionMeta, type ParamBinding, type ReferencedBindings } from "./bindings";
|
|
4
3
|
import * as ContentType from "./constants/content-type";
|
|
5
4
|
import type * as Step from "./constants/step";
|
|
6
5
|
import * as StructureKind from "./constants/structure-kind";
|
|
7
6
|
import { type OneMany, type Opt, Sorted, type SortedOpt } from "./optional";
|
|
8
|
-
import { type
|
|
9
|
-
import { type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export type ParamSerializeReasonGroups = [
|
|
15
|
-
ParamSerializeReasonGroup,
|
|
16
|
-
...ParamSerializeReasonGroup[]
|
|
17
|
-
];
|
|
7
|
+
import { type Reason } from "./reasons";
|
|
8
|
+
import { type KnownExprs } from "./references";
|
|
9
|
+
import { type Slot } from "./slots";
|
|
10
|
+
import { type Sources } from "./sources";
|
|
11
|
+
export type ParamReasonGroup = NonNullable<Sources["param"]>;
|
|
12
|
+
export type ParamReasonGroups = [ParamReasonGroup, ...ParamReasonGroup[]];
|
|
18
13
|
type ContentType = ContentType.Value;
|
|
19
14
|
export { ContentType, StructureKind };
|
|
20
15
|
export type StructureRef = StructureSectionRef | StructureExportRef;
|
|
@@ -28,20 +23,20 @@ export interface StructureExportRef {
|
|
|
28
23
|
path: string;
|
|
29
24
|
hint: string;
|
|
30
25
|
}
|
|
31
|
-
export type StructureOp = string | Step.Value | StructureText |
|
|
26
|
+
export type StructureOp = string | Step.Value | StructureText | StructureNode | StructureChild;
|
|
32
27
|
export interface StructureText {
|
|
33
28
|
kind: typeof StructureKind.Text;
|
|
34
29
|
value: string;
|
|
35
30
|
}
|
|
36
|
-
export interface
|
|
37
|
-
kind: typeof StructureKind.
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
export interface StructureNode {
|
|
32
|
+
kind: typeof StructureKind.Node;
|
|
33
|
+
binding: Binding | undefined;
|
|
34
|
+
marker: boolean;
|
|
40
35
|
}
|
|
41
36
|
export interface StructureChild {
|
|
42
37
|
kind: typeof StructureKind.Child;
|
|
43
38
|
name: string;
|
|
44
|
-
|
|
39
|
+
binding: Binding;
|
|
45
40
|
renderer?: StructureRef;
|
|
46
41
|
}
|
|
47
42
|
export interface Section {
|
|
@@ -50,52 +45,60 @@ export interface Section {
|
|
|
50
45
|
loc: t.SourceLocation | undefined;
|
|
51
46
|
depth: number;
|
|
52
47
|
parent: Section | undefined;
|
|
48
|
+
children: Section[];
|
|
53
49
|
program: Section;
|
|
54
|
-
|
|
55
|
-
binding: Binding;
|
|
56
|
-
prefix: AccessorPrefix;
|
|
57
|
-
} | undefined;
|
|
58
|
-
params: undefined | ParamBinding | InputBinding;
|
|
50
|
+
params: undefined | ParamBinding;
|
|
59
51
|
/** The attribute tag `<for>` params this content reads, held as its own
|
|
60
52
|
* bindings that the loop binds as it creates it. */
|
|
61
53
|
localClosures: ReferencedBindings;
|
|
62
54
|
referencedClosures: ReferencedBindings;
|
|
63
|
-
referencedHoists: ReferencedBindings;
|
|
64
55
|
bindings: ReferencedBindings;
|
|
65
56
|
hoisted: ReferencedBindings;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
paramReasonGroups:
|
|
57
|
+
/** The closures its `<for>` rows read only by comparing them to the row's
|
|
58
|
+
* key, which a row selector updates. */
|
|
59
|
+
selector: {
|
|
60
|
+
key: Binding;
|
|
61
|
+
closures: Set<Binding>;
|
|
62
|
+
} | undefined;
|
|
63
|
+
/** The canonical intersections its work waits on, once ids allocate. */
|
|
64
|
+
intersections: Map<Intersection, IntersectionMeta> | undefined;
|
|
65
|
+
/** The slots of its scope, its own and its bindings'. */
|
|
66
|
+
slots: SortedOpt<Slot>;
|
|
67
|
+
/** When client code reads anything in its scope: its slots' reasons merged. */
|
|
68
|
+
reason: undefined | Reason;
|
|
69
|
+
paramReasonGroups: ParamReasonGroups | undefined;
|
|
79
70
|
returnValueExpr: t.NodeExtra | undefined;
|
|
80
|
-
returnSerializeReason: SerializeReason | undefined;
|
|
81
71
|
isHoistThrough: true | undefined;
|
|
82
|
-
|
|
83
|
-
/** For a `<define>` body
|
|
72
|
+
branchExpr: t.NodeExtra | undefined;
|
|
73
|
+
/** For a `<define>` body or a template rendering itself, the sections whose
|
|
74
|
+
* direct calls render it. */
|
|
84
75
|
callSections: SortedOpt<Section>;
|
|
85
76
|
/** The content's rendering tag (its extra), and each child binding the
|
|
86
77
|
* content feeds, at `properties`. */
|
|
87
|
-
|
|
78
|
+
derives: {
|
|
88
79
|
tag: t.MarkoTagExtra;
|
|
89
80
|
binding: OneMany<Binding>;
|
|
90
81
|
properties: Opt<string>;
|
|
91
82
|
exprs: KnownExprs | undefined;
|
|
92
83
|
} | undefined;
|
|
84
|
+
/** Content a known child never reads, which no output renders. */
|
|
85
|
+
pruned: boolean;
|
|
93
86
|
hasAbortSignal: boolean;
|
|
94
87
|
/** Count of distinct `$signal` expression roots; analyze allocates each
|
|
95
|
-
* root's
|
|
88
|
+
* root's abort id from this so translates read, never re-derive. */
|
|
96
89
|
abortSignalExprs: number;
|
|
97
90
|
readsOwner: boolean;
|
|
98
|
-
|
|
91
|
+
/** Whether analysis found work keyed by setup in the section, or in a
|
|
92
|
+
* `<define>` body or template it calls in place. */
|
|
93
|
+
hasSetupWork: boolean;
|
|
94
|
+
/** Its tag, which renders it in place into branch scopes at the tag's node
|
|
95
|
+
* binding, and whether its branch expression's value can leave it unrendered. */
|
|
96
|
+
branch: {
|
|
97
|
+
nodeBinding: Binding;
|
|
98
|
+
optional: boolean;
|
|
99
|
+
/** An `<if>` branch's place in its chain, the renderer index it renders as. */
|
|
100
|
+
index?: number;
|
|
101
|
+
} | undefined;
|
|
99
102
|
content: null | {
|
|
100
103
|
startType: ContentType;
|
|
101
104
|
endType: ContentType;
|
|
@@ -116,17 +119,19 @@ export declare const sectionUtil: Sorted<Section>;
|
|
|
116
119
|
export declare function startSection(path: t.NodePath<t.MarkoTagBody | t.Program>): Section | undefined;
|
|
117
120
|
export declare function getOrCreateSection(path: t.NodePath<any>): Section;
|
|
118
121
|
export declare function getSectionForBody(body: t.NodePath<t.MarkoTagBody | t.Program>): Section | undefined;
|
|
122
|
+
export declare function removePrunedContent(tag: t.NodePath<t.MarkoTag>): void;
|
|
119
123
|
export declare function getSection(path: t.NodePath): Section;
|
|
120
124
|
export declare const getScopeIdIdentifier: (section: Section) => t.Identifier;
|
|
121
|
-
export declare const getSectionParentIsOwner: (section: Section) => boolean, setSectionParentIsOwner: (section: Section, value: boolean) => void;
|
|
122
125
|
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;
|
|
123
126
|
export declare function forEachSection(fn: (section: Section) => void): void;
|
|
124
|
-
export declare function getChildSections(section: Section): Section[];
|
|
125
127
|
export declare function getContentClosures(section: Section): ReferencedBindings;
|
|
126
128
|
export declare function forEachAncestorSection<A>(from: Section, to: Section, fn: (section: Section, arg: A) => void, arg: A): void;
|
|
127
129
|
export declare function forEachSectionReverse(fn: (section: Section) => void): void;
|
|
128
130
|
export declare function getNodeContentType(path: t.NodePath<t.Statement>, extraMember: "startType" | "endType", contentInfo?: Section["content"]): ContentType.Value | null;
|
|
129
|
-
export declare function
|
|
131
|
+
export declare function getRendererReason(section: Section): boolean | Sources;
|
|
132
|
+
export declare function isResumedBranch(section: Section): section is Section & {
|
|
133
|
+
branch: NonNullable<Section["branch"]>;
|
|
134
|
+
};
|
|
130
135
|
export declare function isImmediateOwner(section: Section, binding: Binding): boolean;
|
|
131
136
|
export declare function isDirectClosure(section: Section, closure: Binding): boolean;
|
|
132
137
|
export declare function isDynamicClosure(section: Section, closure: Binding): boolean;
|
|
@@ -134,7 +139,8 @@ export declare function getDynamicClosureIndex(closure: Binding, closureSection:
|
|
|
134
139
|
export declare function getDirectClosures(section: Section): SortedOpt<Binding>;
|
|
135
140
|
export declare function isSameOrChildSection(section: Section, other: Section): boolean;
|
|
136
141
|
export declare function getCommonSection(section: Section, other: Section): Section;
|
|
137
|
-
export declare function
|
|
138
|
-
export declare function ensureReasonGroups(reason: Section["
|
|
139
|
-
export declare function getParamReasonGroupIndex(section: Section,
|
|
140
|
-
export declare function groupParamsBySection(params: Sources["param"]): Map<Section, import("./optional").SortedOneMany<
|
|
142
|
+
export declare function finalizeParamReasonGroups(section: Section): void;
|
|
143
|
+
export declare function ensureReasonGroups(reason: Section["reason"]): void;
|
|
144
|
+
export declare function getParamReasonGroupIndex(section: Section, group: ParamReasonGroup): number;
|
|
145
|
+
export declare function groupParamsBySection(params: Sources["param"]): Map<Section, import("./optional").SortedOneMany<ParamBinding>>;
|
|
146
|
+
export declare function setReadsOwner(from: Section, to: Section): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { types as t } from "@marko/compiler";
|
|
2
|
+
import { type Binding } from "./bindings";
|
|
3
|
+
import { type Opt } from "./optional";
|
|
4
|
+
import { type KnownExprs } from "./references";
|
|
5
|
+
import { type Section } from "./sections";
|
|
6
|
+
export declare function setTagDerivedFrom(tag: t.NodePath<t.MarkoTag>, binding: Opt<Binding>, exprs?: KnownExprs): void;
|
|
7
|
+
export declare function finalizeTagDerivations(section: Section): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type
|
|
2
|
+
import { type Binding, type Getter, type ReferencedBindings } from "./bindings";
|
|
3
3
|
import { type Opt } from "./optional";
|
|
4
|
-
import { type Binding, type Getter, type ReferencedBindings } from "./references";
|
|
5
4
|
import { type Section } from "./sections";
|
|
5
|
+
import { type PlaceSlot } from "./slots";
|
|
6
6
|
export interface Signal {
|
|
7
7
|
identifier: t.Identifier;
|
|
8
8
|
referencedBindings: ReferencedBindings;
|
|
@@ -12,22 +12,20 @@ export interface Signal {
|
|
|
12
12
|
referenced?: boolean;
|
|
13
13
|
values: Array<{
|
|
14
14
|
signal: Signal;
|
|
15
|
-
|
|
15
|
+
/** None for a signal that runs on the scope alone. */
|
|
16
|
+
value: t.Expression | undefined;
|
|
16
17
|
}>;
|
|
17
18
|
intersection: Opt<Signal>;
|
|
18
19
|
/** Signals this one forwards into: they must declare first when the
|
|
19
20
|
* forward simplifies to a bare, eagerly evaluated reference. */
|
|
20
21
|
forwards: Opt<Signal>;
|
|
21
|
-
/** Runs before `render`: registrations (eg `_var`) that an earlier tag's
|
|
22
|
-
* synchronous `_return` may reach before the registering tag's own setup. */
|
|
23
|
-
prepare: t.Statement[];
|
|
24
22
|
render: t.Statement[];
|
|
25
23
|
effect: t.Statement[];
|
|
26
24
|
hasHTMLEffect: boolean;
|
|
27
25
|
hasSideEffect: boolean;
|
|
28
26
|
forcePersist: boolean;
|
|
29
27
|
inline: {
|
|
30
|
-
value: t.Expression;
|
|
28
|
+
value: t.Expression | undefined;
|
|
31
29
|
} | undefined;
|
|
32
30
|
export: boolean;
|
|
33
31
|
extraArgs: t.Expression[] | undefined;
|
|
@@ -42,10 +40,8 @@ export declare function getContentClosureValues(bodySection: Section): {
|
|
|
42
40
|
scope: t.Identifier;
|
|
43
41
|
levels: t.Expression[];
|
|
44
42
|
} | undefined;
|
|
45
|
-
export declare function
|
|
46
|
-
export declare function setBindingSerializedValue(section: Section, binding: Binding, expression: t.Expression, prefix?: AccessorPrefix): void;
|
|
43
|
+
export declare function setScopeProperty(found: PlaceSlot | undefined, expression: t.Expression): string | undefined;
|
|
47
44
|
export declare function setSectionDebugVar(section: Section, accessor: string, name: string, loc: t.SourceLocation | null | undefined): void;
|
|
48
|
-
export declare function setSerializedValue(section: Section, key: string, expression: t.Expression): void;
|
|
49
45
|
export declare function addWriteScopeBuilder(section: Section, builder: (writeCall: t.Expression) => t.Expression): void;
|
|
50
46
|
export declare const getHTMLSectionStatements: (section: Section) => t.Statement[];
|
|
51
47
|
export declare function getBindingGetterIdentifier(binding: Binding, getterSection: Getter["hoisted"]): t.Identifier;
|
|
@@ -55,8 +51,8 @@ export declare function signalHasStatements(signal: Signal): boolean;
|
|
|
55
51
|
export declare function getSignalFn(signal: Signal): t.Expression;
|
|
56
52
|
export declare function getSignalValueIdentifier(signal: Signal): t.Identifier;
|
|
57
53
|
export declare function replaceNullishAndEmptyFunctionsWith0(args: (t.Expression | undefined | false)[]): t.Expression[];
|
|
58
|
-
export declare function addStatement(type: "
|
|
59
|
-
export declare function addValue(targetSection: Section, referencedBindings: ReferencedBindings, signal: Signal, value
|
|
54
|
+
export declare function addStatement(type: "render" | "effect", targetSection: Section, referencedBindings: ReferencedBindings, statement: t.Statement | t.Statement[], isPure?: boolean): void;
|
|
55
|
+
export declare function addValue(targetSection: Section, referencedBindings: ReferencedBindings, signal: Signal, value?: t.Expression): void;
|
|
60
56
|
export declare function getResumeRegisterId(section: Section, referencedBindings: string | ReferencedBindings, type?: string): string;
|
|
61
57
|
export declare function writeSignals(section: Section): Set<Signal>;
|
|
62
58
|
export declare function writeRegisteredFns(): void;
|