Skip to content

Allow rendering in document#4564

Merged
JoviDeCroock merged 3 commits intomainfrom
allow-rendering-in-doc
Nov 24, 2024
Merged

Allow rendering in document#4564
JoviDeCroock merged 3 commits intomainfrom
allow-rendering-in-doc

Conversation

@JoviDeCroock
Copy link
Member

Resolves #3794

When we want to render straight into document we have to alias it to .documentElement as this is used in Remix we could consider supporting it, or moving it to compat.

@github-actions
Copy link

github-actions bot commented Nov 22, 2024

Size Change: +101 B (+0.16%)

Total Size: 62.5 kB

Filename Size Change
dist/preact.js 4.74 kB +17 B (+0.36%)
dist/preact.min.js 4.75 kB +17 B (+0.36%)
dist/preact.min.module.js 4.76 kB +19 B (+0.4%)
dist/preact.min.umd.js 4.78 kB +16 B (+0.34%)
dist/preact.module.js 4.76 kB +15 B (+0.32%)
dist/preact.umd.js 4.79 kB +17 B (+0.36%)
ℹ️ View Unchanged
Filename Size
compat/dist/compat.js 4.13 kB
compat/dist/compat.module.js 4.06 kB
compat/dist/compat.umd.js 4.19 kB
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
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

@github-actions
Copy link

github-actions bot commented Nov 22, 2024

📊 Tachometer Benchmark Results

Summary

⏳ Benchmarks are currently running. Results below are out of date.

duration

  • create10k: unsure 🔍 -0% - +1% (-4.49ms - +5.40ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.02ms - +0.07ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +2% (-0.86ms - +1.43ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -2% - +6% (-0.39ms - +1.03ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-1.03ms - +0.85ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -2% - +7% (-0.03ms - +0.15ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +0% (-0.44ms - +0.10ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -5% - +2% (-1.67ms - +0.76ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +1% (-0.01ms - +0.02ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -5% - +3% (-0.65ms - +0.45ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.01ms - +0.02ms)
    preact-local vs preact-main
  • replace1k: slower ❌ 0% - 1% (0.01ms - 0.04ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -0% - +1% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +1% (-0.01ms - +0.01ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -1% - +0% (-0.03ms - +0.00ms)
    preact-local vs preact-main

Results

⏳ Benchmarks are currently running. Results below are out of date.
create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local942.16ms - 951.31ms-unsure 🔍
-0% - +1%
-4.49ms - +5.40ms
preact-main944.40ms - 948.15msunsure 🔍
-1% - +0%
-5.40ms - +4.49ms
-

usedJSHeapSize

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

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.56ms - 16.60ms-unsure 🔍
-0% - +0%
-0.02ms - +0.07ms
preact-main16.52ms - 16.60msunsure 🔍
-0% - +0%
-0.07ms - +0.02ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.65ms - 1.68ms-unsure 🔍
-0% - +1%
-0.01ms - +0.02ms
preact-main1.65ms - 1.66msunsure 🔍
-1% - +0%
-0.02ms - +0.01ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local73.06ms - 75.06ms-unsure 🔍
-1% - +2%
-0.86ms - +1.43ms
preact-main73.22ms - 74.33msunsure 🔍
-2% - +1%
-1.43ms - +0.86ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local13.48ms - 14.28ms-unsure 🔍
-5% - +3%
-0.65ms - +0.45ms
preact-main13.60ms - 14.36msunsure 🔍
-3% - +5%
-0.45ms - +0.65ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.52ms - 17.40ms-unsure 🔍
-2% - +6%
-0.39ms - +1.03ms
preact-main16.09ms - 17.20msunsure 🔍
-6% - +2%
-1.03ms - +0.39ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local4.50ms - 4.52ms-unsure 🔍
-0% - +0%
-0.01ms - +0.02ms
preact-main4.50ms - 4.51msunsure 🔍
-0% - +0%
-0.02ms - +0.01ms
-
replace1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local71.75ms - 72.96ms-unsure 🔍
-1% - +1%
-1.03ms - +0.85ms
preact-main71.73ms - 73.17msunsure 🔍
-1% - +1%
-0.85ms - +1.03ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.56ms - 3.59ms-slower ❌
0% - 1%
0.01ms - 0.04ms
preact-main3.54ms - 3.56msfaster ✔
0% - 1%
0.01ms - 0.04ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local31.69ms - 32.47ms-unsure 🔍
-1% - +3%
-0.28ms - +0.85ms
preact-main31.38ms - 32.20msunsure 🔍
-3% - +1%
-0.85ms - +0.28ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local37.70ms - 39.05ms-unsure 🔍
-2% - +3%
-0.96ms - +1.02ms
preact-main37.62ms - 39.07msunsure 🔍
-3% - +2%
-1.02ms - +0.96ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local31.46ms - 32.62ms-unsure 🔍
-2% - +3%
-0.61ms - +0.91ms
preact-main31.40ms - 32.38msunsure 🔍
-3% - +2%
-0.91ms - +0.61ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local23.80ms - 24.31ms-unsure 🔍
-3% - +0%
-0.70ms - +0.02ms
preact-main24.14ms - 24.65msunsure 🔍
-0% - +3%
-0.02ms - +0.70ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local22.89ms - 23.21ms-unsure 🔍
-1% - +1%
-0.31ms - +0.22ms
preact-main22.89ms - 23.31msunsure 🔍
-1% - +1%
-0.22ms - +0.31ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local21.17ms - 21.81ms-unsure 🔍
-2% - +2%
-0.40ms - +0.53ms
preact-main21.09ms - 21.76msunsure 🔍
-2% - +2%
-0.53ms - +0.40ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 220
  • Built by: CI #4067
  • Commit: e833b97

duration

VersionAvg timevs preact-localvs preact-main
preact-local2.11ms - 2.24ms-unsure 🔍
-2% - +7%
-0.03ms - +0.15ms
preact-main2.05ms - 2.18msunsure 🔍
-7% - +2%
-0.15ms - +0.03ms
-

usedJSHeapSize

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

duration

VersionAvg timevs preact-localvs preact-main
preact-local33.58ms - 33.80ms-unsure 🔍
-1% - +0%
-0.44ms - +0.10ms
preact-main33.61ms - 34.10msunsure 🔍
-0% - +1%
-0.10ms - +0.44ms
-

usedJSHeapSize

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

duration

VersionAvg timevs preact-localvs preact-main
preact-local33.28ms - 34.74ms-unsure 🔍
-5% - +2%
-1.67ms - +0.76ms
preact-main33.49ms - 35.44msunsure 🔍
-2% - +5%
-0.76ms - +1.67ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.47ms - 3.49ms-unsure 🔍
-1% - +0%
-0.03ms - +0.00ms
preact-main3.48ms - 3.51msunsure 🔍
-0% - +1%
-0.00ms - +0.03ms
-

tachometer-reporter-action v2 for CI

@coveralls
Copy link

coveralls commented Nov 22, 2024

Coverage Status

coverage: 99.488%. remained the same
when pulling c08c63e on allow-rendering-in-doc
into 5b6c3a5 on main.

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

LGTM, lets add a test if possible

@JoviDeCroock
Copy link
Member Author

@marvinhagemeister Yes, sorry was a bit quick here was stuck on the test as I needed to change something in the tests first

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.

I don't suppose Remix is willing to switch to using document.documentElement? Seems a bit odd to use plain document.

@JoviDeCroock JoviDeCroock force-pushed the allow-rendering-in-doc branch from 3aba943 to e833b97 Compare November 23, 2024 08:23
@JoviDeCroock JoviDeCroock merged commit 269cdd8 into main Nov 24, 2024
@JoviDeCroock JoviDeCroock deleted the allow-rendering-in-doc branch November 24, 2024 08:17
upupming added a commit to upupming/preact that referenced this pull request Dec 24, 2025
upupming added a commit to upupming/preact that referenced this pull request Jan 4, 2026
upupming added a commit to upupming/preact that referenced this pull request Jan 4, 2026
upupming added a commit to upupming/preact that referenced this pull request Mar 2, 2026
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.

Uncaught DOMException when having <!DOCTYPE html> and setting the parentDom to document when rendering

4 participants