Skip to content

Commit db9cde8

Browse files
committed
add v4.1 announcement page
1 parent fd5d7f0 commit db9cde8

File tree

6 files changed

+125
-8
lines changed

6 files changed

+125
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ NativeWind processes your styles during your application's build step and uses a
2525

2626
## Installation
2727

28-
If you have an existing project, [use these guides](https://www.nativewind.dev/v4/getting-started/react-native) to configure NativeWind for your respective stack.
28+
If you have an existing project, [use these guides](https://www.nativewind.dev/getting-started/react-native) to configure NativeWind for your respective stack.
2929

3030
Alternatively, you can create a new pre-configured project via our Quickstart options, below.
3131

@@ -61,7 +61,7 @@ You can get started with any of the following options:
6161
- Fast and consistent style application via hot reload
6262
- includes changes made to `tailwind.config.js`
6363

64-
[More details here](https://www.nativewind.dev/v4/announcement#breaking-changes-from-v2)
64+
[More details here](https://www.nativewind.dev/v4-announcement#breaking-changes-from-v2)
6565

6666
## npm distribution tags
6767
It's worth noting that we do not have Github branches that directly correlate to npm distribution tags. Instead, we deploy to specific npm tags either via automated Github actions (push to `main` -> publish to `next`) or manually (snapshots versions).
@@ -118,7 +118,7 @@ From the folks that brought you NativeBase, this library offers customizable cro
118118

119119
## What are the breaking changes from v2 to v4?
120120

121-
All breaking changes are [outlined here](https://www.nativewind.dev/v4/announcement#breaking-changes-from-v2).
121+
All breaking changes are [outlined here](https://www.nativewind.dev/v4-announcement#breaking-changes-from-v2).
122122

123123
## Documentation
124124

File renamed without changes.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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!

apps/website/src/pages/v4/announcement.md renamed to apps/website/docs/v4-announcement.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Additionally, the style compiler has be rewritten using [lightningcss](https://l
164164

165165
### `rem` Support
166166

167-
NativeWind v4 includes scaling support for the `rem` unit. By default NativeWind will inline the `rem` value, replacing `rem` with `px` at build time. This greatly improves performance, but can be disabled if you need to dynamically change the `rem` value at runtime. [More information](https://www.nativewind.dev/v4/tailwind/typography/font-size)
167+
NativeWind v4 includes scaling support for the `rem` unit. By default NativeWind will inline the `rem` value, replacing `rem` with `px` at build time. This greatly improves performance, but can be disabled if you need to dynamically change the `rem` value at runtime. [More information](https://www.nativewind.dev/tailwind/typography/font-size)
168168

169169
```jsx title=metro.config.js
170170
export default withNativeWind(config, {
@@ -291,7 +291,7 @@ const App = () => {
291291
292292
### CSS Specificity
293293
294-
NativeWind has change its specificity algorithm. You can read more about it here: https://www.nativewind.dev/v4/core-concepts/style-specificity
294+
NativeWind has change its specificity algorithm. You can read more about it here: https://www.nativewind.dev/core-concepts/style-specificity
295295
296296
### Base Scaling Modifications
297297
@@ -422,7 +422,7 @@ remapProps(FlatList, {
422422
423423
`remapProps` is a lightweight wrapper which doesn't generate any styles. Instead it converts Tailwind CSS strings to `OpaqueStyleTokens` (readonly empty objects). These tokens should be treat just any other other style object, and once passed to a component tagged with `remapProps`, they will be converted into styles.
424424
425-
(See the documentation for more information)[https://www.nativewind.dev/v4/api/remap-props]
425+
(See the documentation for more information)[https://www.nativewind.dev/api/remap-props]
426426
427427
**`cssInterop(component, mapping)`**
428428
@@ -434,7 +434,7 @@ Before using `cssInterop` you should could consider if `remapProps` would be mor
434434
- Moving a style property to an prop
435435
- Note: If this is not a 3rd party component, you should consider simply using the style prop as this will not work on web.
436436
437-
(See the documentation for more information)[https://www.nativewind.dev/v4/api/css-interop]
437+
(See the documentation for more information)[https://www.nativewind.dev/api/css-interop]
438438
439439
### `vars()`
440440

apps/website/docusaurus.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ const config = {
6666
apiKey: "e179290d52cea5f4751ae76dd1f40b4f",
6767
indexName: "nativewind",
6868
contextualSearch: true,
69+
transformItems: (/** @type {{ url: string; }[]} */ items) => {
70+
return items.map((/** @type {{ url: string; }} */ item) => ({
71+
...item,
72+
url: item.url.replace('/v4/', '/'),
73+
}));
74+
},
6975
},
7076
prism: {
7177
defaultLanguage: "tsx",

apps/website/sidebars.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ const sidebars = {
2323
type: "category",
2424
label: "Overview",
2525
collapsed: false,
26-
items: ["overview/overview", "guides/goals"],
26+
items: [
27+
"overview/overview",
28+
"guides/goals",
29+
"v4-announcement",
30+
"v4-1-announcement"
31+
],
2732
},
2833
{
2934
type: "category",

0 commit comments

Comments
 (0)