Skip to content

feat: Warn on deeply nested illegal HTML structures in debug - #5358

Merged
rschristian merged 2 commits into
mainfrom
feat/deeply-nested-debug-warnings
Nov 12, 2026
Merged

rschristian merged 2 commits into
mainfrom
feat/deeply-nested-debug-warnings

Conversation

@rschristian

@rschristian rschristian commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Ran into this at work, someone accidentally had a <button>, a whole lotta layers, and then another <button>. preact/debug wasn't throwing an console errors as we were only looking at direct children. CC @maybebot

Recursively looking at children like this always feels a bit iffy, but most anchors, buttons, and paragraphs should be incredibly shallow trees, so it shouldn't' be problematic I don't think.

+ a drive-by swap from our "illegal child" regex to a set. Easier to read, should perform better? Happy to revert, it's obvs not related. Just caught my eye.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -2% - +1% (-10.71ms - +4.74ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +1% (-0.05ms - +0.14ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -2% - +2% (-0.95ms - +0.87ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -3% - +1% (-0.50ms - +0.25ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-0.85ms - +0.53ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -3% - +7% (-0.04ms - +0.09ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +2% (-0.25ms - +0.72ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -1% - +6% (-0.14ms - +1.64ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: faster ✔ 1% - 10% (0.04ms - 0.56ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -5% - +1% (-0.05ms - +0.01ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local689.68ms - 696.52ms-unsure 🔍
-2% - +1%
-10.71ms - +4.74ms
preact-main689.16ms - 703.01msunsure 🔍
-1% - +2%
-4.74ms - +10.71ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local19.24ms - 19.24ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main19.24ms - 19.24msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.53ms - 16.71ms-unsure 🔍
-0% - +1%
-0.05ms - +0.14ms
preact-main16.55ms - 16.61msunsure 🔍
-1% - +0%
-0.14ms - +0.05ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.56ms - 1.56ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.56ms - 1.56msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #6188
  • Commit: 1740d1d

duration

VersionAvg timevs preact-localvs preact-main
preact-local44.97ms - 46.03ms-unsure 🔍
-2% - +2%
-0.95ms - +0.87ms
preact-main44.81ms - 46.27msunsure 🔍
-2% - +2%
-0.87ms - +0.95ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local5.09ms - 5.34ms-faster ✔
1% - 10%
0.04ms - 0.56ms
preact-main5.29ms - 5.74msslower ❌
1% - 11%
0.04ms - 0.56ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local17.11ms - 17.71ms-unsure 🔍
-3% - +1%
-0.50ms - +0.25ms
preact-main17.31ms - 17.75msunsure 🔍
-1% - +3%
-0.25ms - +0.50ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.74ms - 3.75ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.74ms - 3.75msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #6188
  • Commit: 1740d1d

duration

VersionAvg timevs preact-localvs preact-main
preact-local76.63ms - 77.38ms-unsure 🔍
-1% - +1%
-0.85ms - +0.53ms
preact-main76.59ms - 77.75msunsure 🔍
-1% - +1%
-0.53ms - +0.85ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.03ms - 3.04ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
preact-main3.03ms - 3.04msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local27.60ms - 28.43ms-unsure 🔍
-1% - +3%
-0.24ms - +0.90ms
preact-main27.29ms - 28.09msunsure 🔍
-3% - +1%
-0.90ms - +0.24ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local30.31ms - 31.64ms-unsure 🔍
-3% - +3%
-0.99ms - +0.85ms
preact-main30.42ms - 31.68msunsure 🔍
-3% - +3%
-0.85ms - +0.99ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local31.25ms - 32.70ms-unsure 🔍
-5% - +1%
-1.66ms - +0.38ms
preact-main31.89ms - 33.34msunsure 🔍
-1% - +5%
-0.38ms - +1.66ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local33.20ms - 34.08ms-unsure 🔍
-1% - +3%
-0.37ms - +0.84ms
preact-main32.99ms - 33.82msunsure 🔍
-2% - +1%
-0.84ms - +0.37ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local25.75ms - 26.52ms-unsure 🔍
-2% - +2%
-0.62ms - +0.51ms
preact-main25.77ms - 26.60msunsure 🔍
-2% - +2%
-0.51ms - +0.62ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local22.26ms - 22.66ms-unsure 🔍
-1% - +2%
-0.30ms - +0.39ms
preact-main22.14ms - 22.69msunsure 🔍
-2% - +1%
-0.39ms - +0.30ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 240
  • Built by: CI #6188
  • Commit: 1740d1d

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.32ms - 1.43ms-unsure 🔍
-3% - +7%
-0.04ms - +0.09ms
preact-main1.31ms - 1.39msunsure 🔍
-7% - +3%
-0.09ms - +0.04ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.03ms - 1.07ms-unsure 🔍
-5% - +1%
-0.05ms - +0.01ms
preact-main1.05ms - 1.10msunsure 🔍
-1% - +5%
-0.01ms - +0.05ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local32.48ms - 33.40ms-unsure 🔍
-1% - +2%
-0.25ms - +0.72ms
preact-main32.55ms - 32.86msunsure 🔍
-2% - +1%
-0.72ms - +0.25ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.28ms - 1.28ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.28ms - 1.28msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
update10th1k
  • Browser: chrome-headless
  • Sample size: 140
  • Built by: CI #6188
  • Commit: 1740d1d

duration

VersionAvg timevs preact-localvs preact-main
preact-local29.04ms - 30.40ms-unsure 🔍
-1% - +6%
-0.14ms - +1.64ms
preact-main28.39ms - 29.55msunsure 🔍
-5% - +0%
-1.64ms - +0.14ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.99ms - 3.00ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-main2.99ms - 3.00msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-

tachometer-reporter-action v2 for CI

@rschristian
rschristian marked this pull request as draft November 12, 2026 03:50
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Size Change: +10 B (+0.06%)

Total Size: 16.3 kB

📦 View Changed
Filename Size Change
debug/dist/debug.mjs 4.19 kB +10 B (+0.24%)
ℹ️ View Unchanged
Filename Size
compat/dist/compat.mjs 3.97 kB
devtools/dist/devtools.mjs 268 B
dist/preact.mjs 4.98 kB
hooks/dist/hooks.mjs 1.58 kB
jsx-runtime/dist/jsxRuntime.mjs 875 B
test-utils/dist/testUtils.mjs 472 B

compressed-size-action

@coveralls

coveralls commented Nov 12, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 99.858%. remained the same — feat/deeply-nested-debug-warnings into main

@rschristian
rschristian marked this pull request as ready for review November 12, 2026 03:53
@rschristian
rschristian merged commit 18d8bf7 into main Nov 12, 2026
13 checks passed
@rschristian
rschristian deleted the feat/deeply-nested-debug-warnings branch November 12, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants