Skip to content

Release 4.0.0-rc.1

Pre-release
Pre-release

Choose a tag to compare

@danstepanov danstepanov released this 30 Nov 03:10
5755630

This is the react-native-css 4.0.0-rc.1 release candidate. It targets Expo SDK 58: Expo 58.1.0, React Native 0.88.1, React 19.3.0, Reanimated 4.7.1 and Worklets 0.13.0. It re-exports AssetRegistry from the components shim, which expo-asset and expo-font need on React Native 0.88.

npm install --save-exact react-native-css@4.0.0-rc.1

The rc tag points to this candidate. The stable latest tag stays on 3.0.7. The major version moves to 4 because of the breaking changes below, listed in #588.

Breaking Changes

  • @property variables registered with inherits: false no longer pass to children (#567)
  • Transforms (translate-*, rotate-*, scale-*, skew-*, transform-*) are combined in the order browsers use (#576)
  • py-* and px-* output paddingVertical and paddingHorizontal (#580)
  • placeholder: and selection: no longer depend on className order (#432)
  • Hex colors clip rather than gamut map, matching browsers (#457)
  • --x: initial overrides another rule's or the parent's value, so via-none and *-initial work with variants (#585)
  • Lists read through var() keep their commas (#575)
  • Class, inline and !important styles layer as in browsers, and Pressable callback styles combine with class styles (#578)
  • styled() throws a named error for a non object mapping, and skips an undefined nativeStyleMapping entry (#568, #418)

Features

  • native: honour inherits: false on registered custom properties (#567)
  • native: evaluate prefers-reduced-motion, so motion-reduce and motion-safe work on native (#591)

Bug Fixes

  • compiler: scope single definition variable inlining to the declaring block (#592)
  • native: re-export AssetRegistry from the components shim (#504)
  • native: keep a list's separator when read through variables (#575)
  • native: resolve and cascade transform properties as browsers do (#576)
  • native: keep class, inline and !important styles as layers (#578)
  • compiler: omit absent color-mix weights from serialized descriptors (#579)
  • compiler: compile padding-block and padding-inline to paddingVertical and paddingHorizontal (#580)
  • compiler: land border-x and border-y colors on border keys React Native draws (#581)
  • native: apply className on SafeAreaView from the safe-area-context shim (#468)
  • native: rank an unset specificity slot the same however it is spelled (#432)
  • types: accept an explicit undefined wherever a consumer writes an optional member (#418)
  • native: re-run an effect a batch notifies twice, and release a style entry by identity (#436)
  • native: register color spaces for color-mix and clip out of sRGB colors (#457)
  • native: share reactivity state across a dual package split (#427)
  • let a custom property set to initial override other declarations (#585)
  • type-check color scheme writes on every react-native in the peer range (#586)

Performance

  • key the style cache by a unique hash (#568)
  • return nothing from compiler visitors that only read (#490)

Thanks to @sammoore, @YevheniiKotyrlo, @Wadiou, @kdwkr, @Peek-A-Booo, @NateIsern and @nimbly1 for these changes.

Full changes: 3.1.0-rc.1...5755630