marko 6.0.80 → 6.0.81
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/dist/translator/index.js +1168 -1258
- package/dist/translator/util/entry-builder.d.ts +0 -1
- package/dist/translator/util/is-event-or-change-handler.d.ts +1 -0
- package/dist/translator/util/references.d.ts +4 -2
- package/dist/translator/util/sections.d.ts +4 -4
- package/dist/translator/util/serialize-reasons.d.ts +7 -16
- package/dist/translator/util/set-tag-sections-downstream.d.ts +4 -0
- package/dist/translator/visitors/function.d.ts +4 -0
- package/package.json +2 -2
- package/tags/debug.d.marko +1 -1
- package/tags/log.d.marko +1 -1
- package/tags/do.d.marko +0 -5
@@ -0,0 +1 @@
|
|
1
|
+
export declare function isEventOrChangeHandler(prop: string): boolean;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
2
2
|
import { type Many, type Opt, Sorted } from "./optional";
|
3
3
|
import { type Section } from "./sections";
|
4
|
+
import { type SerializeReason } from "./serialize-reasons";
|
4
5
|
declare const kIsInvoked: unique symbol;
|
5
6
|
export declare const kBranchSerializeReason: unique symbol;
|
6
7
|
export type Aliases = undefined | Binding | {
|
@@ -119,12 +120,13 @@ export interface AssignedBindingExtra extends ReferencedExtra {
|
|
119
120
|
export declare function isAssignedBindingExtra(extra: t.NodeExtra | undefined): extra is AssignedBindingExtra;
|
120
121
|
export interface RegisteredFnExtra extends ReferencedExtra {
|
121
122
|
registerId: string;
|
123
|
+
registerReason: SerializeReason;
|
122
124
|
name: string;
|
123
125
|
referencesScope?: boolean;
|
124
126
|
referencedBindingsInFunction: ReferencedBindings;
|
125
127
|
}
|
126
128
|
export declare function isRegisteredFnExtra(extra: t.NodeExtra | undefined): extra is RegisteredFnExtra;
|
127
129
|
export declare function getCanonicalExtra<T extends t.NodeExtra>(extra: T): T;
|
128
|
-
export declare function
|
129
|
-
export declare function
|
130
|
+
export declare function getAllSerializeReasonsForExtra(extra: t.NodeExtra): undefined | SerializeReason;
|
131
|
+
export declare function getAllSerializeReasonsForBinding(binding: Binding): undefined | SerializeReason;
|
130
132
|
export {};
|
@@ -2,8 +2,8 @@ import { types as t } from "@marko/compiler";
|
|
2
2
|
import type { AccessorPrefix } from "../../common/accessor.debug";
|
3
3
|
import type { ParamSerializeReasonGroups } from "../visitors/program";
|
4
4
|
import { Sorted } from "./optional";
|
5
|
-
import type
|
6
|
-
import {
|
5
|
+
import { type Binding, type InputBinding, type ParamBinding, type ReferencedBindings } from "./references";
|
6
|
+
import type { SerializeReason } from "./serialize-reasons";
|
7
7
|
export declare enum ContentType {
|
8
8
|
Comment = 0,
|
9
9
|
Dynamic = 1,
|
@@ -33,7 +33,7 @@ export interface Section {
|
|
33
33
|
returnSerializeReason: SerializeReason | undefined;
|
34
34
|
isHoistThrough: true | undefined;
|
35
35
|
upstreamExpression: t.NodeExtra | undefined;
|
36
|
-
downstreamBinding: Binding | undefined;
|
36
|
+
downstreamBinding: Binding | undefined | false;
|
37
37
|
hasAbortSignal: boolean;
|
38
38
|
isBranch: boolean;
|
39
39
|
content: null | {
|
@@ -62,7 +62,7 @@ export declare const getScopeIdentifier: (section: Section, ignoreDefault?: bool
|
|
62
62
|
export declare function forEachSection(fn: (section: Section) => void): void;
|
63
63
|
export declare function forEachSectionReverse(fn: (section: Section) => void): void;
|
64
64
|
export declare function getNodeContentType(path: t.NodePath<t.Statement>, extraMember: "startType" | "endType", contentInfo?: Section["content"]): ContentType | null;
|
65
|
-
export declare
|
65
|
+
export declare function getSectionRegisterReasons(section: Section): false | SerializeReason | undefined;
|
66
66
|
export declare function isSectionWithHoists(section: Section): boolean;
|
67
67
|
export declare function isImmediateOwner(section: Section, binding: Binding): boolean;
|
68
68
|
export declare function isDirectClosure(section: Section, closure: Binding): boolean;
|
@@ -8,29 +8,20 @@ export type SerializeReason = true | Sources;
|
|
8
8
|
export type SerializeKey = symbol & {
|
9
9
|
__serialize_key__: 1;
|
10
10
|
};
|
11
|
-
export declare function
|
12
|
-
export declare function
|
13
|
-
export declare function
|
14
|
-
export declare function
|
15
|
-
export declare function isSectionForceSerialized(section: Section, prop?: AccessorProp | symbol): boolean;
|
16
|
-
export declare function isBindingForceSerialized(section: Section, binding: Binding, prefix?: AccessorPrefix | symbol): boolean;
|
11
|
+
export declare function isForceSerialized(section: Section, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): boolean;
|
12
|
+
export declare function addSerializeReason(section: Section, reason: undefined | false | SerializeReason, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): void;
|
13
|
+
export declare function addSerializeExpr(section: Section, expr: boolean | Opt<t.NodeExtra>, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): void;
|
14
|
+
export declare function addOwnerSerializeReason(from: Section, to: Section, reason: undefined | boolean | SerializeReason): void;
|
17
15
|
export declare function isReasonDynamic(reason: undefined | SerializeReason): reason is {
|
18
16
|
state: undefined;
|
19
17
|
param: OneMany<InputBinding | ParamBinding>;
|
20
18
|
};
|
21
|
-
export declare function
|
22
|
-
export declare function addBindingSerializeReasonExpr(section: Section, binding: Binding, expr: undefined | boolean | Opt<t.NodeExtra>, prefix?: AccessorPrefix | symbol): void;
|
23
|
-
export declare function addSectionSerializeReasonRef(section: Section, ref: undefined | boolean | ReferencedBindings, prop?: AccessorProp | symbol): void;
|
24
|
-
export declare function addBindingSerializeReasonRef(section: Section, binding: Binding, ref: undefined | boolean | ReferencedBindings, prefix?: AccessorPrefix | symbol): void;
|
25
|
-
export declare function addSectionSerializeReason(section: Section, reason: undefined | false | SerializeReason, prop?: AccessorProp | symbol): void;
|
26
|
-
export declare function addBindingSerializeReason(section: Section, binding: Binding, reason: undefined | false | SerializeReason, prefix?: AccessorPrefix | symbol): void;
|
27
|
-
export declare function getSectionSerializeReason(section: Section, prop?: AccessorProp | symbol): SerializeReason | undefined;
|
28
|
-
export declare function getBindingSerializeReason(section: Section, binding: Binding, prefix?: AccessorPrefix | symbol): SerializeReason | undefined;
|
29
|
-
export declare function applySerializeReasonExprs(section: Section): void;
|
30
|
-
export declare function finalizeSectionSerializeReasons(section: Section): void;
|
19
|
+
export declare function getSerializeReason(section: Section, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): SerializeReason | undefined;
|
31
20
|
export declare function getSerializeSourcesForExpr(expr: t.NodeExtra): Sources | undefined;
|
32
21
|
export declare function getSerializeSourcesForExprs(exprs: Opt<t.NodeExtra>): Sources | undefined;
|
33
22
|
export declare function getSerializeSourcesForRef(ref: ReferencedBindings): Sources | undefined;
|
34
23
|
export declare function mergeSerializeReasons(a: SerializeReason, b: undefined | SerializeReason): SerializeReason;
|
35
24
|
export declare function mergeSerializeReasons(a: undefined | SerializeReason, b: SerializeReason): SerializeReason;
|
36
25
|
export declare function mergeSerializeReasons(a: undefined | SerializeReason, b: undefined | SerializeReason): SerializeReason | undefined;
|
26
|
+
export declare function applySerializeExprs(section: Section): void;
|
27
|
+
export declare function finalizeSerializeReason(section: Section): void;
|
@@ -1,15 +1,19 @@
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
2
|
+
import { type SerializeReason } from "../util/serialize-reasons";
|
2
3
|
declare module "@marko/compiler/dist/types" {
|
3
4
|
interface FunctionDeclarationExtra {
|
4
5
|
registerId?: string;
|
6
|
+
registerReason?: SerializeReason;
|
5
7
|
name?: string;
|
6
8
|
}
|
7
9
|
interface FunctionExpressionExtra {
|
8
10
|
registerId?: string;
|
11
|
+
registerReason?: SerializeReason;
|
9
12
|
name?: string;
|
10
13
|
}
|
11
14
|
interface ArrowFunctionExpressionExtra {
|
12
15
|
registerId?: string;
|
16
|
+
registerReason?: SerializeReason;
|
13
17
|
name?: string;
|
14
18
|
}
|
15
19
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "marko",
|
3
|
-
"version": "6.0.
|
3
|
+
"version": "6.0.81",
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
5
5
|
"keywords": [
|
6
6
|
"api",
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"build": "node -r ~ts ./scripts/bundle.ts"
|
49
49
|
},
|
50
50
|
"dependencies": {
|
51
|
-
"@marko/compiler": "^5.39.
|
51
|
+
"@marko/compiler": "^5.39.40",
|
52
52
|
"csstype": "^3.1.3",
|
53
53
|
"magic-string": "^0.30.17"
|
54
54
|
},
|
package/tags/debug.d.marko
CHANGED
package/tags/log.d.marko
CHANGED