Skip to content

Commit a5e5ffd

Browse files
committed
Merge branch 'facebook-main' into production
2 parents e040c19 + 71b23ed commit a5e5ffd

File tree

213 files changed

+44355
-347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+44355
-347
lines changed

.github/workflows/pre-merge.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@ jobs:
1212
- name: Checkout repository
1313
uses: actions/checkout@v4
1414

15+
- name: Enable Corepack
16+
run: corepack enable
17+
1518
- name: Set up Node.js
1619
uses: actions/setup-node@v4
1720
with:
1821
node-version: "20"
19-
20-
- name: Enable Corepack
21-
run: corepack enable
22+
cache: "yarn"
2223

2324
- name: Check dependencies
2425
run: yarn dedupe --check
2526

2627
- name: Install dependencies
2728
run: yarn install --immutable
28-
29+
2930
- name: Run Lint
3031
run: yarn ci:lint
3132
working-directory: website
@@ -36,13 +37,14 @@ jobs:
3637
- name: Checkout repository
3738
uses: actions/checkout@v4
3839

40+
- name: Enable Corepack
41+
run: corepack enable
42+
3943
- name: Set up Node.js
4044
uses: actions/setup-node@v4
4145
with:
4246
node-version: "20"
43-
44-
- name: Enable Corepack
45-
run: corepack enable
47+
cache: "yarn"
4648

4749
- name: Install dependencies
4850
run: yarn install --immutable

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pretty-quick --staged

docs/_integration-with-existing-apps-ios.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,6 @@ Once you reach your React-powered Activity inside the app, it should load the Ja
490490

491491
<center><img src="/docs/assets/EmbeddedAppIOS078.gif" width="300" /></center>
492492

493-
:::note
494-
We are aware of a small limitation that prevent you to represent a view controller once it is dismissed.
495-
[This PR](https://github.com/facebook/react-native/pull/49300) fixes this issue and the limitation will be lifted in React Native 0.78.1.
496-
:::
497-
498493
### Creating a release build in Xcode
499494

500495
You can use Xcode to create your release builds too! The only additional step is to add a script that is executed when the app is built to package your JS and images into the iOS application.

docs/backhandler.md

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,34 @@ The event subscriptions are called in reverse order (i.e. the last registered su
1515
## Pattern
1616

1717
```tsx
18-
BackHandler.addEventListener('hardwareBackPress', function () {
19-
/**
20-
* this.onMainScreen and this.goBack are just examples,
21-
* you need to use your own implementation here.
22-
*
23-
* Typically you would use the navigator here to go to the last state.
24-
*/
25-
26-
if (!this.onMainScreen()) {
27-
this.goBack();
18+
const subscription = BackHandler.addEventListener(
19+
'hardwareBackPress',
20+
function () {
2821
/**
29-
* When true is returned the event will not be bubbled up
30-
* & no other back action will execute
22+
* this.onMainScreen and this.goBack are just examples,
23+
* you need to use your own implementation here.
24+
*
25+
* Typically you would use the navigator here to go to the last state.
3126
*/
32-
return true;
33-
}
34-
/**
35-
* Returning false will let the event to bubble up & let other event listeners
36-
* or the system's default back action to be executed.
37-
*/
38-
return false;
39-
});
27+
28+
if (!this.onMainScreen()) {
29+
this.goBack();
30+
/**
31+
* When true is returned the event will not be bubbled up
32+
* & no other back action will execute
33+
*/
34+
return true;
35+
}
36+
/**
37+
* Returning false will let the event to bubble up & let other event listeners
38+
* or the system's default back action to be executed.
39+
*/
40+
return false;
41+
},
42+
);
43+
44+
// Unsubscribe the listener on unmount
45+
subscription.remove();
4046
```
4147

4248
## Example
@@ -126,14 +132,3 @@ static addEventListener(
126132
```tsx
127133
static exitApp();
128134
```
129-
130-
---
131-
132-
### `removeEventListener()`
133-
134-
```tsx
135-
static removeEventListener(
136-
eventName: BackPressEventName,
137-
handler: () => boolean | null | undefined,
138-
);
139-
```

docs/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ React Native DevTools is only available with the Hermes engine, and requires eit
4747

4848
React Native DevTools replaces the previous Flipper, Experimental Debugger, and Hermes debugger (Chrome) frontends. If you are on an older version of React Native, please go to the docs [for your version](/versions).
4949

50-
We continue to offer legacy debugging methods such as Direct JSC Debugging and Remote JS Debugging (deprecated) (see [Other Debugging Methods](./other-debugging-methods)).
50+
For apps using JavaScriptCore instead of Hermes, Direct JSC Debugging is still available (see [Other Debugging Methods](./other-debugging-methods)).
5151

5252
React Native DevTools is designed for debugging React app concerns, and not to replace native tools. If you want to inspect React Native’s underlying platform layers (for example, while developing a Native Module), please use the debugging tools available in Xcode and Android Studio (see [Debugging Native Code](/docs/next/debugging-native-code)).
5353

docs/flexbox.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const FlexDirectionBasics = () => {
7878
return (
7979
<PreviewLayout
8080
label="flexDirection"
81-
values={['column', 'row', 'row-reverse', 'column-reverse']}
81+
values={['column', 'row', 'column-reverse', 'row-reverse']}
8282
selectedValue={flexDirection}
8383
setSelectedValue={setflexDirection}>
8484
<View style={[styles.box, {backgroundColor: 'powderblue'}]} />
@@ -178,7 +178,7 @@ const FlexDirectionBasics = () => {
178178
return (
179179
<PreviewLayout
180180
label="flexDirection"
181-
values={['column', 'row', 'row-reverse', 'column-reverse']}
181+
values={['column', 'row', 'column-reverse', 'row-reverse']}
182182
selectedValue={flexDirection}
183183
setSelectedValue={setflexDirection}>
184184
<View style={[styles.box, {backgroundColor: 'powderblue'}]} />

docs/handling-touches.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default ButtonBasics;
6969

7070
## Touchables
7171

72-
If the basic button doesn't look right for your app, you can build your own button using any of the "Touchable" components provided by React Native. The "Touchable" components provide the capability to capture tapping gestures, and can display feedback when a gesture is recognized. These components do not provide any default styling, however, so you will need to do a bit of work to get them looking nicely in your app.
72+
If the basic button doesn't look right for your app, you can build your own button using any of the "Touchable" components provided by React Native. These components provide the capability to capture tapping gestures and can display feedback when a gesture is recognized. However, these components do not provide any default styling, so you will need to do a bit of work to get them looking nice in your app.
7373

7474
Which "Touchable" component you use will depend on what kind of feedback you want to provide:
7575

docs/other-debugging-methods.md

Lines changed: 5 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -25,71 +25,12 @@ While source maps may not be enabled by default, you can follow [this guide](htt
2525
Every time the app is reloaded, a new JSContext is created. Choosing "Automatically Show Web Inspectors for JSContexts" saves you from having to select the latest JSContext manually.
2626
:::
2727

28-
## Remote JavaScript Debugging (deprecated)
28+
## Remote JavaScript Debugging (removed)
2929

30-
:::warning
31-
Remote JavaScript Debugging is deprecated in React Native 0.73 and will be removed in a future release.
32-
:::
33-
34-
Remote JavaScript Debugging connects an external web browser (Chrome) to your app and runs your JavaScript code inside a web page. This allows you to use Chrome's debugger as you would with any web app. Note that the browser environment can be very different, and not all React Native modules will work when debugging this way.
35-
36-
### Setup
37-
38-
Since React Native 0.73, Remote JavaScript Debugging must be **manually enabled** using the `NativeDevSettings` module.
39-
40-
```js
41-
import NativeDevSettings from 'react-native/Libraries/NativeModules/specs/NativeDevSettings';
42-
43-
function MyApp() {
44-
// Assign this to a dev-only button or useEffect call
45-
const connectToRemoteDebugger = () => {
46-
NativeDevSettings.setIsDebuggingRemotely(true);
47-
};
48-
}
49-
```
50-
51-
When `NativeDevSettings.setIsDebuggingRemotely(true)` is invoked, this will open a new tab at [http://localhost:8081/debugger-ui](http://localhost:8081/debugger-ui).
30+
:::warning Important
31+
Remote JavaScript Debugging has been removed as of React Native 0.79. See the original [deprecation announcement](https://github.com/react-native-community/discussions-and-proposals/discussions/734).
5232

53-
From this page, open Chrome DevTools via:
54-
55-
- View > Developer > Developer Tools
56-
- <kbd>⌥ Option</kbd> + <kbd>Cmd ⌘</kbd> + <kbd>I</kbd> (macOS) / <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>I</kbd> (Windows and Linux).
57-
58-
The Console and Sources panels will allow you to inspect your React Native code.
59-
60-
![The remote debugger window in Chrome](/docs/assets/debugging-chrome-remote-debugger.jpg)
61-
62-
:::info
63-
Under Remote JavaScript Debugging, the web version of React DevTools in Chrome will not work with React Native. See the [React Native DevTools](./react-native-devtools) guide to explore how to use React DevTools in our integrated debugger.
33+
If you are on an older version of React Native, please go to the docs [for your version](/versions).
6434
:::
6535

66-
:::note
67-
On Android, if the times between the debugger and device have drifted, things such as animations and event behavior might not work properly. This can be fixed by running ``adb shell "date `date +%m%d%H%M%Y.%S%3N`"``. Root access is required if using a physical device.
68-
:::
69-
70-
### Debugging on a physical device
71-
72-
:::info
73-
If you're using Expo CLI, this is configured for you already.
74-
:::
75-
76-
<Tabs groupId="platform" defaultValue={constants.defaultPlatform} values={constants.platforms} className="pill-tabs">
77-
<TabItem value="ios">
78-
79-
On iOS devices, open the file [`RCTWebSocketExecutor.mm`](https://github.com/facebook/react-native/blob/master/packages/react-native/React/CoreModules/RCTWebSocketExecutor.mm) and change "localhost" to the IP address of your computer.
80-
81-
</TabItem>
82-
<TabItem value="android">
83-
84-
On Android 5.0+ devices connected via USB, you can use the [`adb` command line tool](http://developer.android.com/tools/help/adb.html) to set up port forwarding from the device to your computer:
85-
86-
```sh
87-
adb reverse tcp:8081 tcp:8081
88-
```
89-
90-
</TabItem>
91-
</Tabs>
92-
93-
:::note
94-
If you run into any issues, it may be possible that one of your Chrome extensions is interacting in unexpected ways with the debugger. Try disabling all of your extensions and re-enabling them one-by-one until you find the problematic extension.
95-
:::
36+
![The remote debugger window in Chrome](/docs/assets/debugging-chrome-remote-debugger.jpg)

docs/react-native-gradle-plugin.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ The list of flags to pass to `hermesc`. By default is `["-O", "-output-source-ma
150150
hermesFlags = ["-O", "-output-source-map"]
151151
```
152152

153+
### `enableBundleCompression`
154+
155+
Whether the Bundle Asset should be compressed when packaged into a `.apk`, or not.
156+
157+
Disabling compression for the `.bundle` allows it to be directly memory-mapped to RAM, hence improving startup time - at the cost of a larger resulting app size on disk. Please note that the `.apk` download size will be mostly unaffected as the `.apk` files are compressed before downloading
158+
159+
By default this is disabled, and you should not turn it on, unless you're really concerned about disk space for your application.
160+
153161
## Using Flavors & Build Variants
154162

155163
When building Android apps, you might want to use [custom flavors](https://developer.android.com/studio/build/build-variants#product-flavors) to have different versions of your app starting from the same project.

docs/textinput.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,13 @@ It is important to note that this aligns the text to the top on iOS, and centers
545545

546546
---
547547

548-
### `numberOfLines` <div class="label android">Android</div>
548+
### `numberOfLines`
549549

550-
Sets the number of lines for a `TextInput`. Use it with multiline set to `true` to be able to fill the lines.
550+
:::note
551+
`numberOfLines` on iOS is only available on the [New Architecture](/architecture/landing-page)
552+
:::
553+
554+
Sets the maximum number of lines for a `TextInput`. Use it with multiline set to `true` to be able to fill the lines.
551555

552556
| Type |
553557
| ------ |

0 commit comments

Comments
 (0)