Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix portal children ordering #4573

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Fix portal children ordering #4573

merged 1 commit into from
Nov 26, 2024

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Nov 26, 2024

Fixes #4572

Technically appendChild isn't needed anymore as our diffing algorithm only uses insertBefore - also facepalm at this bug 😅

Copy link

github-actions bot commented Nov 26, 2024

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -0% - +1% (-1.27ms - +6.79ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -3% - +1% (-0.58ms - +0.14ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +3% (-1.07ms - +1.95ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -1% - +4% (-0.19ms - +0.63ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-0.78ms - +0.37ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -1% - +7% (-0.02ms - +0.15ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -2% - +1% (-0.53ms - +0.26ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -4% - +2% (-1.34ms - +0.72ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +2% (-0.01ms - +0.03ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -6% - +1% (-0.78ms - +0.20ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.02ms - +0.01ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-0.02ms - +0.02ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -1% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -1% - +0% (-0.02ms - +0.02ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local944.82ms - 950.77ms-unsure 🔍
-0% - +1%
-1.27ms - +6.79ms
preact-main942.32ms - 947.76msunsure 🔍
-1% - +0%
-6.79ms - +1.27ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local24.84ms - 24.84ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main24.84ms - 24.84msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.55ms - 16.66ms-unsure 🔍
-3% - +1%
-0.58ms - +0.14ms
preact-main16.47ms - 17.18msunsure 🔍
-1% - +3%
-0.14ms - +0.58ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.66ms - 1.69ms-unsure 🔍
-1% - +2%
-0.01ms - +0.03ms
preact-main1.65ms - 1.67msunsure 🔍
-2% - +1%
-0.03ms - +0.01ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local74.57ms - 76.92ms-unsure 🔍
-1% - +3%
-1.07ms - +1.95ms
preact-main74.35ms - 76.25msunsure 🔍
-3% - +1%
-1.95ms - +1.07ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local12.95ms - 13.66ms-unsure 🔍
-6% - +1%
-0.78ms - +0.20ms
preact-main13.26ms - 13.93msunsure 🔍
-2% - +6%
-0.20ms - +0.78ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local15.46ms - 16.00ms-unsure 🔍
-1% - +4%
-0.19ms - +0.63ms
preact-main15.21ms - 15.81msunsure 🔍
-4% - +1%
-0.63ms - +0.19ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local4.50ms - 4.51ms-unsure 🔍
-0% - +0%
-0.02ms - +0.01ms
preact-main4.50ms - 4.52msunsure 🔍
-0% - +0%
-0.01ms - +0.02ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #4093
  • Commit: 25f1ff5

duration

VersionAvg timevs preact-localvs preact-main
preact-local65.73ms - 66.33ms-unsure 🔍
-1% - +1%
-0.78ms - +0.37ms
preact-main65.74ms - 66.72msunsure 🔍
-1% - +1%
-0.37ms - +0.78ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.58ms - 3.60ms-unsure 🔍
-1% - +1%
-0.02ms - +0.02ms
preact-main3.58ms - 3.61msunsure 🔍
-1% - +1%
-0.02ms - +0.02ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local29.97ms - 30.49ms-unsure 🔍
-2% - +0%
-0.65ms - +0.14ms
preact-main30.18ms - 30.78msunsure 🔍
-0% - +2%
-0.14ms - +0.65ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local34.46ms - 35.80ms-unsure 🔍
-4% - +1%
-1.60ms - +0.30ms
preact-main35.10ms - 36.45msunsure 🔍
-1% - +5%
-0.30ms - +1.60ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local29.34ms - 30.24ms-unsure 🔍
-2% - +3%
-0.63ms - +0.75ms
preact-main29.21ms - 30.26msunsure 🔍
-3% - +2%
-0.75ms - +0.63ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local22.27ms - 22.64ms-unsure 🔍
-1% - +2%
-0.20ms - +0.39ms
preact-main22.13ms - 22.59msunsure 🔍
-2% - +1%
-0.39ms - +0.20ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local20.84ms - 21.05ms-unsure 🔍
-1% - +1%
-0.14ms - +0.18ms
preact-main20.80ms - 21.04msunsure 🔍
-1% - +1%
-0.18ms - +0.14ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local20.00ms - 20.53ms-unsure 🔍
-2% - +2%
-0.35ms - +0.43ms
preact-main19.95ms - 20.51msunsure 🔍
-2% - +2%
-0.43ms - +0.35ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 220
  • Built by: CI #4093
  • Commit: 25f1ff5

duration

VersionAvg timevs preact-localvs preact-main
preact-local2.09ms - 2.22ms-unsure 🔍
-1% - +7%
-0.02ms - +0.15ms
preact-main2.04ms - 2.15msunsure 🔍
-7% - +1%
-0.15ms - +0.02ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.10ms - 1.11ms-unsure 🔍
-1% - +0%
-0.01ms - +0.00ms
preact-main1.11ms - 1.11msunsure 🔍
-0% - +1%
-0.00ms - +0.01ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local33.82ms - 34.19ms-unsure 🔍
-2% - +1%
-0.53ms - +0.26ms
preact-main33.80ms - 34.49msunsure 🔍
-1% - +2%
-0.26ms - +0.53ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.22ms - 1.22ms-unsure 🔍
-1% - +0%
-0.01ms - +0.00ms
preact-main1.22ms - 1.23msunsure 🔍
-0% - +1%
-0.00ms - +0.01ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local35.30ms - 36.56ms-unsure 🔍
-4% - +2%
-1.34ms - +0.72ms
preact-main35.43ms - 37.06msunsure 🔍
-2% - +4%
-0.72ms - +1.34ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.47ms - 3.49ms-unsure 🔍
-1% - +0%
-0.02ms - +0.02ms
preact-main3.47ms - 3.50msunsure 🔍
-0% - +1%
-0.02ms - +0.02ms
-

tachometer-reporter-action v2 for CI

Copy link

Size Change: +14 B (+0.02%)

Total Size: 62.5 kB

Filename Size Change
compat/dist/compat.js 4.13 kB +5 B (+0.12%)
compat/dist/compat.module.js 4.06 kB +4 B (+0.1%)
compat/dist/compat.umd.js 4.2 kB +5 B (+0.12%)
ℹ️ View Unchanged
Filename Size
debug/dist/debug.js 3.82 kB
debug/dist/debug.module.js 3.83 kB
debug/dist/debug.umd.js 3.9 kB
devtools/dist/devtools.js 260 B
devtools/dist/devtools.module.js 274 B
devtools/dist/devtools.umd.js 346 B
dist/preact.js 4.74 kB
dist/preact.min.js 4.75 kB
dist/preact.min.module.js 4.76 kB
dist/preact.min.umd.js 4.78 kB
dist/preact.module.js 4.76 kB
dist/preact.umd.js 4.79 kB
hooks/dist/hooks.js 1.52 kB
hooks/dist/hooks.module.js 1.56 kB
hooks/dist/hooks.umd.js 1.6 kB
jsx-runtime/dist/jsxRuntime.js 973 B
jsx-runtime/dist/jsxRuntime.module.js 947 B
jsx-runtime/dist/jsxRuntime.umd.js 1.05 kB
test-utils/dist/testUtils.js 451 B
test-utils/dist/testUtils.module.js 456 B
test-utils/dist/testUtils.umd.js 536 B

compressed-size-action

@coveralls
Copy link

Coverage Status

coverage: 99.616% (+0.1%) from 99.488%
when pulling 25f1ff5 on fix-portal-children
into bd14437 on main.

Copy link
Member

@rschristian rschristian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha! How have none of use spotted that?

@JoviDeCroock JoviDeCroock merged commit b66c0ae into main Nov 26, 2024
15 checks passed
@JoviDeCroock JoviDeCroock deleted the fix-portal-children branch November 26, 2024 09:50
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.

createPortal renders children out of order when state updates asynchronously
3 participants