Summary:
The `Request` interface provided by `types/react-native` doesn't have a `signal` property when it should as this is something that is accessible on the `Request` object.

For example, running the following:
#### Without providing a `signal`
```ts
console.log(new Request('https://www.facebook.com'));
```
will result in the following:
```ts
{"_bodyInit": undefined, "_bodyText": "", "bodyUsed": false, "credentials": "same-origin", "headers": {"map": {}}, "method": "GET", "mode": null, "referrer": null, "signal": {}, "url": "https://www.facebook.com"}
```
## Changelog:
[GENERAL] [FIXED] - Fixed missing property `signal` for the `Request` interface
## Reproduce
1. Add `new Request('https://www.facebook.com').signal` to a typescript file
2. TS will error `Property 'signal' does not exist on type 'Request'`
Pull Request resolved: https://github.com/facebook/react-native/pull/38536
Test Plan:
Adding to `global.d.ts` in a file will resolve the problem, demonstrating that this works.
```ts
interface Request {
readonly signal: AbortSignal | undefined
}
```
Reviewed By: NickGerleman
Differential Revision: D47660506
Pulled By: jacdebug
fbshipit-source-id: ef1459fbaca5d8f31bf8539bd61ac5e447111fec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38613
The `value` string of the ReactAccessibilityDelegate's `fromValue` method is marked as `Nullable`, however the `null` case is not handled.
This change handle the `null` case setting the accesssibility role to NONE.
## Changelog:
[Android][Fixed] - Set the accessibility role to `NONE` when a `null` string is passed to `fromValue`
Reviewed By: cortinico
Differential Revision: D47752098
fbshipit-source-id: e8a44bdd8874e996d8127cb2ee29e5135210b196
Summary:
The bot message is split in a wrong way:
https://github.com/facebook/react-native/issues/38603#issuecomment-1648749441
I'm updating it to use `<br/><br/>` instead which renders correctly inside tables.
Changelog:
[Internal] [Changed] - Properly split the "Too Old Version of React Native" message
Reviewed By: NickGerleman
Differential Revision: D47764363
fbshipit-source-id: 7a80f03b4228a3f0c69d718b8eb60ecd4ac60a2b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38515
Regenerate `babel/traverse` and `babel/types` Flow library definitions from the runtime code at the current lockfile versions, using Metro's `yarn update-babel-flow-lib-defs`.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D47588687
fbshipit-source-id: 065a741ce4a9d765427455a26d23892ea6401f9a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38611
For Ruby tests, we are already testing the least recent (2.6.10) and the most recent version (3.2.0).
Testig on 2.7.7 (a minor greater than 2.6.10) was an over-cautious measure we can safely remove now after few months where we saw that no changes broke this specific version of ruby.
## Changelog:
[Internal] - Remove tests on Ruby 2.7.7
Reviewed By: cortinico
Differential Revision: D47715594
fbshipit-source-id: 854b5e0369f390d8801b72f1231fe6ce30069e09
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38551
I think we can safely remove the StaticFrameworks tests: the DynamicFrameworks are stricter than the static, so if something works in a dynamic frameworks setup, it will work also in the static framework one.
we can safely delete the following tests
- test_ios_template-NewArch-Debug-WithoutFlipper-Hermes-StaticFrameworks
- test_ios_template-NewArch-Debug-WithoutFlipper-JSC-StaticFrameworks
- test_ios_template-NewArch-Release-WithoutFlipper-Hermes-StaticFrameworks
- test_ios_template-NewArch-Release-WithoutFlipper-JSC-StaticFrameworks
- test_ios_template-OldArch-Debug-WithoutFlipper-Hermes-StaticFrameworks
- test_ios_template-OldArch-Debug-WithoutFlipper-JSC-StaticFrameworks
- test_ios_template-OldArch-Release-WithoutFlipper-Hermes-StaticFrameworks
- test_ios_template-OldArch-Release-WithoutFlipper-JSC-StaticFrameworks
- test_ios_rntester-NewArch-Hermes-StaticFrameworks
- test_ios_rntester-NewArch-JSC-StaticFrameworks
- test_ios_rntester-OldArch-Hermes-StaticFrameworks
- test_ios_rntester-OldArch-JSC-StaticFrameworks
## Changelog
[Internal] - Remove static frameworks tests in CircleCI
Reviewed By: dmytrorykun
Differential Revision: D47669902
fbshipit-source-id: 4888bbf88bb23284e410936910e5f71c969408d0
Summary:
Currently, `metro-config` does not have `hermes-parser` enabled by default. This is because `hermes-parser` does not yet support parsing all of TypeScript's syntax nodes.
However, this also means we cannot yet utilize any Flow langauge features that require the use of `hermes-parser` (and are unsupported by Babel). Mapped types falls into this category, so we cannot use them.
This backs out a recent change that tried to adopt Flow mapped types in `EventEmitter`, for now. We can revisit after making the necessary changes to `metro-config`.
Changelog:
[Internal]
Reviewed By: pieterv
Differential Revision: D47729818
fbshipit-source-id: ec90b38e113a9c3ad952f33777fabbd82519cffb
Summary:
Migrates `EventEmitter` in React Native to use the newly introduced mapped types in Flow, instead of `$ObjMap`.
Changelog:
[Internal]
Reviewed By: jbrown215
Differential Revision: D47296240
fbshipit-source-id: 435d0a19242dcd13a4a6c7824daf0e894445cfa7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38554
@public
Upgrades React Native, Relay, and Metro to use `hermes-parser@0.14.0`.
This also changes the repository's Jest configuration to now use `hermes-parser`.
Changelog:
[Internal]
Reviewed By: SamChou19815
Differential Revision: D47522140
fbshipit-source-id: 207ccd0c4e4489d486731d0c847d8089abc1cc72
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38322
As title, so that we can keep the format
```#import <ReactCommon/RCTHost.h>```
Changelog:
[iOS][Changed] - ] Re-orgnize BridgelessApple files to keep proper header file include structure
Reviewed By: cipolleschi, dmytrorykun
Differential Revision: D47421732
fbshipit-source-id: af14807d20676e8732c66fa7f792580819c33f33
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38107
This change makes bridgeless build with JSC and with all the frameworks settings.
## Changelog:
[iOS][Added] Support bridgeless with JSC and frameworks
Reviewed By: philIip
Differential Revision: D47025704
fbshipit-source-id: 5779d3ffd9ed037e6f6dee6c64cc65835f370a5b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38547
Before this change, when a turbomodule was registered using the `RCT_EXPORT_MODULE()` function using a custom name, the TM was not found in the registry.
With this change, we are adding a fallback that looks in the list of registered TM, asking for the name used by the user to register it.
This fallback is executed only if no other method was successful before as it is more expensive.
## CHANGELOG
[iOS][Fixed] - Honor the custom name choosen by the user to register the module.
Reviewed By: philIip
Differential Revision: D47666848
fbshipit-source-id: 545855de1c398726b9449a0d77af7f1756cca233
Summary:
There was a typo in App.test.tsx, that I noticed when tried to upgrade from 0.71 to 0.72
## Changelog:
Fixed small typo from *shiped* to *shipped*
Pick one each for the category and type tags:
[GENERAL] [FIXED]
Pull Request resolved: https://github.com/facebook/react-native/pull/38524
Reviewed By: cortinico
Differential Revision: D47695088
Pulled By: NickGerleman
fbshipit-source-id: 9f74c7f891927be6c0c0f522f0cd51b022fb54f1
Summary:
The change in D47554161 is breaking builds for iOS 17 as the `addEntriesFromDictionary` method returns void and the code tries to assign the returned value to another dictionary.
## Changelog:
[iOS][Fixed] - Use `addEntriesFromDictionary` properly in RCTBaseTextInputView.
Reviewed By: sammy-SC
Differential Revision: D47696854
fbshipit-source-id: 49e01fdc63b3f0478762994d5cafdceb16830c74
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38527
This fixes a bug that got reported for the Fabric Interop for Android with Command dispatching.
(See https://github.com/terrylinla/react-native-sketch-canvas/issues/236)
The problem is that libraries that were receiving commands as ints with:
```
public void receiveCommand(
int surfaceId, int reactTag, int commandId, Nullable ReadableArray commandArgs) {
```
would not receive command with the Fabric Interop for Android.
The problem is that with Fabric, events are dispatched as string always.
cipolleschi took care of this for iOS, but we realized that the Android part was missing. I'm adding it here.
The logic is, if the event is dispatched as a string that represents a number (say `"42"`) and the user has Fabric Interop enabled, then we dispatch the event as `int` (so libraries will keep on working).
Changelog:
[Android] [Fixed] - Fabric Interop - Properly dispatch integer commands
Reviewed By: cipolleschi
Differential Revision: D47600094
fbshipit-source-id: c35f0509e6c6c0cddc7090a069882f92dd95532e
Summary:
While working on a couple things, me Riccardo and Nicola noticed that in main for some reason the old `align-package-versions` command in the root package.json was still there in main branch.
This was "merged into" `bump-all-updated-packages` by hoxyq all the way back in March; here's the commit for 0.72 branch -> https://github.com/facebook/react-native/commit/a469927c16e175b637b2eaf9a84af94f2e8cb519
We are not sure why, but for some reason the same commit in main was borked in some way, and didn't actually remove the command: PR (https://github.com/facebook/react-native/pull/36568) and commit (https://github.com/facebook/react-native/commit/04df252aa7bff34a02b24f8381b3f2f1dd122c2f)
So this commit just takes care of that.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [REMOVED] - remove old command for align packages versions
Pull Request resolved: https://github.com/facebook/react-native/pull/38548
Test Plan: N/A - it's a removal
Reviewed By: cipolleschi
Differential Revision: D47669016
Pulled By: cortinico
fbshipit-source-id: aa651b69433171219dbc235d947ceed4f88b602a
Summary:
This PR fixes a bug where GitHub Actions bot didn't add a comment when "Needs: Repro" label was present in an issue.
When a maintainer adds the label manually the bot comments with "Missing Reproductible Example" as normally.
It seems like the problem occurred because of a difference in a sandbox repository and the proper facebook/react-native repo environment.
My sandbox that I used to test https://github.com/facebook/react-native/pull/38338 had an "bot" account with Personal Access Token setup to reply to issues. Turns out that bots using PAT have more permissions and can trigger one action from the other.
**The solution is to send the comment directly from the `checkForReproducer` action.** This won't collide with other actions but sadly will duplicate the sending logic into two actions.
This PR also makes the bot respect when a maintainer removes and adds a label by hand and won't alter the maintainer decision.
Related to ☂️https://github.com/facebook/react-native/issues/35591
## Changelog:
[INTERNAL] [FIXED] - Message
Pull Request resolved: https://github.com/facebook/react-native/pull/38531
Test Plan: 
Reviewed By: cipolleschi
Differential Revision: D47666922
Pulled By: cortinico
fbshipit-source-id: 4a6a471cb11c6ed9b48263d18bf8e283577a14bb
Summary:
Testing releases takes a lot of time because we have to build locally several configurations.
However, the artifacts that we build locally are also built in CI.
The goal of this PR is to implement a mechanism to download those artifacts from the CI instead of build locally, so that testing the release locally can take much less time.
As an example, the full test cycle can take more than 2 hours given that we need to repackage and rebuilt the app from the template.
My plan is to add a table with the time saved once the PR is done
### TODO:
- [x] Download Hermes tarball for RNTester iOS
- [x] Download Hermes APK for RNTester Android
- [x] Download JSC APK for RNTester Android
- [x] Download Packaged version of React Native to create a new app
- [x] Use the downloaded React Native to initialize an app from the template
- [x] Download Maven Local prebuilt in CI and use it for Template Android app
### Time Savings
| Setup | Before [s] | After [s] | Notes |
| --- | --- | --- | --- |
| iOS RNTester Hermes | 339.68 | 194.86 | Time saved by downloading Hermes rather then building it |
| iOS RNTester JSC | 129.80 | 123.35 | Not significant, expected as this workflow did not change
| Android RNTester Hermes | 1188.82 | 5.28 | Huge improvement: we download the APK rather then build |
| Android RNTester JSC | 103.10 | 6.28 | Huge improvement: we download the APK rather then build |
| Creating the RNTestProject | 2074.82 | 191.16 | We download Maven, the packaged version of RN and Hermes instead of building from scratch |
## Changelog:
[Internal] - Speed up Release testing by downloading the CircleCI artifacts
Pull Request resolved: https://github.com/facebook/react-native/pull/37971
Test Plan: - Tested the script locally
Reviewed By: cortinico, dmytrorykun
Differential Revision: D46859120
Pulled By: cipolleschi
fbshipit-source-id: 8878ebaccf6edb801f8e9884e2bf3946380aa748
Summary:
While setting up a credit card form in RN, I discovered that iOS 17 supports a number of new content types ([`UITextContentType` docs](https://developer.apple.com/documentation/uikit/uitextcontenttype?language=objc)). In the docs these are marked with the `Beta` flag.
Setting up the new content types is relatively straightforward, but a change is required in https://github.com/facebook/react-native-deprecated-modules to update the `TextInput` prop types. ~~I will open a PR in that repo shortly.~~ I have [opened a PR](https://github.com/facebook/react-native-deprecated-modules/pull/23) to update the prop types. ~~Once that PR is merged, a version bump for that dependency will need to be added to this PR.~~ The PR is merged and the dependency in this PR has been updated.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[IOS] [ADDED] - Added support for iOS 17+ text content types
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/38354
Test Plan: The `rn-tester` app builds and runs successfully. I have added a few new examples of inputs using the new text content types.
Reviewed By: javache
Differential Revision: D47554161
Pulled By: philIip
fbshipit-source-id: 8d4414dc6229063f81164f2d8727921c8294c92e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38474
Changelog: [Internal] - Add basics of pointer event interception
This diff adds the scaffolding for intercepting Pointer Events (without actually doing anything with them yet). Most notably introduces the logic of determining which events are of the PointerEvent type and downcasting to the type so the interceptor can properly work with the typed properties.
Originally my plan was to leverage `dynamic_cast` but sandcastle's signals let me know that there exists internal apps (particularly VR ones) which don't have RTTI enabled — so to avoid that usage I introduced an additional abstract method on EventPayload which lets subclasses identify themselves cheaply and then subsequently leverage `static_cast`.
Reviewed By: NickGerleman
Differential Revision: D47443773
fbshipit-source-id: 3671285c0413a60475d51318e209376f8a2790ed
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38521
`HermesRuntimeImpl::setValueAtIndexImpl` directly called
`setElementAt`, which meant that it would not handle index-like
properties properly. Use `putComputed_RJS` instead, which will check
for such properties.
Reviewed By: avp
Differential Revision: D47617445
fbshipit-source-id: c3505670960bd6223bd014f138cee191267a5315
Summary:
From the video below, we can see that the UI thread has dropped many frames, and it would become worse if there are multiple images.
If an image is located in the sandbox of the disk, we cannot load it using `RCTLocalAssetImageLoader` because `RCTLocalAssetImageLoader.requiresScheduling` is set to true, which loads the data on the UI thread and causes main thread stuttering. This will affect libraries such as `react-native-code-push` and others that save images to the sandbox of the disk.
Therefore, we should replace `RCTLocalAssetImageLoader.canLoadImageURL` from `RCTIsLocalAssetURL(url)` to `RCTIsBundleAssetURL(url)`. Similarly, we should rename the entire `RCTLocalAssetImageLoader` file with `RCTBundleAssetImageLoader`, which ignores images in the disk sandbox. And finally these images will be loaded from `NSURLRequest`, and our UI thread will run smoothly again.
https://user-images.githubusercontent.com/20135674/236368418-8933a2c6-549c-40d3-a551-81b492fe41d5.mp4
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [Breaking] - Replace `RCTLocalAssetImageLoader` to `RCTBundleAssetImageLoader`
Pull Request resolved: https://github.com/facebook/react-native/pull/37232
Test Plan:
Test Code:
```javascript
constructor(props) {
super(props)
this.state = {
bundle_image: require('./large_image.png'),
sandbox_image: '',
source: null,
isLoading: false,
}
}
render() {
console.log('render', this.state)
return (
<View style={{ flex: 1, padding: 50, backgroundColor: 'white'}}>
<View style={{ flexDirection: 'row', alignItems: 'center', height: 70}}>
{
[{ title: 'Save Image To SandBox', onPress: () => {
let image = Image.resolveAssetSource(this.state.bundle_image)
console.log(image.uri)
this.setState({ isLoading: true })
RNFetchBlob.config({ fileCache: true, appendExt: "png" }).fetch("GET", image.uri).then(response => {
let path = response.path()
path = /^file:\/\//.test(path) ? path : 'file://' + path
console.log(path)
this.state.sandbox_image = path
}).finally(() => this.setState({ isLoading: false }))
}}, { title: 'Load From SandBox', onPress: () => {
this.setState({ source: { uri: this.state.sandbox_image } })
}}, { title: 'Clear', onPress: () => {
this.setState({
source: null,
isLoading: false
})
}}, { title: 'Load From Bundle', onPress: () => {
this.setState({ source: this.state.bundle_image })
}}].map((item, index) => {
return (
<Pressable
key={index}
style={{ height: '100%', justifyContent: 'center', flex: 1, borderWidth: 1, borderColor: 'black', marginLeft: index > 0 ? 15 : 0 }}
onPress={item.onPress}
>
<Text style={{ textAlign: 'center' }}>{item.title}</Text>
</Pressable>
)
})
}
</View>
<ActivityIndicator style={{ marginTop: 10 }} animating={this.state.isLoading} />
<Image
key={`${this.state.source}`}
style={{ marginTop: 20, width: 200, height: 200 }}
source={this.state.source}
onProgress={({ nativeEvent }) => console.log(nativeEvent)}
onLoadStart={() => this.setState({ isLoading: true })}
onLoadEnd={() => this.setState({ isLoading: false })}
/>
</View>
)
}
```
It needs to be tested in three environments: [Simulator_Debug, RealDevice_Debug, RealDevice_Release]
1. Open `Perf Monitor` (RealDevice_Release can be skipped)
2. Click `Save Image to SandBox`
3. Wait for the loading to end and click `Load From SandBox`
4. Verify that the image can be loaded successfully
5. Verify that the `UI thread` keeps `60 FPS` (RealDevice_Release can be skipped)
6. Click `Clear`
7. Repeat steps [3, 4, 5, 6] several times
8. Click `Load From Bundle` to verify that the bundle image can be loaded successfully
Simulator_Debug
https://user-images.githubusercontent.com/20135674/236369344-ee1b8ff1-2d49-49f3-a322-d973f4adf3e7.mp4
RealDevice_Debug
https://user-images.githubusercontent.com/20135674/236369356-fe440b2b-f72a-49be-b63c-b4bf709dac8c.mp4
RealDevice_Release
https://user-images.githubusercontent.com/20135674/236369365-8a6a5c2f-09ad-4c90-b6bd-41e8a5e3aa7f.mp4
Reviewed By: rshest
Differential Revision: D46441513
Pulled By: dmytrorykun
fbshipit-source-id: 652febd4147dbff6c1ceef03d84ce125b8c66770
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37730
This diff makes unschematized native components available in bridgeless mode. In case there is no static view config, `BridgelessUIManager` calls `RN$LegacyInterop_UIManager_getConstants`, and gets native view config form the constants.
Changelog: [Internal] - Use RN$LegacyInterop_UIManager_getConstants in BridgelessUIManager
Reviewed By: sammy-SC
Differential Revision: D45154396
fbshipit-source-id: 32b3718841b59a8b6fb22022c9d9edc17dad877f