Releases: jpudysz/react-native-unistyles
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
createStyleSheet
function now automatically injectsruntime
as a second argument. feat: add a secondarylayout
argument increateStyleSheet
by 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 height
Content 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.contentSizeCategory
Redesigned 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)
Features
Release 2.4.0-rc.1
Release 2.4.0-rc.0
2.4.0-rc.0 (2024-02-14)
Features
Release 2.3.0
2.3.0 (2024-02-08)
In this release I've brought you support for react-native-windows
!
You can now build truly cross-platform desktop apps with Unistyles
.
Also, there is one more improvement regarding boolean variants. Previously, if you defined only a true
or false
variant, they were converted respectively into a true
or false
string. This could be problematic if your props are of the boolean
type. The error would indicate that the variant is expecting either true
as a boolean or string. In this version, if you use a single true
or false
boolean variant, TypeScript will convert it to a generic boolean
. Types won't be narrowed down to single values anymore.
Features
- add windows support
- add autolonking for windows
- narrow down boolean variants (543e696)
Release 2.3.0-beta.2
2.3.0-beta.2 (2024-02-07)
- add missing windows files to lib output