babel-plugin-jsx-dom-expressions 0.34.7 → 0.34.9
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 -3
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -288,7 +288,7 @@ function isDynamic(path, { checkMember, checkTags, checkCallExpressions = true,
|
|
|
288
288
|
return false;
|
|
289
289
|
}
|
|
290
290
|
if (
|
|
291
|
-
(checkCallExpressions && t__namespace.isCallExpression(expr)) ||
|
|
291
|
+
(checkCallExpressions && (t__namespace.isCallExpression(expr) || t__namespace.isOptionalCallExpression(expr))) ||
|
|
292
292
|
(checkMember &&
|
|
293
293
|
(t__namespace.isMemberExpression(expr) ||
|
|
294
294
|
t__namespace.isOptionalMemberExpression(expr) ||
|
|
@@ -309,6 +309,9 @@ function isDynamic(path, { checkMember, checkTags, checkCallExpressions = true,
|
|
|
309
309
|
CallExpression(p) {
|
|
310
310
|
checkCallExpressions && (dynamic = true) && p.stop();
|
|
311
311
|
},
|
|
312
|
+
OptionalCallExpression(p) {
|
|
313
|
+
checkCallExpressions && (dynamic = true) && p.stop();
|
|
314
|
+
},
|
|
312
315
|
MemberExpression(p) {
|
|
313
316
|
checkMember && (dynamic = true) && p.stop();
|
|
314
317
|
},
|
|
@@ -2014,7 +2017,7 @@ function createElement(path, { topLevel, hydratable }) {
|
|
|
2014
2017
|
if (attributes.length === 1) {
|
|
2015
2018
|
transformed = attributes[0].node.argument;
|
|
2016
2019
|
} else {
|
|
2017
|
-
transformed = t__namespace.objectExpression(
|
|
2020
|
+
transformed = t__namespace.arrowFunctionExpression([], t__namespace.objectExpression(
|
|
2018
2021
|
attributes.reduce((memo, attribute) => {
|
|
2019
2022
|
const node = attribute.node;
|
|
2020
2023
|
|
|
@@ -2058,7 +2061,7 @@ function createElement(path, { topLevel, hydratable }) {
|
|
|
2058
2061
|
}
|
|
2059
2062
|
return memo;
|
|
2060
2063
|
}, [])
|
|
2061
|
-
);
|
|
2064
|
+
));
|
|
2062
2065
|
}
|
|
2063
2066
|
|
|
2064
2067
|
const exprs = [
|
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.34.
|
|
4
|
+
"version": "0.34.9",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@babel/core": "^7.0.0"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "8221452594c2eb2d3d593b07759c05047dba17fa"
|
|
31
31
|
}
|