What's Changed
A stability release: theme changes that didn't reach some components, memory leaks on reload and on web, reload crashes, and build fixes for older React Native versions and AGP 9.
๐จ Themes and styles
- Fixed theme updates not applying to some dynamic styles after a re-render (#1267, closes #1192)
- Unistyles commits no longer overwrite what React just rendered, which fixes
updateThemebeing lost when a theme is set on mount and inline props being dropped mid-transition (#1271) - Fixed stale colors on React Native
Animatedviews when the style merges several unistyles (#1273) - Fixed animated variant colors staying stale after a theme change on a frozen screen (#1274)
- Fixed
TouchableHighlightreverting to the previous theme's style after a press (#1279) ActivityIndicatorstyle is now linked with its wrappingView(#1270)useUnistyles,withUnistyles,DisplayandHidereact to orientation changes again, even when no stylesheet depends on them (#1265 by @christianjuth, closes #1254)StyleSheet.absoluteFillObjectstays a spreadable style object across React Native versions (#1237 by @dennytosp, closes #1200)
๐ง Frozen screens
- Unfreezing a screen no longer blocks JS for seconds: suspended nodes are restored without one shadow tree commit per node (closes #1252)
๐ง Memory and reloads
- Fixed a
StyleSheetโUnistylereference cycle that leaked memory on every reload (#1280) - Runtime ownership now uses generation tracking, so a stale runtime can no longer wipe the state of the new one after an OTA or dev reload (#1278, closes #1215 and #1250)
uni__getStylesthrows aJSErrorinstead of crashing when it races registry teardown during reload (#1221 by @safaiyeh, closes #1220)- Web:
PressableandScrollVieware now released from the shadow registry, so CSS rules and detached DOM nodes stop accumulating (#1277, closes #1263)
๐ Build and compatibility
- Fixed the
parseUnprocessedTransformOriginStringbuild error on React Native < 0.85, withtransformOriginstrings still processed on Android there (#1236 by @dennytosp, closes #1226) - Android: the explicit Kotlin plugin is skipped when AGP 9 registers the built-in
kotlinextension (#1246 by @gabrieldonadel) NativeText/NativeViewhost components are resolved without deep imports (#1272)
๐งพ Types
- Readonly arrays are accepted in nested style props such as
boxShadow(#1238 by @dennytosp, closes #1214) - Readonly style arrays stay valid on the output side as well (#1276)
โก Performance
- Faster lookup of unistyles on the link path, recovering the re-render cost added by the merged-style fix (#1275)
๐งช Internal
โค๏ธ Contributors
Thanks to everyone who sent a PR for this release:
And to those whose PRs and reports shaped the fixes:
- @TMaszko (#1218) and @boorad (#1251), whose runtime ownership work led to #1278
- @aleradev12 (#1264), whose web registry fix led to #1277
- @bigcupcoffee, @k-nd, @XChikuX, @shahidrogers, @mtford90, @theonetheycallneo for detailed bug reports
Full Changelog: v3.4.0...v3.5.0