developit / htm

Hyperscript Tagged Markup: JSX alternative using standard tagged templates, with compiler support.
Apache License 2.0
8.64k stars 169 forks source link

Ignore JS-style comments during parse #214

Open marvinhagemeister opened 2 years ago

marvinhagemeister commented 2 years ago

This PR enhances htm's parser to detect and ignore JS-style comments, similar to JSX.

// Multi line
html`<div
    /* I'm ignored */
    id="foo" />`

// Single line
html`<div
  // I'm ignored
  id="foo" />`

Fixes #213

github-actions[bot] commented 2 years ago

Size Change: +248 B (+3%)

Total Size: 8.38 kB

Filename Size Change
./dist/htm.js 729 B +51 B (+8%) 🔍
./dist/htm.mjs 696 B +50 B (+8%) 🔍
./mini/index.js 577 B +49 B (+9%) 🔍
./mini/index.mjs 533 B +50 B (+10%) ⚠ī¸
./preact/standalone.mjs 5.35 kB +48 B (+1%)
ℹī¸ View Unchanged | Filename | Size | | :--- | :---: | | `./preact/index.js` | 145 B | | `./preact/index.mjs` | 117 B | | `./react/index.js` | 128 B | | `./react/index.mjs` | 99 B |

compressed-size-action