marko 6.3.43 → 6.3.45
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 +7 -3
- package/dist/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.feat.mjs +1 -1
- package/dist/debug/dom/controllable-input.feat.js +1 -1
- package/dist/debug/dom/controllable-input.feat.mjs +1 -1
- package/dist/debug/dom/controllable-open.feat.js +1 -1
- package/dist/debug/dom/controllable-open.feat.mjs +1 -1
- package/dist/debug/dom/controllable-select.feat.js +1 -1
- package/dist/debug/dom/controllable-select.feat.mjs +1 -1
- package/dist/debug/dom/controllable-textarea.feat.js +1 -1
- package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/debug/dom/controllable.feat.js +1 -1
- package/dist/debug/dom/controllable.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-BbtmY5_5.js → dom-DBuLwSOh.js} +10 -0
- package/dist/debug/{dom-DYV177a1.mjs → dom-ky42a_qY.mjs} +5 -1
- package/dist/debug/dom.js +2 -1
- package/dist/debug/dom.mjs +2 -2
- package/dist/debug/html.js +2 -1
- package/dist/debug/html.mjs +2 -1
- package/dist/dom/catch.feat.js +3 -3
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/controllable-input.feat.js +1 -1
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +1 -1
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +1 -1
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +1 -1
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +1 -1
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +2 -2
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/signals.d.ts +1 -0
- package/dist/{dom-HMfNm7KC.mjs → dom-BSAs0ur8.mjs} +4 -1
- package/dist/{dom-CKak9Qet.js → dom-DHJCbngT.js} +45 -37
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +21 -21
- package/dist/dom.mjs +2 -2
- package/dist/html.js +1 -1
- package/dist/html.mjs +1 -1
- package/dist/translator/index.js +236 -129
- package/dist/translator/interop/index.d.ts +8 -0
- package/dist/translator/util/entry-builder.d.ts +17 -3
- package/dist/translator/util/known-tag.d.ts +1 -5
- package/dist/translator/util/references.d.ts +10 -1
- package/dist/translator/util/sections.d.ts +3 -1
- package/dist/translator/util/serialize-reasons.d.ts +3 -1
- package/dist/translator/util/set-tag-sections-downstream.d.ts +2 -2
- package/dist/translator/util/tag-name-type.d.ts +3 -0
- package/dist/translator/visitors/import-declaration.d.ts +4 -0
- package/dist/translator/visitors/program/index.d.ts +1 -0
- package/dist/translator/visitors/tag/custom-tag.d.ts +1 -0
- package/package.json +4 -4
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { type Config, types as t } from "@marko/compiler";
|
|
2
|
+
declare module "@marko/compiler/dist/types" {
|
|
3
|
+
interface ProgramExtra {
|
|
4
|
+
/** A Class API template that registers hoisted handlers for Tags resume. */
|
|
5
|
+
resumesClassFns?: boolean;
|
|
6
|
+
/** A Class API template whose Tags child revives through the compat runtime. */
|
|
7
|
+
resumesCompat?: boolean;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
2
10
|
type Taglibs = [taglibId: string, taglib: Record<string, unknown>][];
|
|
3
11
|
export declare function createInteropTranslator(translate5: any): {
|
|
4
12
|
version: any;
|
|
@@ -3,19 +3,33 @@ declare module "@marko/compiler/dist/types" {
|
|
|
3
3
|
interface ProgramExtra {
|
|
4
4
|
needsCompat?: boolean;
|
|
5
5
|
isInteractive?: boolean;
|
|
6
|
+
hasClientStatement?: boolean;
|
|
6
7
|
page?: boolean;
|
|
7
8
|
}
|
|
8
9
|
}
|
|
9
10
|
interface EntryState {
|
|
10
11
|
init: boolean;
|
|
12
|
+
load: boolean;
|
|
13
|
+
/** Depth of enclosing templates whose modules the bundle already loads:
|
|
14
|
+
* below a root everything arrives through its imports, and a lazy subtree
|
|
15
|
+
* is loaded by its own load entry. */
|
|
16
|
+
bundled: number;
|
|
17
|
+
roots: string[];
|
|
18
|
+
/** Assets of templates the bundle never loads; the entry imports them. */
|
|
11
19
|
assets: Set<string>;
|
|
20
|
+
/** Assets that arrive through a bundled template's imports; the entry
|
|
21
|
+
* imports them itself only when it links nothing (a server only page). */
|
|
22
|
+
bundledAssets: Set<string>;
|
|
23
|
+
/** Whether each reached file was only ever seen below a bundled template. */
|
|
24
|
+
visited: Map<string, boolean>;
|
|
12
25
|
}
|
|
13
26
|
type EntryFile = t.BabelFile & {
|
|
14
27
|
[kState]?: EntryState;
|
|
15
28
|
};
|
|
29
|
+
type VisitChild = (id: string, bundled?: boolean) => void;
|
|
16
30
|
declare const kState: unique symbol;
|
|
17
|
-
declare const
|
|
31
|
+
declare const builder: {
|
|
18
32
|
build(entryFile: EntryFile, exportInit?: boolean): t.Statement[];
|
|
19
|
-
visit(file: t.BabelFile, entryFile: EntryFile, visitChild
|
|
33
|
+
visit(file: t.BabelFile, entryFile: EntryFile, visitChild?: VisitChild): void;
|
|
20
34
|
};
|
|
21
|
-
export default
|
|
35
|
+
export default builder;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import { type BindingPropTree } from "./binding-prop-tree";
|
|
3
|
-
import { type Binding } from "./references";
|
|
3
|
+
import { type Binding, type KnownExprs } from "./references";
|
|
4
4
|
import { type Section } from "./sections";
|
|
5
|
-
interface KnownExprs {
|
|
6
|
-
known?: Record<string, KnownExprs>;
|
|
7
|
-
value?: t.NodeExtra;
|
|
8
|
-
}
|
|
9
5
|
declare const kContentSection: unique symbol;
|
|
10
6
|
declare const kChildScopeBinding: unique symbol;
|
|
11
7
|
declare const kChildOffsetScopeBinding: unique symbol;
|
|
@@ -90,6 +90,9 @@ declare module "@marko/compiler/dist/types" {
|
|
|
90
90
|
section?: Section;
|
|
91
91
|
referencedBindings?: ReferencedBindings;
|
|
92
92
|
downstream?: Opt<Binding>;
|
|
93
|
+
/** The tag-root `KnownExprs` of the call site that linked this expression
|
|
94
|
+
* to a downstream template's binding, for dereferencing its reasons. */
|
|
95
|
+
downstreamExprs?: KnownExprs;
|
|
93
96
|
binding?: Binding;
|
|
94
97
|
assignment?: Binding;
|
|
95
98
|
assignmentTo?: Binding;
|
|
@@ -141,7 +144,7 @@ export declare const intersectionMeta: WeakMap<Intersection, {
|
|
|
141
144
|
scopeOffset: Binding | undefined;
|
|
142
145
|
}>;
|
|
143
146
|
export declare const collapsedIntersectionSource: WeakMap<Intersection, Binding>;
|
|
144
|
-
export declare function setBindingDownstream(binding: Binding, expr: boolean | Opt<t.NodeExtra
|
|
147
|
+
export declare function setBindingDownstream(binding: Binding, expr: boolean | Opt<t.NodeExtra>, exprs?: KnownExprs): void;
|
|
145
148
|
export declare function createSources(state: Sources["state"], param: Sources["param"], global?: Sources["global"]): Sources;
|
|
146
149
|
export declare function compareSources(a: Sources, b: Sources): number;
|
|
147
150
|
export declare function mergeSources(a: undefined | Sources, b: undefined | Sources): Sources | undefined;
|
|
@@ -191,3 +194,9 @@ export declare function isRegisteredFnExtra(extra: t.NodeExtra | undefined): ext
|
|
|
191
194
|
export declare function getCanonicalExtra<T extends t.NodeExtra>(extra: T): T;
|
|
192
195
|
export declare function getAllSerializeReasonsForExtra(extra: t.NodeExtra): undefined | SerializeReason;
|
|
193
196
|
export declare function getAllSerializeReasonsForBinding(binding: Binding, properties?: Opt<string> | true): undefined | SerializeReason;
|
|
197
|
+
export interface KnownExprs {
|
|
198
|
+
known?: Record<string, KnownExprs>;
|
|
199
|
+
value?: t.NodeExtra;
|
|
200
|
+
}
|
|
201
|
+
export declare function mapParamReasonToExpr(exprs: KnownExprs, reason: boolean | Opt<InputBinding | ParamBinding>): true | Many<t.NodeExtra> | t.NodeExtra | undefined;
|
|
202
|
+
export declare function mapParamBindingToExpr(exprs: KnownExprs, binding: InputBinding | ParamBinding): Opt<t.NodeExtra>;
|
|
@@ -5,7 +5,7 @@ import * as ContentType from "./constants/content-type";
|
|
|
5
5
|
import type * as Step from "./constants/step";
|
|
6
6
|
import * as StructureKind from "./constants/structure-kind";
|
|
7
7
|
import { type Opt, Sorted } from "./optional";
|
|
8
|
-
import { type Binding, type InputBinding, type ParamBinding, type ReferencedBindings, type Sources } from "./references";
|
|
8
|
+
import { type Binding, type InputBinding, type KnownExprs, type ParamBinding, type ReferencedBindings, type Sources } from "./references";
|
|
9
9
|
import { type SerializeReason } from "./serialize-reasons";
|
|
10
10
|
export interface ParamSerializeReasonGroup {
|
|
11
11
|
id: symbol;
|
|
@@ -50,6 +50,7 @@ export interface Section {
|
|
|
50
50
|
loc: t.SourceLocation | undefined;
|
|
51
51
|
depth: number;
|
|
52
52
|
parent: Section | undefined;
|
|
53
|
+
program: Section;
|
|
53
54
|
sectionAccessor: {
|
|
54
55
|
binding: Binding;
|
|
55
56
|
prefix: AccessorPrefix;
|
|
@@ -71,6 +72,7 @@ export interface Section {
|
|
|
71
72
|
downstreamBinding: {
|
|
72
73
|
binding: Binding;
|
|
73
74
|
properties: Opt<string>;
|
|
75
|
+
exprs: KnownExprs | undefined;
|
|
74
76
|
} | false | undefined;
|
|
75
77
|
hasAbortSignal: boolean;
|
|
76
78
|
/** Count of distinct `$signal` expression roots; analyze allocates each
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import { AccessorPrefix, AccessorProp } from "../../common/types";
|
|
3
3
|
import { type Opt } from "./optional";
|
|
4
|
-
import { type Binding, type ReferencedBindings, type Sources } from "./references";
|
|
4
|
+
import { type Binding, type KnownExprs, type ReferencedBindings, type Sources } from "./references";
|
|
5
5
|
import type { Section } from "./sections";
|
|
6
6
|
export type SerializeReasons = true | [Sources, ...Sources[]];
|
|
7
7
|
export type SerializeReason = true | Sources;
|
|
@@ -19,6 +19,8 @@ export declare function getSerializeReason(section: Section, prop?: Binding | Ac
|
|
|
19
19
|
export declare function getSerializeSourcesForExpr(expr: t.NodeExtra): Sources | undefined;
|
|
20
20
|
export declare function getSerializeSourcesForExprs(exprs: Opt<t.NodeExtra> | boolean): true | Sources | undefined;
|
|
21
21
|
export declare function getSerializeSourcesForRef(ref: ReferencedBindings): Sources | undefined;
|
|
22
|
+
export declare function mapCrossProgramReason(program: Section, reason: Sources, exprs: KnownExprs | undefined): SerializeReason | undefined;
|
|
23
|
+
export declare function mapDownstreamReason(program: Section, reason: Sources, exprs: KnownExprs): SerializeReason | undefined;
|
|
22
24
|
export declare function mergeSerializeReasons(a: SerializeReason, b: undefined | SerializeReason): SerializeReason;
|
|
23
25
|
export declare function mergeSerializeReasons(a: undefined | SerializeReason, b: SerializeReason): SerializeReason;
|
|
24
26
|
export declare function mergeSerializeReasons(a: undefined | SerializeReason, b: undefined | SerializeReason): SerializeReason | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import type { Binding } from "./references";
|
|
2
|
+
import type { Binding, KnownExprs } from "./references";
|
|
3
3
|
import { type Section } from "./sections";
|
|
4
|
-
export declare function setTagDownstream(tag: t.NodePath<t.MarkoTag>, binding: undefined | Binding): void;
|
|
4
|
+
export declare function setTagDownstream(tag: t.NodePath<t.MarkoTag>, binding: undefined | Binding, exprs?: KnownExprs): void;
|
|
5
5
|
export declare function finalizeTagDownstreams(section: Section): void;
|
|
@@ -4,12 +4,15 @@ import * as TagNameType from "./constants/tag-name-type";
|
|
|
4
4
|
declare module "@marko/compiler/dist/types" {
|
|
5
5
|
interface ProgramExtra {
|
|
6
6
|
featureType?: "class" | "tags";
|
|
7
|
+
/** Set by the Class API translator when Tags content resumes below here. */
|
|
8
|
+
hydratesTags?: boolean;
|
|
7
9
|
}
|
|
8
10
|
interface MarkoTagExtra {
|
|
9
11
|
tagNameType?: TagNameType;
|
|
10
12
|
tagNameNullable?: boolean;
|
|
11
13
|
tagNameDynamic?: boolean;
|
|
12
14
|
tagNameImported?: string;
|
|
15
|
+
tagNameUnresolved?: boolean;
|
|
13
16
|
tagNameLoad?: LoadImportConfig;
|
|
14
17
|
featureType?: ProgramExtra["featureType"];
|
|
15
18
|
}
|
|
@@ -2,6 +2,10 @@ import { types as t } from "@marko/compiler";
|
|
|
2
2
|
import type { LoadTrigger } from "../../html/assets";
|
|
3
3
|
import { type ResolvedExport } from "./function";
|
|
4
4
|
declare module "@marko/compiler/dist/types" {
|
|
5
|
+
interface ProgramExtra {
|
|
6
|
+
/** Absolute filenames of templates this one imports with `load`. */
|
|
7
|
+
loadImports?: Set<string>;
|
|
8
|
+
}
|
|
5
9
|
interface NodeExtra {
|
|
6
10
|
tagImport?: string;
|
|
7
11
|
loadImport?: LoadImportConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.45",
|
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@marko/compiler": "^5.42.
|
|
54
|
+
"@marko/compiler": "^5.42.3",
|
|
55
55
|
"csstype": "^3.2.3",
|
|
56
56
|
"fastest-levenshtein": "^1.0.16",
|
|
57
57
|
"magic-string": "^0.30.21"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"
|
|
61
|
-
"marko": "
|
|
60
|
+
"marko": "5.39.37",
|
|
61
|
+
"@marko/runtime-tags": "npm:marko@6.3.45"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22"
|