babel-plugin-jsx-dom-expressions 0.31.12 → 0.32.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.
Files changed (2) hide show
  1. package/index.js +8 -0
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -551,6 +551,7 @@ function transformElement$2(path, info) {
551
551
 
552
552
  function setAttr$2(path, elem, name, value, { isSVG, dynamic, prevId, isCE }) {
553
553
  // pull out namespace
554
+ const config = getConfig(path);
554
555
  let parts, namespace;
555
556
  if ((parts = name.split(":")) && parts[1] && reservedNameSpaces.has(parts[0])) {
556
557
  name = parts[1];
@@ -595,6 +596,13 @@ function setAttr$2(path, elem, name, value, { isSVG, dynamic, prevId, isCE }) {
595
596
  );
596
597
  }
597
598
 
599
+ if (config.hydratable && name === "innerHTML") {
600
+ return t__namespace.callExpression(
601
+ registerImportMethod(path, "innerHTML"),
602
+ [elem, value]
603
+ );
604
+ }
605
+
598
606
  if (dynamic && name === "textContent") {
599
607
  return t__namespace.assignmentExpression("=", t__namespace.memberExpression(elem, t__namespace.identifier("data")), value);
600
608
  }
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.31.12",
4
+ "version": "0.32.0",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -23,5 +23,5 @@
23
23
  "@babel/types": "^7.16.0",
24
24
  "html-entities": "2.3.2"
25
25
  },
26
- "gitHead": "4145792a40b9529557ee5cc8ddb27a1780394409"
26
+ "gitHead": "6c6759c7f721d1e738b3aead7afb5c3cd0be04fc"
27
27
  }