|
| 1 | +# NativeWind 4.1 |
| 2 | + |
| 3 | +Version 4 of NativeWind, particularly NativeWind 4.1, is officially ready for production. With the release of 4.1, we've expanded upon the major updates from v4.0, focusing on performance improvements, enhanced features, and better developer experience. Give it a shot: |
| 4 | +```bash |
| 5 | +npm install nativewind@latest |
| 6 | +``` |
| 7 | + |
| 8 | +## What's New Since v4.0 |
| 9 | + |
| 10 | +This document highlights the changes and improvements introduced in NativeWind 4.1, compared to v4.0. If you're upgrading from v2 or earlier and want to see the major changes introduced in v4.0, please refer to our [v4 announcement page](./v4-announcement.md). |
| 11 | + |
| 12 | +## What's New in NativeWind 4.1 |
| 13 | + |
| 14 | +- **Consistent Fast Refresh:** Style changes are now consistent across all build types. |
| 15 | +- **Drastically Fast(er) Refresh:** Reduced output size and improved Fast Refresh performance. |
| 16 | +- **Enhanced Animations and Transitions:** More robust and consistent animation and transition support. |
| 17 | +- **tvOS Support:** Styling capabilities for `react-native-tvos` projects. |
| 18 | +- **Media Query Support:** New support for `dpi`/`dpcm`/`dppx` media queries. |
| 19 | +- **Automatically Configured TypeScript Types:** Improved TypeScript integration. |
| 20 | +- **Dot Notation Support:** Enhanced `cssInterop` config targeting. |
| 21 | +- **Parenthesis Support in `calc()` Functions:** Improved calculation capabilities. |
| 22 | +- **Improved Development and Debugging:** Better developer experience for NativeWind contributors. |
| 23 | + |
| 24 | +## Consistent Fast Refresh |
| 25 | + |
| 26 | +NativeWind 4.1 introduces a significant improvement to Fast Refresh consistency: |
| 27 | + |
| 28 | +- Styles are now always written to disk if virtual modules are not possible (e.g., Radon IDE) or when building for production (e.g., expo-updates). |
| 29 | +- This change allows for Fast Refresh on both development and production builds. |
| 30 | + |
| 31 | +## Drastically Fast(er) Refresh |
| 32 | + |
| 33 | +We've made numerous improvements to enhance the development experience: |
| 34 | + |
| 35 | +- Reduced costly Metro transforms while maintaining and improving the development experience. |
| 36 | +- These optimizations result in faster refresh times without compromising functionality. |
| 37 | +- More performance improvements are planned for future releases. |
| 38 | + |
| 39 | +## Enhanced Animations and Transitions |
| 40 | + |
| 41 | +NativeWind 4.1 brings more stability and features to animations and transitions: |
| 42 | + |
| 43 | +- Added robust tests to ensure a consistent and stable experience. |
| 44 | +- Improved compatibility with different React Native versions to prevent unexpected crashes. |
| 45 | +- Expanded animation capabilities, including support for `%` based `transform` and complex animations. |
| 46 | + |
| 47 | +## tvOS Support |
| 48 | + |
| 49 | +NativeWind now extends its styling capabilities to tvOS: |
| 50 | + |
| 51 | +- You can now use NativeWind to style your `react-native-tvos` projects. |
| 52 | +- Use `Platform.isTVOS` to add platform-specific code for tvOS. |
| 53 | + |
| 54 | +## Media Query Support |
| 55 | + |
| 56 | +NativeWind 4.1 introduces new media query capabilities: |
| 57 | + |
| 58 | +- Support for `dpi`, `dpcm`, and `dppx` media queries. |
| 59 | +- While there are no set media queries on mobile devices, you can now define your own based on these units. |
| 60 | +- Future updates aim to include default values for these breakpoints. |
| 61 | + |
| 62 | +## Automatically Configured TypeScript Types |
| 63 | + |
| 64 | +Improved TypeScript integration in NativeWind 4.1: |
| 65 | + |
| 66 | +- The development server now automatically creates and configures NativeWind types. |
| 67 | +- This enhancement streamlines the setup process and improves type checking in NativeWind projects. |
| 68 | + |
| 69 | +## Dot Notation Support |
| 70 | + |
| 71 | +NativeWind 4.1 adds support for dot notation in `cssInterop` config targeting: |
| 72 | + |
| 73 | +- This feature provides more flexibility in how you configure component interoperability. |
| 74 | + |
| 75 | +## Parenthesis Support in `calc()` Functions |
| 76 | + |
| 77 | +Improved calculation capabilities in NativeWind 4.1: |
| 78 | + |
| 79 | +- Support for logical parenthesis in `calc()` functions, e.g., `calc(a - (b + c))`. |
| 80 | + |
| 81 | +## Improved Development and Debugging |
| 82 | + |
| 83 | +NativeWind 4.1 focuses on improving the developer experience for contributors: |
| 84 | + |
| 85 | +- Added more logs and debugging tools to support developers working on NativeWind itself. |
| 86 | +- Included a contribution guide to make it easier for interested developers to contribute to the project. |
| 87 | +- Join the [NativeWind Discord](https://nativewind.dev/discord) to participate in discussions about these changes. |
| 88 | + |
| 89 | +## Contributors |
| 90 | + |
| 91 | +In addition to the work of the core team, NativeWind is the result of the combined work of many individual developers. We want to thank the following developers for their help in making NativeWind 4.1 possible: |
| 92 | + |
| 93 | +- [Mark Lawlor](https://github.com/marklawlor) |
| 94 | +- [Dan Stepanov](https://github.com/danstepanov) |
| 95 | +- [Bradley Ayers](https://github.com/bradleyayers) |
| 96 | +- [John F](https://github.com/johnf) |
| 97 | +- [Doug Lowder](https://github.com/douglowder) |
| 98 | +- [cxa](https://github.com/cxa) |
| 99 | +- [Nishan Bende](https://github.com/intergalacticspacehighway) |
| 100 | +- [Tobias Harth](https://github.com/tobiasharth) |
| 101 | +- [Viraj Joshi](https://github.com/viraj-10) |
| 102 | +- [Jakob Rössner](https://github.com/fleetadmiraljakob) |
| 103 | +- [Himanshu Kumar Dutt](https://github.com/himanshukumardutt094) |
| 104 | +- [Karl Horky](https://github.com/karlhorky) |
| 105 | + |
| 106 | +Your continued support, both in terms of code and community participation, is instrumental to the future of NativeWind. We're incredibly grateful and hope to see even more folks contributing for the next release! |
0 commit comments