Concurrent Mode Polyfills — requestIdleCallback, rAF-Batching, document.currentScript #33
Labels
No labels
bug
docs
feature
housekeeping
html-spec
performance
react-compat
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
glow-all/true-headless-browser#33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
React 18+ Concurrent Mode braucht einige Browser-APIs die Happy DOM nicht oder nur teilweise bereitstellt:
1. requestIdleCallback fehlt
React Scheduler nutzt
requestIdleCallbackfür Low-Priority-Work. Ohne fällt React auf setTimeout(fn,0) zurück → kein Concurrent Mode.2. rAF-Batching
requestAnimationFrameexistiert in Happy DOM, aber React erwartet korrekte Reihenfolge relativ zu Microtasks.3. document.currentScript
Manche Bundler prüfen
document.currentScript→ undefined → Crash.4. structuredClone
React 19 nutzt
structuredClonefür Deep-Copy. Bun hat das nativ, muss nur injiziert werden.Lösung: Minimal-Polyfills in src/fakes/concurrent-polyfills.ts
requestIdleCallback
document.currentScript (in script-loader.ts)
structuredClone
Akzeptanzkriterien
Betroffene Dateien
src/fakes/concurrent-polyfills.tssrc/runtime-isolation.tssrc/js/script-loader.tstests/unit/concurrent-polyfills.test.tsCross-Referenzen