Skip to content

Support recoverable rendering with use(browser()) - #5262

Draft
JoviDeCroock wants to merge 7 commits into
mainfrom
codex/recoverable-use
Draft

JoviDeCroock wants to merge 7 commits into
mainfrom
codex/recoverable-use

Conversation

@JoviDeCroock

@JoviDeCroock JoviDeCroock commented Sep 14, 2026

Copy link
Copy Markdown
Member

Related to #5261

Add browser() and switch recovered Suspense boundaries from hydration to normal rendering.

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -4% - +2% (-21.43ms - +12.11ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +1% (-0.17ms - +0.10ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -3% - +2% (-2.02ms - +1.07ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -4% - +1% (-0.60ms - +0.13ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -5% - +5% (-2.94ms - +3.13ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -9% - +2% (-0.16ms - +0.05ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +2% (-0.43ms - +0.50ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -4% - +5% (-0.96ms - +1.26ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 +0% - +0% (+0.00ms - +0.01ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -5% - +1% (-0.23ms - +0.07ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 +0% - +0% (+0.00ms - +0.01ms)
    preact-local vs preact-main
  • replace1k: slower ❌ 0% - 1% (0.00ms - 0.02ms)
    preact-local vs preact-main
  • text-update: slower ❌ 1% - 8% (0.01ms - 0.08ms)
    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-local531.60ms - 537.48ms-unsure 🔍
-4% - +2%
-21.43ms - +12.11ms
preact-main522.69ms - 555.71msunsure 🔍
-2% - +4%
-12.11ms - +21.43ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local19.08ms - 19.08ms-unsure 🔍
+0% - +0%
+0.00ms - +0.01ms
preact-main19.07ms - 19.07msunsure 🔍
-0% - -0%
-0.01ms - -0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.51ms - 16.66ms-unsure 🔍
-1% - +1%
-0.17ms - +0.10ms
preact-main16.51ms - 16.73msunsure 🔍
-1% - +1%
-0.10ms - +0.17ms
-

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

duration

VersionAvg timevs preact-localvs preact-main
preact-local58.71ms - 60.97ms-unsure 🔍
-3% - +2%
-2.02ms - +1.07ms
preact-main59.26ms - 61.37msunsure 🔍
-2% - +3%
-1.07ms - +2.02ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local5.00ms - 5.16ms-unsure 🔍
-5% - +1%
-0.23ms - +0.07ms
preact-main5.04ms - 5.29msunsure 🔍
-1% - +5%
-0.07ms - +0.23ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.48ms - 16.57ms-unsure 🔍
-4% - +1%
-0.60ms - +0.13ms
preact-main16.40ms - 17.12msunsure 🔍
-1% - +4%
-0.13ms - +0.60ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.75ms - 3.75ms-unsure 🔍
+0% - +0%
+0.00ms - +0.01ms
preact-main3.74ms - 3.75msunsure 🔍
-0% - -0%
-0.01ms - -0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 110
  • Built by: CI #5981
  • Commit: 0c8bd7d

duration

VersionAvg timevs preact-localvs preact-main
preact-local59.43ms - 63.74ms-unsure 🔍
-5% - +5%
-2.94ms - +3.13ms
preact-main59.36ms - 63.63msunsure 🔍
-5% - +5%
-3.13ms - +2.94ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.03ms - 3.05ms-slower ❌
0% - 1%
0.00ms - 0.02ms
preact-main3.02ms - 3.03msfaster ✔
0% - 1%
0.00ms - 0.02ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local21.12ms - 21.84ms-unsure 🔍
-2% - +2%
-0.52ms - +0.45ms
preact-main21.18ms - 21.85msunsure 🔍
-2% - +2%
-0.45ms - +0.52ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local26.18ms - 27.02ms-unsure 🔍
-2% - +2%
-0.63ms - +0.54ms
preact-main26.24ms - 27.05msunsure 🔍
-2% - +2%
-0.54ms - +0.63ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local25.90ms - 26.92ms-unsure 🔍
-3% - +2%
-0.90ms - +0.51ms
preact-main26.12ms - 27.10msunsure 🔍
-2% - +3%
-0.51ms - +0.90ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local23.54ms - 24.23ms-unsure 🔍
-2% - +2%
-0.55ms - +0.42ms
preact-main23.60ms - 24.29msunsure 🔍
-2% - +2%
-0.42ms - +0.55ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local16.65ms - 16.86ms-unsure 🔍
-1% - +1%
-0.12ms - +0.16ms
preact-main16.64ms - 16.82msunsure 🔍
-1% - +1%
-0.16ms - +0.12ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local20.28ms - 21.58ms-unsure 🔍
-4% - +5%
-0.87ms - +0.99ms
preact-main20.21ms - 21.53msunsure 🔍
-5% - +4%
-0.99ms - +0.87ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 220
  • Built by: CI #5981
  • Commit: 0c8bd7d

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.69ms - 1.83ms-unsure 🔍
-9% - +2%
-0.16ms - +0.05ms
preact-main1.74ms - 1.89msunsure 🔍
-3% - +9%
-0.05ms - +0.16ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.06ms - 1.11ms-slower ❌
1% - 8%
0.01ms - 0.08ms
preact-main1.02ms - 1.06msfaster ✔
1% - 7%
0.01ms - 0.08ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local30.00ms - 30.63ms-unsure 🔍
-1% - +2%
-0.43ms - +0.50ms
preact-main29.94ms - 30.62msunsure 🔍
-2% - +1%
-0.50ms - +0.43ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.27ms - 1.28ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main1.27ms - 1.27msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local26.67ms - 28.33ms-unsure 🔍
-4% - +5%
-0.96ms - +1.26ms
preact-main26.61ms - 28.08msunsure 🔍
-5% - +3%
-1.26ms - +0.96ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.97ms - 2.98ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-main2.97ms - 2.97msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-

tachometer-reporter-action v2 for CI

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

Size Change: +143 B (+0.9%)

Total Size: 16.1 kB

📦 View Changed
Filename Size Change
compat/dist/compat.mjs 3.99 kB +68 B (+1.73%)
dist/preact.mjs 5 kB +75 B (+1.52%)
ℹ️ View Unchanged
Filename Size
debug/dist/debug.mjs 3.88 kB
devtools/dist/devtools.mjs 273 B
hooks/dist/hooks.mjs 1.58 kB
jsx-runtime/dist/jsxRuntime.mjs 868 B
test-utils/dist/testUtils.mjs 473 B

compressed-size-action

@coveralls

coveralls commented Sep 14, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 99.856%. remained the same — codex/recoverable-use into main

Comment thread compat/src/render.js Outdated
Comment on lines +37 to +39
get status() {
return options._skipEffects ? 'rejected' : 'fulfilled';
},

@JoviDeCroock JoviDeCroock Sep 14, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
get status() {
return options._skipEffects ? 'rejected' : 'fulfilled';
},
status: IS_DOM,

Comment thread compat/src/render.js Outdated
return {
// oxlint-disable-next-line unicorn/no-thenable -- `use` consumes instrumented thenables.
then(resolve, reject) {
if (options._skipEffects) reject(this.reason);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
if (options._skipEffects) reject(this.reason);
if (IS_DOM) reject(this.reason);

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.

2 participants