babel-plugin-jsx-dom-expressions 0.40.6 → 0.40.7

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 (3) hide show
  1. package/README.md +9 -0
  2. package/index.js +2 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -175,6 +175,15 @@ Removes tags from the template output if they have no closing parents and are th
175
175
 
176
176
  Removes quotes for html attributes when possible from the template output. This may not work in all browser-like environments the same. The solution has been tested again Chrome/Edge/Firefox/Safari.
177
177
 
178
+ ### omitAttributeSpacing
179
+
180
+ - Type: `boolean`
181
+ - Default: `true`
182
+
183
+ When `true` (the default), the template output drops the whitespace between a quoted attribute and the next attribute (`<svg width="12"height="13">`). This mirrors the prior behavior and relies on the browser's HTML parser to tolerate the missing space. Some strict parsers (notably XML/SVG-only or game-engine browser-likes such as Coherent Gameface) reject the resulting markup.
184
+
185
+ Set this to `false` to emit a single space between attributes (`<svg width="12" height="13">`) so the generated HTML is strictly valid. This may also be desirable together with `omitQuotes: false` / `omitLastClosingTag: false` when targeting stricter parsers.
186
+
178
187
  ### requireImportSource
179
188
 
180
189
  - Type: `string | false`
package/index.js CHANGED
@@ -1477,7 +1477,7 @@ function transformAttributes$2(path, results) {
1477
1477
  }
1478
1478
 
1479
1479
  if (needsQuoting) {
1480
- needsSpacing = false;
1480
+ needsSpacing = !config.omitAttributeSpacing;
1481
1481
  results.template += `="${escapeHTML(text, true)}"`;
1482
1482
  } else {
1483
1483
  needsSpacing = true;
@@ -4308,6 +4308,7 @@ var config = {
4308
4308
  omitNestedClosingTags: false,
4309
4309
  omitLastClosingTag: true,
4310
4310
  omitQuotes: true,
4311
+ omitAttributeSpacing: true,
4311
4312
  contextToCustomElements: false,
4312
4313
  staticMarker: "@once",
4313
4314
  effectWrapper: "effect",
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.40.6",
4
+ "version": "0.40.7",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -33,5 +33,5 @@
33
33
  "@rollup/plugin-babel": "6.0.3",
34
34
  "@types/babel__core": "^7.20.5"
35
35
  },
36
- "gitHead": "4f1ff795b280004134c0c3e16dec1dc0c9148141"
36
+ "gitHead": "3c01eb2ac61b193d4164319befe3f1b2634549cb"
37
37
  }