marko 6.4.5 → 6.4.7
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 +2 -1
- package/dist/common/errors.d.ts +3 -1
- package/dist/common/helpers.d.ts +7 -7
- package/dist/debug/dom/catch.feat.js +4 -4
- package/dist/debug/dom/catch.feat.mjs +4 -4
- 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 +5 -5
- package/dist/debug/dom/controllable.feat.mjs +5 -5
- 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 +2 -2
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +2 -2
- package/dist/debug/dom/lazy.feat.js +1 -1
- package/dist/debug/dom/lazy.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-BeY1nGUb.mjs → dom-CFCBDift.mjs} +133 -135
- package/dist/debug/{dom-CUxvM4i9.js → dom-D8znnhpf.js} +148 -150
- package/dist/debug/dom.js +21 -22
- package/dist/debug/dom.mjs +22 -22
- package/dist/debug/html.js +736 -664
- package/dist/debug/html.mjs +736 -665
- package/dist/dom/catch.feat.js +5 -5
- package/dist/dom/catch.feat.mjs +4 -4
- package/dist/dom/control-flow.d.ts +3 -3
- package/dist/dom/controllable-input.feat.js +2 -2
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +2 -2
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +2 -2
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +2 -2
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.d.ts +4 -4
- package/dist/dom/controllable.feat.js +2 -2
- package/dist/dom/controllable.feat.mjs +2 -2
- package/dist/dom/dom.d.ts +5 -5
- package/dist/dom/dynamic-tag-script.feat.js +2 -2
- package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +3 -3
- package/dist/dom/dynamic-tag-var.feat.mjs +2 -2
- package/dist/dom/lazy.feat.js +1 -1
- package/dist/dom/lazy.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +2 -2
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/renderer.d.ts +1 -3
- package/dist/dom/resume.d.ts +2 -3
- package/dist/dom/signals.d.ts +6 -8
- package/dist/{dom-Diu8MpmL.js → dom-Bpkm72vV.js} +157 -166
- package/dist/{dom-DefWmvQB.mjs → dom-CVAevsbz.mjs} +103 -107
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +37 -37
- package/dist/dom.mjs +22 -22
- package/dist/html/assets.d.ts +2 -2
- package/dist/html/compat.d.ts +2 -1
- package/dist/html/control-flow.d.ts +20 -0
- package/dist/html/inlined-runtimes.d.ts +2 -2
- package/dist/html/inlined-runtimes.debug.d.ts +2 -2
- package/dist/html/serializer.d.ts +63 -16
- package/dist/html/template.d.ts +1 -1
- package/dist/html/writer.d.ts +47 -35
- package/dist/html.d.ts +3 -2
- package/dist/html.js +531 -484
- package/dist/html.mjs +531 -484
- package/dist/translator/core/for.d.ts +0 -4
- package/dist/translator/core/return.d.ts +0 -3
- package/dist/translator/core/style.d.ts +2 -2
- package/dist/translator/index.js +8093 -8021
- package/dist/translator/util/analyze-errors.d.ts +2 -1
- package/dist/translator/util/assert.d.ts +15 -1
- package/dist/translator/util/bindings.d.ts +24 -12
- package/dist/translator/util/body-to-text.d.ts +9 -0
- package/dist/translator/util/branch-tag.d.ts +10 -3
- package/dist/translator/util/build-string-expression.d.ts +4 -0
- package/dist/translator/util/content-derives.d.ts +7 -0
- package/dist/translator/util/cyclic-memo.d.ts +6 -2
- package/dist/translator/util/entry-builder.d.ts +6 -3
- package/dist/translator/util/finalize-references.d.ts +6 -3
- package/dist/translator/util/for-selector.d.ts +1 -1
- package/dist/translator/util/generate-uid.d.ts +4 -2
- package/dist/translator/util/get-root.d.ts +3 -3
- package/dist/translator/util/get-tag-name.d.ts +1 -1
- package/dist/translator/util/known-tag.d.ts +14 -9
- package/dist/translator/util/module-read.d.ts +0 -3
- package/dist/translator/util/module-registrations.d.ts +44 -0
- package/dist/translator/util/nested-attribute-tags.d.ts +1 -1
- package/dist/translator/util/optional.d.ts +7 -2
- package/dist/translator/util/params-tree.d.ts +18 -0
- package/dist/translator/util/reasons.d.ts +13 -8
- package/dist/translator/util/references.d.ts +23 -27
- package/dist/translator/util/runtime.d.ts +0 -12
- package/dist/translator/util/scope-accessor.d.ts +0 -1
- package/dist/translator/util/scope-read.d.ts +3 -0
- package/dist/translator/util/section-renderer.d.ts +4 -0
- package/dist/translator/util/sections.d.ts +21 -21
- package/dist/translator/util/setup-work.d.ts +2 -1
- package/dist/translator/util/signals.d.ts +16 -14
- package/dist/translator/util/simplify-fn.d.ts +1 -0
- package/dist/translator/util/slots.d.ts +4 -4
- package/dist/translator/util/solve-reasons.d.ts +1 -3
- package/dist/translator/util/sources.d.ts +2 -1
- package/dist/translator/util/state.d.ts +4 -2
- package/dist/translator/util/statement-tag.d.ts +2 -0
- package/dist/translator/util/static-text.d.ts +2 -1
- package/dist/translator/util/structure.d.ts +0 -10
- package/dist/translator/util/tag-facts.d.ts +8 -1
- package/dist/translator/util/tag-import.d.ts +20 -0
- package/dist/translator/util/tag-name-type.d.ts +9 -2
- package/dist/translator/util/to-only-or-block.d.ts +3 -0
- package/dist/translator/util/to-property-name.d.ts +2 -0
- package/dist/translator/util/translate-attrs.d.ts +7 -5
- package/dist/translator/util/translate-var.d.ts +2 -0
- package/dist/translator/util/traverse.d.ts +1 -2
- package/dist/translator/util/visitors.d.ts +4 -1
- package/dist/translator/util/with-previous-location.d.ts +1 -1
- package/dist/translator/util/write-guard.d.ts +2 -2
- package/dist/translator/util/writer.d.ts +1 -2
- package/dist/translator/visitors/export-declaration.d.ts +2 -3
- package/dist/translator/visitors/function.d.ts +0 -35
- package/dist/translator/visitors/import-declaration.d.ts +1 -15
- package/dist/translator/visitors/placeholder.d.ts +2 -1
- package/dist/translator/visitors/program/html.d.ts +0 -1
- package/dist/translator/visitors/program/index.d.ts +4 -5
- package/dist/translator/visitors/program/pre-analyze.d.ts +2 -0
- package/dist/translator/visitors/tag/custom-tag.d.ts +0 -14
- package/dist/translator/visitors/tag/dynamic-tag.d.ts +1 -0
- package/dist/translator/visitors/tag/native-tag.d.ts +3 -12
- package/package.json +4 -4
- package/dist/translator/util/binding-has-prop.d.ts +0 -8
- package/dist/translator/util/binding-prop-tree.d.ts +0 -18
- package/dist/translator/util/body-to-text-literal.d.ts +0 -9
- package/dist/translator/util/import-reference.d.ts +0 -3
- package/dist/translator/util/normalize-string-expression.d.ts +0 -4
- package/dist/translator/util/plugin-hooks.d.ts +0 -4
- package/dist/translator/util/resolve-relative-to-entry.d.ts +0 -2
- package/dist/translator/util/set-tag-derived-from.d.ts +0 -7
- package/dist/translator/util/to-first-expression-or-block.d.ts +0 -2
- package/dist/translator/util/to-first-statement-or-block.d.ts +0 -2
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type BindingPropTree } from "../../util/binding-prop-tree";
|
|
3
2
|
import { type Binding } from "../../util/bindings";
|
|
3
|
+
import { type ParamsTree } from "../../util/params-tree";
|
|
4
4
|
import { preAnalyze } from "./pre-analyze";
|
|
5
|
-
export declare let scopeIdentifier: t.Identifier;
|
|
6
|
-
export declare let localsIdentifier: t.Identifier;
|
|
7
5
|
declare module "@marko/compiler/dist/types" {
|
|
8
6
|
interface ProgramExtra {
|
|
9
7
|
/** Client code reads something of its own after resume (a section, or a
|
|
@@ -11,7 +9,7 @@ declare module "@marko/compiler/dist/types" {
|
|
|
11
9
|
hasResumes?: boolean;
|
|
12
10
|
/** What the template reads of its params (its input is the first), the
|
|
13
11
|
* contract its callers keep. */
|
|
14
|
-
paramsTree?:
|
|
12
|
+
paramsTree?: ParamsTree;
|
|
15
13
|
/** The names every compile of the template exports its parts under. */
|
|
16
14
|
exportNames?: {
|
|
17
15
|
template: string;
|
|
@@ -20,7 +18,8 @@ declare module "@marko/compiler/dist/types" {
|
|
|
20
18
|
/** The signal of each of the template's param bindings, a property of
|
|
21
19
|
* one included. */
|
|
22
20
|
params: Map<Binding, string>;
|
|
23
|
-
/**
|
|
21
|
+
/** The `_dynamic_tag_content` signal of each binding only a name-only
|
|
22
|
+
* dynamic tag reads. */
|
|
24
23
|
directContent: Map<Binding, string>;
|
|
25
24
|
};
|
|
26
25
|
styleFile?: string;
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Binding } from "../../util/bindings";
|
|
3
|
-
declare const kLoadTagBinding: unique symbol;
|
|
4
|
-
declare module "@marko/compiler/dist/types" {
|
|
5
|
-
interface MarkoTagExtra {
|
|
6
|
-
[kLoadTagBinding]?: Binding;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
2
|
declare const _default: {
|
|
10
3
|
analyze: {
|
|
11
4
|
enter(this: unknown, tag: t.NodePath<t.MarkoTag>): void;
|
|
@@ -16,10 +9,3 @@ declare const _default: {
|
|
|
16
9
|
};
|
|
17
10
|
};
|
|
18
11
|
export default _default;
|
|
19
|
-
export declare function getTagRelativePath(tag: t.NodePath<t.MarkoTag>): string;
|
|
20
|
-
/**
|
|
21
|
-
* A known wrong tag that resolves to nothing, eg `interface P { id: number }`,
|
|
22
|
-
* whose body lands in attribute position before tag resolution would run.
|
|
23
|
-
*/
|
|
24
|
-
export declare function isUnresolvedKnownWrongTag(tag: t.NodePath<t.MarkoTag>): boolean;
|
|
25
|
-
export declare function tagNotFoundError(tag: t.NodePath<t.MarkoTag>): Error;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import { type Section } from "../../util/sections";
|
|
3
3
|
import * as ClassHydration from "./constants/class-hydration";
|
|
4
|
+
export declare const needsCompat: () => boolean, setNeedsCompat: (value: boolean) => void;
|
|
4
5
|
type ClassHydration = ClassHydration.Value;
|
|
5
6
|
declare module "@marko/compiler" {
|
|
6
7
|
interface MarkoMeta {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type DOMRuntimeFeature } from "../../util/runtime";
|
|
3
2
|
import { type StructureNode } from "../../util/sections";
|
|
4
3
|
declare const kNodeOp: unique symbol;
|
|
5
4
|
declare const kNativeAttrs: unique symbol;
|
|
@@ -20,12 +19,12 @@ interface NativeAttrs {
|
|
|
20
19
|
controllable: Controllable | undefined;
|
|
21
20
|
/** Attributes written as one object with the spreads, in write order. */
|
|
22
21
|
spread: number[] | undefined;
|
|
23
|
-
/**
|
|
24
|
-
|
|
22
|
+
/** Writes the page's nonce on a `<script>` or `<style>` that sets none itself. */
|
|
23
|
+
injectsNonce: boolean;
|
|
25
24
|
}
|
|
26
25
|
interface Controllable {
|
|
27
26
|
state: "checked" | "checkedValue" | "value" | "open";
|
|
28
|
-
|
|
27
|
+
stateIsAttr: boolean;
|
|
29
28
|
valueMode?: "attribute" | "dynamic";
|
|
30
29
|
attrs: (number | undefined)[];
|
|
31
30
|
}
|
|
@@ -40,11 +39,3 @@ declare const _default: {
|
|
|
40
39
|
};
|
|
41
40
|
};
|
|
42
41
|
export default _default;
|
|
43
|
-
/** How a spread claims its controlled attrs during render; nothing for the many
|
|
44
|
-
* tags that control nothing, and nothing when a static attr owns the
|
|
45
|
-
* controllable, since then the spread must leave the slots it wrote alone. */
|
|
46
|
-
export declare function controllableClaimFor(tagName: string | undefined): "_controllable_input" | "_controllable_open" | "_controllable_select" | "_controllable_textarea" | undefined;
|
|
47
|
-
/** The resume-pass feature for a tag: `_attrs_script` resolves the control
|
|
48
|
-
* kind at run time, and a run-time tag name can be any of them. */
|
|
49
|
-
export declare function controllableFeatureFor(tagName: string | undefined): "controllable" | "controllable-input" | "controllable-open" | "controllable-select" | "controllable-textarea" | undefined;
|
|
50
|
-
export declare function enableControllable(feature: DOMRuntimeFeature | undefined): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.7",
|
|
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.13",
|
|
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
|
-
"@marko/runtime-tags": "npm:marko@6.4.
|
|
61
|
-
"marko": "5.39.
|
|
60
|
+
"@marko/runtime-tags": "npm:marko@6.4.7",
|
|
61
|
+
"marko": "5.39.47"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22"
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { types as t } from "@marko/compiler";
|
|
2
|
-
import { type Binding } from "./bindings";
|
|
3
|
-
import { type Opt } from "./optional";
|
|
4
|
-
import type { Section } from "./sections";
|
|
5
|
-
export declare function getSectionRendererIdentifier(section: Section): t.Identifier | undefined;
|
|
6
|
-
export declare function isSectionRendererElided(section: Section): boolean;
|
|
7
|
-
export declare function bindingHasProperty(binding: Binding, properties: Opt<string>): boolean;
|
|
8
|
-
export declare function getPropertyPathAlias(binding: Binding, properties: Opt<string>): Binding;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type Binding } from "./bindings";
|
|
2
|
-
export type BindingPropTree = {
|
|
3
|
-
binding: Binding;
|
|
4
|
-
props: {
|
|
5
|
-
[prop: string]: BindingPropTree;
|
|
6
|
-
} | undefined;
|
|
7
|
-
rest: BindingPropTree | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare module "@marko/compiler/dist/types" {
|
|
10
|
-
interface NodeExtra {
|
|
11
|
-
directContent?: true;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export declare function getBindingPropTree(binding: Binding, bodyAnalyzed?: boolean): BindingPropTree;
|
|
15
|
-
export declare function getSettledPropTree(propTree: BindingPropTree | undefined): BindingPropTree | undefined;
|
|
16
|
-
export declare function getKnownFromPropTree(propTree: BindingPropTree | true, name: string): BindingPropTree | true | undefined;
|
|
17
|
-
export declare function getAllKnownPropNames(propTree: BindingPropTree): string[];
|
|
18
|
-
export declare function hasAllKnownProps(propTree: BindingPropTree): boolean | undefined;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { types as t } from "@marko/compiler";
|
|
2
|
-
declare module "@marko/compiler/dist/types" {
|
|
3
|
-
interface MarkoPlaceholderExtra {
|
|
4
|
-
rawText?: true;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
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;
|
|
8
|
-
export declare function bodyToRawTextLiteral(body: t.MarkoTagBody): 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;
|
|
9
|
-
export declare function injectTextCoercion(expr: t.Expression): void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { types as t } from "@marko/compiler";
|
|
2
|
-
export default function normalizeStringExpression(parts: (string | t.Expression)[], useIife?: boolean): t.Expression | undefined;
|
|
3
|
-
export declare function appendLiteral(arr: unknown[], str: string): void;
|
|
4
|
-
export declare function escapeTemplateRaw(raw: string): string;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { types as t } from "@marko/compiler";
|
|
2
|
-
import type { Plugin } from "@marko/compiler/babel-utils";
|
|
3
|
-
export declare function enter<T extends t.Node>(modulePlugin: Plugin | void, path: t.NodePath<T>): boolean;
|
|
4
|
-
export declare function exit<T extends t.Node>(modulePlugin: Plugin | void, path: t.NodePath<T>): boolean;
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|