Skip to content

Commit 7a9d757

Browse files
cortinicocipolleschiSimek
authored
[RN][Releases] Add Blogpost for 0.79 (facebook#4555)
* [RN][Releases] Add Blogpost for 0.79 * Apply suggestions from code review Co-authored-by: Riccardo Cipolleschi <[email protected]> * Update website/blog/2025-04-08-react-native-0.79.md * Update build-speed.md * Update filename * Fix build * Update url in build-speed * Casepolice * Apply suggestions from code review Co-authored-by: Bartosz Kaszubowski <[email protected]> --------- Co-authored-by: Riccardo Cipolleschi <[email protected]> Co-authored-by: Bartosz Kaszubowski <[email protected]>
1 parent 395db2a commit 7a9d757

File tree

4 files changed

+280
-0
lines changed

4 files changed

+280
-0
lines changed

docs/build-speed.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ This can be problematic as your project grows and generally in bigger organizati
88

99
To mitigate this performance hit, this page shares some suggestions on how to **improve your build time**.
1010

11+
:::info
12+
13+
Please note that those suggestions are advanced feature that requires some amount of understanding of how the native build tools work.
14+
15+
:::
16+
1117
## Build only one ABI during development (Android-only)
1218

1319
When building your android app locally, by default you build all the 4 [Application Binary Interfaces (ABIs)](https://developer.android.com/ndk/guides/abis) : `armeabi-v7a`, `arm64-v8a`, `x86` & `x86_64`.
@@ -50,6 +56,31 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
5056

5157
Once you build a **release version** of your app, don't forget to remove those flags as you want to build an apk/app bundle that works for all the ABIs and not only for the one you're using in your daily development workflow.
5258

59+
## Enable Configuration Caching (Android-only)
60+
61+
Since React Native 0.79, you can also enable Gradle Configuration Caching.
62+
63+
When you’re running an Android build with `yarn android`, you will be executing a Gradle build that is composed by two steps ([source](https://docs.gradle.org/current/userguide/build_lifecycle.html)):
64+
65+
- Configuration phase, when all the `.gradle` files are evaluated.
66+
- Execution phase, when the tasks are actually executed so the Java/Kotlin code is compiled and so on.
67+
68+
You will now be able to enable Configuration Caching, which will allow you to skip the Configuration phase on subsequent builds.
69+
70+
This is beneficial when making frequent changes to the native code as it improves build times.
71+
72+
For example here you can see how rebuilding faster it is to rebuild RN-Tester after a change in the native code:
73+
74+
![gradle config caching](/docs/assets/gradle-config-caching.gif)
75+
76+
You can enable Gradle Configuration Caching by adding the following line in your `android/gradle.properties` file:
77+
78+
```
79+
org.gradle.configuration-cache=true
80+
```
81+
82+
Please refer to the [official Gradle documentation](https://docs.gradle.org/current/userguide/configuration_cache.html) for more resources on Configuration Caching.
83+
5384
## Use a compiler cache
5485

5586
If you're running frequent native builds (either C++ or Objective-C), you might benefit from using a **compiler cache**.
Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
---
2+
title: 'React Native 0.79 - Faster tooling and much more'
3+
authors: [alanjhughes, shubham, fabriziocucci, cortinico]
4+
tags: [engineering]
5+
date: 2025-04-08
6+
---
7+
8+
# React Native 0.79 - Faster tooling, faster startup and much more
9+
10+
Today we are excited to release React Native 0.79!
11+
12+
This release ships with performance improvements on various fronts, as well as several bugfixes. First, Metro is now faster to start thanks to deferred hashing, and has stable support for package exports. Startup time in Android will also be improved thanks to changes in the JS bundle compressions and much more.
13+
14+
### Highlights
15+
16+
- [New Metro Features](/blog/2025/04/08/react-native-0.79#metro-faster-startup-and-package-exports-support)
17+
- [JSC moving to a Community Package](/blog/2025/04/08/react-native-0.79#jsc-moving-to-community-package)
18+
- [iOS: Swift-Compatible Native Modules registration](/blog/2025/04/08/react-native-0.79#ios-swift-compatible-native-modules-registration)
19+
- [Android: Faster App Startup](/blog/2025/04/08/react-native-0.79#android-faster-app-startup)
20+
- [Removal of Remote JS Debugging](/blog/2025/04/08/react-native-0.79#removal-of-remote-js-debugging)
21+
22+
<!--truncate-->
23+
24+
## Highlights
25+
26+
### Metro: Faster startup and package exports support
27+
28+
This release ships with [Metro 0.82](https://github.com/facebook/metro/releases/tag/v0.82.0).This version uses deferred hashing to improve the speed of first `yarn start` typically by over 3x (more in larger projects and monorepos) making your development experience and CI builds faster on a daily basis.
29+
30+
![metro startup comparison](../static/blog/assets/0.79-metro-startup-comparison.gif)
31+
32+
Also in Metro 0.82, we’re promoting `package.json` `exports` and `imports` field resolution to stable. `exports` resolution was [introduced in React Native 0.72](/blog/2023/06/21/package-exports-support), and `imports` support was added in a community contribution - both will now be enabled by default for all the projects on React Native 0.79.
33+
34+
This improves compatibility with modern npm dependencies, and opens up new, standards-compliant ways to organise your projects.
35+
36+
### JSC moving to Community Package
37+
38+
As part of our effort to reduce the API surface of React Native, we're in the process of moving the JavaScriptCore (JSC) engine to a community-maintained package: `@react-native-community/javascriptcore`
39+
40+
This change will not affect users that are using Hermes.
41+
42+
Starting with React Native 0.79, you can use a community supported version of JSC by following the [installation instructions in the readme](https://github.com/react-native-community/javascriptcore#installation). The JSC version provided by React Native core will still be available in 0.79, but we’re planning to remove it [in the near future](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0836-lean-core-jsc.md).
43+
44+
Moving JSC to a community maintained package will allow us to update the JSC version more frequently and offer you the latest features. The community maintained JSC will follow a separate release schedule from React Native.
45+
46+
### iOS: Swift-Compatible Native Modules registration
47+
48+
In this release, we are revamping the way in which you can register your Native Module into the React Native runtime. The new approach follows the same approach of components, described in the [official documentation](/docs/next/the-new-architecture/using-codegen#configuring-codegen).
49+
50+
Starting from this version of React Native, you can register your modules by modifying the `package.json` file. We introduced a new `modulesProvider` field in the `ios` property:
51+
52+
```diff
53+
"codegenConfig": {
54+
"ios": {
55+
+ "modulesProvider": {
56+
+ "JS Name for the module": "ObjC Module provider for the pure C++ TM or a class conforming to RCTTurboModule"
57+
+ }
58+
}
59+
}
60+
```
61+
62+
Codegen will take care to create all the relevant code starting from your `package.json` file.
63+
64+
If you do use a pure C++ Native Module you will have to follow this recommended configuration:
65+
66+
<details>
67+
<summary>Configure pure C++Native Modules in your app</summary>
68+
69+
For pure C++ Native Modules, you need to add a new ObjectiveC++ class to glue together the C++ Native Module with the rest of the App:
70+
71+
```objc title="CppNativeModuleProvider.h"
72+
#import <Foundation/Foundation.h>
73+
#import <ReactCommon/RCTTurboModule.h>
74+
75+
NS_ASSUME_NONNULL_BEGIN
76+
77+
@interface <YourNativeModule>Provider : NSObject <RCTModuleProvider>
78+
79+
@end
80+
```
81+
82+
```objc title="CppNativeModuleProvider.mm"
83+
NS_ASSUME_NONNULL_END
84+
85+
#import "<YourNativeModule>Provider.h"
86+
#import <ReactCommon/CallInvoker.h>
87+
#import <ReactCommon/TurboModule.h>
88+
#import "<YourNativeModule>.h"
89+
90+
@implementation NativeSampleModuleProvider
91+
92+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
93+
(const facebook::react::ObjCTurboModule::InitParams &)params
94+
{
95+
return std::make_shared<facebook::react::NativeSampleModule>(params.jsInvoker);
96+
}
97+
```
98+
99+
</details>
100+
101+
With this new approach, we unified the registration of Native Modules for both app developers and library maintainers. Libraries can specify the same properties in their `package.json` and Codegen will take care of the rest.
102+
103+
This approach solves the limitation we introduced in 0.77 that prevented the registration of a pure C++ Native Module with a Swift `AppDelegate`. As you can see, none of these changes modifies the `AppDelegate` and the generated code will work for `AppDelegate` implemented with both Swift and Objective-C.
104+
105+
### Android: Faster App Startup
106+
107+
We’re also shipping a change to improve your Android startup time by a significant amount.
108+
109+
Starting with this version, we won’t be compressing the JavaScript bundle anymore inside the APK. Previously, the Android system needed to uncompress the JavaScript bundle before your app could start. This was causing a significant slowdown during the app startup.
110+
111+
Starting from this release, we will be shipping the JavaScript Bundle uncompressed by default, so your Android apps will be generally faster to start.
112+
113+
We tested this feature on the Discord app and got a significant performance boost: Discord’s time-to-interactive (TTI) was reduced by 400ms, which was a 12% speedup with a one-line change (tested on a Samsung A14).
114+
115+
On the other hand, storing the bundle uncompressed, will result in a higher space consumption for your application on the user device. If this is a concern to you, you can toggle this behavior using the `enableBundleCompression` property in your `app/build.gradle` file.
116+
117+
```kotlin title="app/build.gradle"
118+
react {
119+
// ...
120+
// If you want to compress the JS bundle (slower startup, less
121+
// space consumption)
122+
enableBundleCompression = true
123+
// If don't you want to compress the JS bundle (faster startup,
124+
// higher space consumption)
125+
enableBundleCompression = false
126+
127+
// Default is `false`
128+
}
129+
```
130+
131+
Please note that the APK size will increase in this release, but your users won’t be paying the extra cost in APK download size, as the APKs are compressed when downloaded from the network.
132+
133+
## Breaking Changes
134+
135+
### Removal of Remote JS Debugging
136+
137+
As part of our ongoing efforts to improve debugging, we're removing Remote JS Debugging via Chrome. This legacy debugging method was deprecated, [and moved to a runtime opt-in, in React Native 0.73](/blog/2023/12/06/0.73-debugging-improvements-stable-symlinks#remote-javascript-debugging). Please use [React Native DevTools](/docs/react-native-devtools) for modern and reliable debugging.
138+
139+
This also means that React Native is no longer compatible with the [react-native-debugger](https://github.com/jhen0409/react-native-debugger) community project. For developers that want to use third party debugging extensions, such as Redux DevTools, we recommend [Expo DevTools Plugins](https://github.com/expo/dev-plugins), or integrating the standalone versions of these tools.
140+
141+
Read more in [this dedicated post](https://github.com/react-native-community/discussions-and-proposals/discussions/872).
142+
143+
### Internal modules updated to `export` syntax
144+
145+
As part of modernizing our JavaScript codebase, we've updated a number of implementation modules within `react-native` to consistently use `export` syntax instead of `module.exports`.
146+
147+
We've updated around **46 APIs** in total, which can be found in the [changelog](https://github.com/facebook/react-native/blob/main/CHANGELOG.md#v0790).
148+
149+
This change has a subtle impact on existing imports:
150+
151+
<details>
152+
<summary>**Case 1: Default export**</summary>
153+
154+
```diff
155+
// CHANGED - require() syntax
156+
- const ImageBackground = require('react-native/Libraries/Image/ImageBackground');
157+
+ const ImageBackground = require('react-native/Libraries/Image/ImageBackground').default;
158+
159+
// Unchanged - import syntax
160+
import ImageBackground from 'react-native/Libraries/Image/ImageBackground';
161+
162+
// RECOMMENDED - root import
163+
import {ImageBackground} from 'react-native';
164+
165+
````
166+
167+
</details>
168+
169+
<details>
170+
171+
<summary>**Case 2: Secondary exports**</summary>
172+
173+
There are very few cases of this pattern, again unaffected when using the root `'react-native'` import.
174+
175+
```diff
176+
// Unchanged - require() syntax
177+
const BlobRegistry = require('react-native/Libraries/Blob/BlobRegistry');
178+
179+
// Unchanged - require() syntax with destructuring
180+
const {register, unregister} = require('react-native/Libraries/Blob/BlobRegistry');
181+
182+
// CHANGED - import syntax as single object
183+
- import BlobRegistry from 'react-native/Libraries/Blob/BlobRegistry';
184+
+ import * as BlobRegistry from 'react-native/Libraries/Blob/BlobRegistry';
185+
186+
187+
// Unchanged - import syntax with destructuring
188+
import {register, unregister} from 'react-native/Libraries/Blob/BlobRegistry';
189+
190+
// RECOMMENDED - root import
191+
import {BlobRegistry} from 'react-native';
192+
````
193+
194+
</details>
195+
196+
We expect the impact of this change to be extremely limited, particularly for projects written in TypeScript and using `import` syntax. Please check for any type errors to update your code.
197+
198+
:::tip
199+
200+
**The root `react-native` import is strongly recommended**
201+
202+
As a general takeaway, we strongly recommend importing from the root `'react-native'` path, to avoid extraneous breaking changes in the future. In our next release, we will be deprecating deep imports, as part of better defining React Native's public JavaScript API ([see the RFC](https://github.com/react-native-community/discussions-and-proposals/pull/894)).
203+
204+
:::
205+
206+
### Other Breaking Changes
207+
208+
This list contains a series of other breaking changes we suspect could have a minor impact to your product code and are worth noting.
209+
210+
- **Invalid unitless lengths in box shadows and filters**:
211+
- In order to make React Native more compliant with the CSS/Web specs, we now don’t support anymore unitless lengths in `box-shadow` and `filter`. This means that if you were using a `box-shadow` of `1 1 black` we won’t be rendering. You should instead specify units such as `1px 1px black`
212+
- **Remove incorrect hwb() syntax support from normalize-color:**
213+
- In order to make React Native more compliant with the CSS/Web specs, we now restrict some invalid syntax for `hwb()`. Historically React Native used to support comma separated values (e.g. `hwb(0, 0%, 100%)`) which we now don’t support anymore (you should migrate to `hwb(0 0% 100%)`). You can read more about this change [here](https://github.com/facebook/react-native/commit/676359efd9e478d69ad430cff213acc87b273580).
214+
- **Libraries/Core/ExceptionsManager exports update**
215+
- As part of our effort to modernize the React Native JS API, we updated <code>[ExceptionsManager](https://github.com/facebook/react-native/blob/0.79-stable/packages/react-native/Libraries/Core/ExceptionsManager.js)</code> to now export a default `ExceptionsManager` object, and `SyntheticError` as a secondary export.
216+
217+
## Acknowledgements
218+
219+
React Native 0.79 contains over 944 commits from 100 contributors. Thanks for all your hard work!
220+
221+
We want to send a thank you to those community members that shipped significant contributions in this release:
222+
223+
- [Marc Rousavy](https://github.com/mrousavy) for developing and documenting the “Android: Faster App Startup” feature
224+
- [Kudo Chien](https://github.com/Kudo) and [Oskar Kwaśniewski](https://github.com/okwasniewski)for working on the `@react-native-community/javascriptcore` package and writing the “JSC moving to Community Package” section
225+
- [James Lawson](https://github.com/facebook/metro/pull/1302) for adding support for import subpath resolution [in Metro](https://github.com/facebook/metro/pull/1302).
226+
227+
Moreover, we also want to thank the additional authors that worked on documenting features in this release post:
228+
229+
- [Rob Hogan](https://github.com/robhogan) for the “New Metro Features” section
230+
- [Alex Hunt](https://github.com/huntie) for the “Removal of Remote JS Debugging” and “Internal modules updated to export syntax” sections
231+
- [Riccardo Cipolleschi](https://github.com/cipolleschi) for the work on iOS Native Module registration
232+
233+
## Upgrade to 0.79
234+
235+
Please use the [React Native Upgrade Helper](https://react-native-community.github.io/upgrade-helper/) to view code changes between React Native versions for existing projects, in addition to the Upgrading docs.
236+
237+
To create a new project:
238+
239+
```sh
240+
npx @react-native-community/cli@latest init MyProject --version latest
241+
```
242+
243+
If you use Expo, React Native 0.79 will be supported in the upcoming Expo SDK 53 as the default version of React Native.
244+
245+
:::info
246+
247+
0.79 is now the latest stable version of React Native and 0.76.x moves to unsupported. For more information see [React Native's support policy](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md). We aim to publish a final end-of-life update of 0.76 in the near future.
248+
249+
:::
1.69 MB
Loading
837 KB
Loading

0 commit comments

Comments
 (0)