mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
fix: autokey all nodes under a static root (#1849)
This commit is contained in:
parent
aff81aba13
commit
26dbb84f90
5
.changeset/swift-rocks-lay.md
Normal file
5
.changeset/swift-rocks-lay.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@marko/translator-default": patch
|
||||
---
|
||||
|
||||
fix: autokey all nodes under a static root
|
||||
@ -29,8 +29,7 @@ const mergeStaticCreateVisitor = {
|
||||
);
|
||||
},
|
||||
MarkoTag(path, state) {
|
||||
if (path.node.attributes.find(a => a.name === "key"))
|
||||
getKeyManager(path).resolveKey(path);
|
||||
getKeyManager(path).resolveKey(path);
|
||||
const writeArgs = tagArguments(path, true);
|
||||
state.currentRoot = t.callExpression(
|
||||
t.memberExpression(state.currentRoot, t.identifier("e")),
|
||||
|
||||
@ -6,7 +6,7 @@ const _marko_componentType = "p0+/pj8a",
|
||||
export default _marko_template;
|
||||
import _marko_createElement from "marko/dist/runtime/vdom/helpers/v-element.js";
|
||||
|
||||
const _marko_node = _marko_createElement("contact-info", null, "0", null, 1, 0).e("name", null, null, null, 1, 0).t("Hello World");
|
||||
const _marko_node = _marko_createElement("contact-info", null, "0", null, 1, 0).e("name", null, "1", null, 1, 0).t("Hello World");
|
||||
|
||||
import _marko_renderer from "marko/dist/runtime/components/renderer.js";
|
||||
import { r as _marko_registerComponent } from "marko/dist/runtime/components/registry";
|
||||
|
||||
@ -6,7 +6,7 @@ const _marko_componentType = "VJrYycFN",
|
||||
export default _marko_template;
|
||||
import _marko_createElement from "marko/dist/runtime/vdom/helpers/v-element.js";
|
||||
|
||||
const _marko_node = _marko_createElement("head", null, "1", null, 1, 0).e("title", null, null, null, 1, 0).t("Title of the document");
|
||||
const _marko_node = _marko_createElement("head", null, "1", null, 1, 0).e("title", null, "2", null, 1, 0).t("Title of the document");
|
||||
|
||||
import _marko_renderer from "marko/dist/runtime/components/renderer.js";
|
||||
import { r as _marko_registerComponent } from "marko/dist/runtime/components/registry";
|
||||
@ -17,7 +17,7 @@ const _marko_component = {};
|
||||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state) {
|
||||
out.be("html", null, "0", _component, null, 0);
|
||||
out.n(_marko_node, _component);
|
||||
out.be("body", null, "2", _component, null, 0);
|
||||
out.be("body", null, "3", _component, null, 0);
|
||||
out.t("The content of the document......", _component);
|
||||
out.ee();
|
||||
out.ee();
|
||||
|
||||
@ -6,9 +6,9 @@ const _marko_componentType = "TRrwGTtp",
|
||||
export default _marko_template;
|
||||
import _marko_createElement from "marko/dist/runtime/vdom/helpers/v-element.js";
|
||||
|
||||
const _marko_node = _marko_createElement("div", null, "0", null, 4, 0).e("div", null, null, null, 3, 0).t("Hello ").e("div", null, null, null, 1, 0).t(" ").t(" World").e("div", null, null, null, 1, 0).t(" Hello").e("pre", null, null, null, 1, 0).t("\n This should \n be preserved\n ").e("div", null, null, null, 1, 0).e("div", null, null, null, 1, 0).t("Hello ");
|
||||
const _marko_node = _marko_createElement("div", null, "0", null, 4, 0).e("div", null, "1", null, 3, 0).t("Hello ").e("div", null, "2", null, 1, 0).t(" ").t(" World").e("div", null, "3", null, 1, 0).t(" Hello").e("pre", null, "4", null, 1, 0).t("\n This should \n be preserved\n ").e("div", null, "5", null, 1, 0).e("div", null, "6", null, 1, 0).t("Hello ");
|
||||
|
||||
const _marko_node2 = _marko_createElement("div", null, "2", null, 0, 0);
|
||||
const _marko_node2 = _marko_createElement("div", null, "8", null, 0, 0);
|
||||
|
||||
import _marko_renderer from "marko/dist/runtime/components/renderer.js";
|
||||
import { r as _marko_registerComponent } from "marko/dist/runtime/components/registry";
|
||||
@ -18,7 +18,7 @@ _marko_registerComponent(_marko_componentType, () => _marko_template);
|
||||
const _marko_component = {};
|
||||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state) {
|
||||
out.n(_marko_node, _component);
|
||||
out.be("div", null, "1", _component, null, 0);
|
||||
out.be("div", null, "7", _component, null, 0);
|
||||
scriptletA();
|
||||
scriptletB();
|
||||
out.t("Hello ", _component);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user