Skip to content

Commit

Permalink
fix universal render namespace spreads
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Oct 25, 2023
1 parent 5058650 commit b837724
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function processSpreads(path, attributes, { elem, hasChildren, wrapConditionals
(firstSpread ||
(t.isJSXExpressionContainer(node.value) &&
isDynamic(attribute.get("value").get("expression"), { checkMember: true }))) &&
canNativeSpread(key)
canNativeSpread(key, { checkNameSpaces: true })
) {
const isContainer = t.isJSXExpressionContainer(node.value);
const dynamic =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const _tmpl$ = ['<a href="/" class="', '">Welcome</a>'],
_tmpl$17 = ["<div", ">", "</div>"],
_tmpl$18 = ["<div>", "", "</div>"],
_tmpl$19 =
'<div class="class1 class2 class3 class4 class5 class6" style="color:red;background-color:blue !important;border:1px solid black;font-size:12px;" random="random1 random2\r\n random3 random4"></div>',
_tmpl$20 = '<input readonly="">';
'<div class="class1 class2 class3 class4 class5 class6" style="color:red;background-color:blue !important;border:1px solid black;font-size:12px;" random="random1 random2\r\n random3 random4"></div>';
const selected = true;
let id = "my-h1";
let link;
Expand Down Expand Up @@ -203,4 +202,3 @@ const template28 = _$ssrElement(
);
const template29 = _$ssr(_tmpl$17, _$ssrAttribute("attribute", !!someValue, false), !!someValue);
const template30 = _$ssr(_tmpl$19);
const template31 = _$ssr(_tmpl$20);
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,6 @@ const template18 = (
/>
);

const template19 = <div style={{ a: "static", ...rest }} ></div>
const template19 = <div style={{ a: "static", ...rest }} ></div>

const template20 = <div use:something {...somethingElse} use:zero={0} />;
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,10 @@ const template19 = (() => {
);
return _el$28;
})();
const template20 = (() => {
const _el$29 = _$createElement("div");
_$use(zero, _el$29, () => 0);
_$use(something, _el$29, () => true);
_$spread(_el$29, somethingElse, false);
return _el$29;
})();

0 comments on commit b837724

Please sign in to comment.