Releases: jpudysz/react-native-unistyles
Release 2.5.4
Release 2.5.3
Release 2.5.2
2.5.2 (2024-04-02)
Features
Android devices with a notch (cutout) could receive two initial events regarding the insets. This occurred because currentActivity was null when Unistyles was calculating insets for UnistylesRuntime. This update should resolve the issue 💪
- mark platform extension for insets as lateinit to help reducing number of events (d68b6a5)
Release 2.5.1
2.5.1 (2024-03-27)
Features
Unistyles ❤️ bridgeless, and I can confirm that it will work with React Native 0.74 out of the box. Just keep in mind that Bridgeless + 0.73 may not be supported, as the React Native Core team included a lot of improvements during the RC phase.
- add new arch + bridgeless example (0399493)
Bug fixes
- add support for array-based fontVariants (f85af90)
Release 2.5.0
Features
- Added library mocks for seamless test integrations with Jest and other testing frameworks. feat: add library mocks
- Introduced new documentation on testing Documentation page
- The
createStyleSheetfunction now automatically injectsruntimeas a second argument. feat: add a secondarylayoutargument increateStyleSheetby justblender
const stylesheet = createStyleSheet((theme, runtime) => ({
// Use runtime from arguments instead of importing from react-native-unistyles
}));Fixes
- Fixed an issue causing errors about duplicate plugins to be thrown while hot-reloading in development mode. [chore: stop throwing errors for duplicated plugins in dev mode PR
Release 2.5.0-rc.0
Release 2.4.0
2.4.0 (2024-02-27)
Introducing the new version of Unistyles, and this one is significant!
Thank you for your patience, as it took me some time to complete it.
Built-in Safe Area Insets
This feature enables you to use insets values without the need for the react-native-safe-area-context package and passing any value to your stylesheet. Unistyles will automatically update your stylesheets with fresh values straight from C++!
You can access the new API with UnistylesRuntime:
const stylesheet = createStyleSheet(theme => ({
header: {
// will always be up-to-date
paddingTop: UnistylesRuntime.insets.top
}
}));Insets expose 4 values: top, bottom, left, and right.
Status Bar and Navigation Bar
You can now also access some metadata about the status bar and navigation bar. Unistyles exposes their dimensions. They will always be up to date, and you can use them directly in the stylesheet with UnistylesRuntime:
UnistylesRuntime.statusBar.height // or width
UnistylesRuntime.navigationBar.width // or heightContent Size Category Improvements
The content size category is a user preference used to adjust the text size in your app. This feature is especially useful for users with visual impairments or limited vision. I've introduced new accessibility values for iOS: accessibilityMedium, accessibilityLarge, accessibilityExtraLarge, accessibilityExtraExtraLarge, accessibilityExtraExtraExtraLarge
Android has also received new values for very large fonts: extraHuge, extraExtraHuge.
You can access the Content Size Category with UnistylesRuntime:
UnistylesRuntime.contentSizeCategoryRedesigned Android Architecture
You can expect fewer re-renders and better performance. Unistyles is now smarter and can distinguish what has changed and emit only necessary events. This was not supported from the beginning, as Android has no dedicated events for orientation, dark mode, and content size category changes.
x64 Builds for Windows
Version 2.3.0 brought you support for react-native-windows. I was creating a bridge on my macOS computer with Parallels. I missed some configurations, and Unistyles wouldn’t compile on Windows computers. It’s now fixed, and you can develop cross-platform apps on your personal PC.
Fix for Rare Android Crash on Some Devices
That was tough to spot, as it happened rarely, but due to a race condition, Android reported some events faster than Unistyles was able to initialize. You can now enjoy a new bug-free version!
Docs Improvements
You can explore a new section about Dimensions and read some new guides. I marked the new content with a NEW badge.
Release 2.4.0-rc.2
2.4.0-rc.2 (2024-02-27)
Bug Fixes
- issue with not reporting fresh insets on cpp layer (1b4e04c)