babel-plugin-jsx-dom-expressions 0.37.0-beta.2 → 0.37.0
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/index.js +6 -4
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -863,11 +863,10 @@ function setAttr$2(path, elem, name, value, { isSVG, dynamic, prevId, isCE, tagN
|
|
|
863
863
|
);
|
|
864
864
|
}
|
|
865
865
|
|
|
866
|
-
if (config.hydratable && name === "innerHTML") {
|
|
867
|
-
return t__namespace.callExpression(registerImportMethod(path, "innerHTML"), [elem, value]);
|
|
868
|
-
}
|
|
869
|
-
|
|
870
866
|
if (dynamic && name === "textContent") {
|
|
867
|
+
if (config.hydratable) {
|
|
868
|
+
return t__namespace.callExpression(registerImportMethod(path, "setProperty"), [elem, t__namespace.stringLiteral("data"), value]);
|
|
869
|
+
}
|
|
871
870
|
return t__namespace.assignmentExpression("=", t__namespace.memberExpression(elem, t__namespace.identifier("data")), value);
|
|
872
871
|
}
|
|
873
872
|
|
|
@@ -876,6 +875,9 @@ function setAttr$2(path, elem, name, value, { isSVG, dynamic, prevId, isCE, tagN
|
|
|
876
875
|
const alias = getPropAlias(name, tagName.toUpperCase());
|
|
877
876
|
if (namespace !== "attr" && (isChildProp || (!isSVG && isProp) || isCE || namespace === "prop")) {
|
|
878
877
|
if (isCE && !isChildProp && !isProp && namespace !== "prop") name = toPropertyName(name);
|
|
878
|
+
if (config.hydratable && namespace !== "prop") {
|
|
879
|
+
return t__namespace.callExpression(registerImportMethod(path, "setProperty"), [elem, t__namespace.stringLiteral(name), value]);
|
|
880
|
+
}
|
|
879
881
|
return t__namespace.assignmentExpression(
|
|
880
882
|
"=",
|
|
881
883
|
t__namespace.memberExpression(elem, t__namespace.identifier(alias || name)),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-plugin-jsx-dom-expressions",
|
|
3
3
|
"description": "A JSX to DOM plugin that wraps expressions for fine grained change detection",
|
|
4
|
-
"version": "0.37.0
|
|
4
|
+
"version": "0.37.0",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/core": "^7.20.12"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "ab238b9fd00bd8a7e81e5ae9827cb8756c3b55f5"
|
|
35
35
|
}
|