$ the-wire · showcase
React Compiler cuts allocations, Jest reverts moduleNameMapper regression
By RepoJournal · Filed · About Meta
The React Compiler's Rust port shaves memory and allocations while Jest reverts a 30.5.0 moduleNameMapper regression.
The React Compiler's Rust port moves compiled function bodies into the AST instead of cloning them, cutting memory churn by 7.8%, allocations by 4.1%, and wall time by about 4% [1]. It also inlines the tiny alias sets that dominate mutation inference: 97.6% hold one element, so replacing FxHashSet with an inline set storing five values drops heap pressure in all but 0.02% of cases [2]. New workflows now publish the Rust crates to crates.io via trusted publishing [3]. Meanwhile, Jest reverted the moduleNameMapper change from 30.5.0 because expanding `fs` to `['fs', 'node:fs']` before matching let patterns like `^buffer$` capture `node:buffer`, breaking core module mapping [4]. It also fixes a `.each` crash: table keys containing regex metacharacters, like `count(*)`, now get escaped instead of throwing `SyntaxError: Invalid regular expression` [5]. React Native fixes stale VoiceOver values when Text updates asynchronously [6] and reduces MatrixMathHelper allocations during view transforms [7]. One commit notes, "Flatten the normalized matrix and update the temporary rows in place to remove ten allocations per decomposition." [7]
Action items
- → Pin jest to a release after 30.5.0 and before the revert lands, or pull the fix if you hit moduleNameMapper core-module issues facebook/jest [immediate]
- → Check the React Compiler repository for the performance improvements and publishing workflows facebook/react [plan]
- → Watch for the React Native VoiceOver fix in a future release if you use async Text updates on iOS facebook/react-native [monitor]
References
- [1] React Compiler: move compiled function bodies into AST instead of cloning ↗ facebook/react
- [2] React Compiler: Store aliasing values in an inline set ↗ facebook/react
- [3] Add Rust compiler crate publishing workflows ↗ facebook/react
- [4] revert(jest-resolve): match `moduleNameMapper` against the specifier as written ↗ facebook/jest
- [5] fix(jest-each): escape table keys before building the interpolation RegExp ↗ facebook/jest
- [6] fix: stale VoiceOver value from async UI updates to Text (#58169) ↗ facebook/react-native
- [7] Reduce MatrixMathHelper allocations (#58275) ↗ facebook/react-native