The Wire · Showcase
REACT FRAGMENT FIXES LAND ACROSS THE STACK
By RepoJournal · Filed · About Meta
jackpope shipped four critical Fragment corrections to React that fix event dispatch, document positioning, and nested traversal bugs that would break production apps using createRoot(document).
React's Fragment implementation got a thorough fix-up overnight. The big one: createRoot(document) now works when fragments have event listeners [2]. The problem was brutal - dispatchEvent tried appending a Text node to the document, which violates DOM hierarchy rules and threw HierarchyRequestError. The fix swaps in a Comment node instead, "a legal document child and sits at the fragment's own position, unlike documentElement" [2]. Three companion patches landed: one consolidates FragmentInstance helpers into a module [1], another fixes compareDocumentPosition for documentElement and empty portals [3], and a fourth addresses a critical traversal bug where "compareDocumentPosition fiber traversal would stop searching after an empty Fragment fiber," which also breaks scrollIntoView [4].
React Native 0.87.0 shipped to stable [6] with consolidated release notes [5]. The team also dropped deprecated RCT_EXPORT_METHOD macros from RCTSampleTurboModule [7] and cleaned up dead wiki links [8], plus fixed a floating-point guard in flex shrink calculations [9].
Jest fixed a Node 26 compatibility issue where lazy globals were being eagerly resolved during environment setup, causing spurious deprecation warnings for modules like punycode [10]. Two follow-up fixes landed: one stops false warnings about conflicting globalsCleanup modes [11], and test assertions now handle nightly Node versions [12].
One email a day. Unsubscribe in one click.
Keep up with Meta in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → If you use createRoot(document) with Fragment event listeners, upgrade React immediately facebook/react [immediate]
- → Update to React Native 0.87.0 to shed deprecated TurboModule macros before next major release facebook/react-native [plan]
- → Upgrade Jest if Node 26 tests are failing with spurious deprecation warnings facebook/jest [plan]
References
- [1] [Fiber] Extract Fragment instance commit helpers into their own module ↗ facebook/react
- [2] [DOM] Fix Fragment dispatchEvent when the container is a Document ↗ facebook/react
- [3] [DOM] Fix Fragment compareDocumentPosition for documentElement and empty portals ↗ facebook/react
- [4] [DOM] Find host siblings for nested empty Fragments ↗ facebook/react
- [5] Consolidate v0.87.0-RC changelog entries into a single v0.87.0 section (#57901) facebook/react-native
- [6] 0.87.0 ↗ facebook/react-native
- [7] Drop RCT_EXPORT_METHOD/RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD from RCTSampleTurboModule (#57903) facebook/react-native
- [8] Drop outdated links to wiki (#57898) facebook/react-native
- [9] guard shrink-factor division against floating-point near-zero (#57175) facebook/react-native
- [10] fix: stop resolving lazy globals when setting up an environment ↗ facebook/jest
- [11] fix: only warn about a conflicting `globalsCleanup` mode when one was set ↗ facebook/jest
- [12] chore: handle nightly Node version in test assertion ↗ facebook/jest