Summary:
react-native-navigation allows to register React components to be included in the navigation top bar as buttons, the way this work is by using the AppRegistry. When the ViewTreeObserver executes the `CustomGlobalLayout` we are checking for the RootWindowInsets in the `checkKeyboardEvents` which in the case for the top bar component it returns null and the **WindowInsetsCompat.toWindowInsetsCompat** function throws if the insets are null causing the app to crash.
Interestingly in the function `checkForKeyboardEventsLegacy` the null value is being checked, so I guess it was overlooked in the newer function.
## Changelog
[ANDROID] [FIXED] - Fix ReactRootView crash when root view window insets are null
Pull Request resolved: https://github.com/facebook/react-native/pull/35869
Test Plan:
The following videos show how the app crashes as soon as we attempt to pop a screen that contains a react component as a button in the navigation top bar and how it correctly pops to the previous screen after applying the fix
| Crash | Fix |
| -- | -- |
| https://user-images.githubusercontent.com/6757047/213116971-fe693989-f978-438c-b8f9-fc56f2a477c8.mp4 | https://user-images.githubusercontent.com/6757047/213118352-fe258f28-07aa-4d17-98d2-97136464ffd5.mp4 |
Reviewed By: cipolleschi
Differential Revision: D42580156
Pulled By: cortinico
fbshipit-source-id: 4dbd656d7c8148df67668a2a50913206bc35c07f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35872
When downgrading from AGP 7.4 to 7.3 we were forced to resort to older APIs
to bundle resources. It seems like we haven't properly wired the task to make sure
resources generated by Metro are correctly accounted before the generation of
release app bundles/apks.
This fixes it. This fix can also be removed once we are on AGP 7.4
Fixes#35865
Changelog:
[Android] [Fixed] - Fix for resources not correctly bundlded on release appbundles
Reviewed By: cipolleschi
Differential Revision: D42573450
fbshipit-source-id: a810924315f72e02e4c988ae86112bf0a06a9ce5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35860
I've just realized that the `--active-arch-only` is not correctly passed down
to RNGP to set up an abiFilter so users on 0.71 on New Architecture end up
building all the architectures even if `--active-arch-only` is set.
This fix makes sure the `abiFilters` is applied if the user specified
either the `--active-arch-only`, the `reactNativeArchitectures` property
and is not using the Split ABI feature.
Changelog:
[Android] [Fixed] - RNGP - Honor the --active-arch-only when configuring the NDK
Reviewed By: cipolleschi
Differential Revision: D42547987
fbshipit-source-id: 5a34e7087bb4f89de74cc52f9c505e36896fbf03
Summary:
Upgrades Danger to the latest available version to mitigate the jsonwebtoken security vulnerability.
Changelog:
[Internal] [Changed] - Upgrade Danger to 11.2.1 to mitigate jsonwebtoken security vulnerability
Reviewed By: cortinico
Differential Revision: D42505940
fbshipit-source-id: 740edc7316791e5afe894ecdd1e05e13d2ef1f2c
Summary:
Turbo module codegen support interface like alias in module.
In typescript, interface allows inheritance, but the codegen schema doesn't have such information. In this PR the codegen schema is not changed, interfaces are flattened.
In the next change, I will update the codegen schema so that it allows inheritance, in order to generate more precise C++ code.
## Changelog
[GENERAL] [CHANGED] - Turbo module codegen support interface like alias in module
Pull Request resolved: https://github.com/facebook/react-native/pull/35812
Test Plan: `yarn jest react-native-codegen` passed
Reviewed By: cortinico
Differential Revision: D42475368
Pulled By: cipolleschi
fbshipit-source-id: 26025f8a55b600dfea27026c998cd8b5fe752af4
Summary:
This PR implements logical border-radius as requested on https://github.com/facebook/react-native/issues/34425. This implementation includes the addition of the following style properties
- `borderEndEndRadius`, equivalent to `borderBottomEndRadius`.
- `borderEndStartRadius`, equivalent to `borderBottomStartRadius`.
- `borderStartEndRadius`, equivalent to `borderTopEndRadius`.
- `borderStartStartRadius`, equivalent to `borderTopStartRadius`.
## Changelog
[GENERAL] [ADDED] - Add logical border-radius implementation
Pull Request resolved: https://github.com/facebook/react-native/pull/35572
Test Plan:
1. Open the RNTester app and navigate to the `RTLExample` page
2. Test the new style properties through the `Logical Border Radii Start/End` section
https://user-images.githubusercontent.com/11707729/206623732-6d542347-93f9-40da-be97-f7dcd5f66ca9.mov
Reviewed By: necolas
Differential Revision: D42002043
Pulled By: NickGerleman
fbshipit-source-id: a0aa9783c280398b437aeb7a00c6eb3f767657a5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35777
As Flipper version is a bit old, let's bump it to the latest stable: 0.174.0.
This is a follow-up from D41492705 (https://github.com/facebook/react-native/commit/db3ac93001f65bad84b748ec257fe79b79432976).
At the time, it wasn't possible to update to the latest stable Flipper as crashes were observed due to NDK mismatch.
allow-large-files
Changelog:
[iOS] [Changed] - Bump Flipper to 0.174.0
Reviewed By: cortinico, cipolleschi
Differential Revision: D42345736
fbshipit-source-id: 501e068aebfc25f6a50332391a7940aa9eec6fd6
Summary:
Add `onStartReached` and `onStartReachedThreshold` to `VirtualizedList`. This allows implementing bidirectional paging.
## Changelog
[General] [Added] - Add onStartReached and onStartReachedThreshold to VirtualizedList
Pull Request resolved: https://github.com/facebook/react-native/pull/35321
Test Plan: Tested in the new RN tester example that the callback is triggered when close to the start of the list.
Reviewed By: yungsters
Differential Revision: D41653054
Pulled By: NickGerleman
fbshipit-source-id: 368b357fa0d83a43afb52a3f8df84a2fbbedc132
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35768
Changelog: [Internal]
This implements native side mechanics for reporting user events timing to JS (PerformanceObserver API).
See the standard for more details: https://www.w3.org/TR/event-timing/
The events are only logged when there are any active subscriptions (via `PerformanceObserver.observe`), also we only log "discrete events" (i.e. no likes of mouse move), so the overhead is non-existing.
There are two main metrics of interest for an event lifecycle:
* Time the event is spent in the queue, i.e. the time between it's created and dispatched
* Time that is spend in the event handler on the JS side (event dispatch), or processing time
Both of these are measured, and the corresponding fields are populated.
Reviewed By: sammy-SC
Differential Revision: D42294947
fbshipit-source-id: 4fd7938c04b942400befa4057d4929fb2763cee1
Summary:
This is not a task from https://github.com/facebook/react-native/issues/34872 but it goes towards the same goal: removing language-specific logic from shared code and moving it to the FlowParser and TypeScriptParser.
I'm not sure about the documentation of the functions. It's been quite difficult for me to understand what the arguments are and what is returned by the functions because I find the naming quite confusing and nothing is typed.
## 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] [CHANGED] - [Codegen] Move language ternaries logic to FlowParser and TypeScriptParser
Pull Request resolved: https://github.com/facebook/react-native/pull/35742
Test Plan: I tested using Flow and Jest commands. I made sure that tests were broken when Flow and TypeScript implementations were reversed.
Reviewed By: NickGerleman
Differential Revision: D42280934
Pulled By: rshest
fbshipit-source-id: 580ebdf424a5c179c9928ac5f9441899fb04d0c7
Summary:
Changelog: [Internal]
While working on implementing [Event Timing API](https://www.w3.org/TR/event-timing/) I've noticed that there are multiple compiler warnings about unused lambda captures, which are coming from generated C++ code for EventEmitters.
This modifies the codegen so that the corresponding lambda doesn't capture event variable if it's not used in the event handler, thus getting rid of warnings.
Reviewed By: christophpurrer
Differential Revision: D42281899
fbshipit-source-id: 98442bb9f3ce374755188d818a9b2d6a8050bf15
Summary:
[Changelog][Internal]
This appears to be a regression from https://github.com/facebook/yoga/pull/1195
The `yoga/internal/experiments.cpp` was removed, but the corresponding Pod cache wasn't updated, which made the RNTester iOS to start fail.
Reviewed By: christophpurrer
Differential Revision: D42268322
fbshipit-source-id: 8db1118787ed41cde10babe6845f6d05a8f86bc2
Summary:
This is not a task from https://github.com/facebook/react-native/issues/34872 but I noticed that we were passing `language` arguments that were never used for several errors so I removed them.
## 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] [CHANGED] - Remove unused language argument in Codegen errors
Pull Request resolved: https://github.com/facebook/react-native/pull/35732
Test Plan: I tested using Flow and Jest.
Reviewed By: christophpurrer
Differential Revision: D42266490
Pulled By: rshest
fbshipit-source-id: 7953a98586bf9e927a58222cc27cf88e9c1c1163
Summary:
This PR implements `inset` logical properties as requested on https://github.com/facebook/react-native/issues/34425. This implementation includes the addition of the following style properties
- `inset`, equivalent to `top`, `bottom`, `right` and `left`.
- `insetBlock`, equivalent to `top` and `bottom`.
- `insetBlockEnd`, equivalent to `bottom`.
- `insetBlockStart`, equivalent to `top`.
- `insetInline`, equivalent to `right` and `left`.
- `insetInlineEnd`, equivalent to `right` or `left`.
- `insetInlineStart`, equivalent to `right` or `left`.
## Changelog
[GENERAL] [ADDED] - Add Fabric implementation of inset logical properties
Pull Request resolved: https://github.com/facebook/react-native/pull/35692
Test Plan:
1. Open the RNTester app and navigate to the `View` page
2. Test the new style properties through the `Insets` section
<table>
<tr>
<td>Android</td>
<td>iOS</td>
</tr>
<tr>
<td><img src="https://user-images.githubusercontent.com/11707729/208821212-fbbac6ed-09a4-43f4-ba98-dfd2cbabf044.png" alt="1" width="360px" />
</td>
<td>
<img src="https://user-images.githubusercontent.com/11707729/208816997-ef044140-8824-4b1b-a77b-085f18ea9e0e.png" alt="2" width="360px" />
</td>
</tr>
</table>
Reviewed By: NickGerleman
Differential Revision: D42193661
Pulled By: ryancat
fbshipit-source-id: 3db8bcd2c4db0ef4886b9ec49a46424d57362620
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35679
The Codegen cleanup step was not always working due to an issue with the codegen folder path. It was working for RNTester, but not for apps created from the Template.
## Changelog:
[iOS][Fixed] - Fix path issue to properly run the codegen cleanup step
Reviewed By: jacdebug
Differential Revision: D42137600
fbshipit-source-id: ba4cb03d4c6eb17fda70a4aff383908d2e468429
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35631Fixes#35592
I'm de-bumping AGP from 7.4 to 7.3 as per #35592. There is no stable release
of AGP that is working fine with the `addGeneratedSourceDirectory` API for resources.
Here I'm reverting to use the older APIs.
Changelog:
[Internal] [Changed] - De-bump AGP to 7.3.1 and do not use `addGeneratedSourceDirectory`
allow-large-files
Reviewed By: cipolleschi
Differential Revision: D42004813
fbshipit-source-id: f1a2b0f7c2233402749a3e4f3828be80111ad3a7
Summary:
While working on D42008409 I found out that codegen for pure C++ modules doesn't work with container types that are nested inside generated data structures, which happens because they don't have a specialization of `bridging::toJS` that wouldn't pass the `invoker` instance through.
It looks like an easiest option would be just to use `invoker` in codegen for `toJS` as well, which this diff does.
Note that I also experimented with removing `invoker` from being used in the `::toJS` specializations for containers altogether (see D42008410), as there doesn't seem to be a single use case when `invoker` would be ever needed in any `::toJS` specialization (and imagining such a scenario would be a stretch, tbh - why a conversion function would invoke anything running on JS side, given that invoker provides no return values anyway?..)
But since I am still not 100% about the invoker purpose there, I went with the codegen change.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D42008724
fbshipit-source-id: 6302d3ceacdfc8fed296ee1ef1a985f7273c2261
Summary:
This diff adds prepare command to hermes-engine.podspec. That command creates dummy `universal/hermes.xcframework` and `maocosx/hermes.framework`. This allow us to utilise CocoaPods auto-linking, and remove manual linking/cleanup code.
Also we now do not pollute user project with "Copy Hermes Framework" script phase. Which was quite bad on its own, and also caused annoying bugs on the CI.
allow-large-files
Changelog:
[iOS][Changed] - Prepare dummy hermes.xcframework before pod install.
Reviewed By: cipolleschi
Differential Revision: D41533994
fbshipit-source-id: d7d098ba5e882ac2d036335c23d7cda447d75b8d
Summary:
The current implementation think `{[key:T]:U}` and `{key:object}` are the same type, which is semantically wrong.
This pull request fixes the problem and return `{type:'GenericObjectTypeAnnotation'}`, so that `{[key:T]:U}` is `Object`. The current schema cannot represent dictionary type, `Object` is the closest one.
The previous incorrect implementation actually bring in code with logic that doesn't make sense (treating indexer as property), those and related unit test are all undone.
## Changelog
[General] [Changed] - Fix codegen output for object with indexer
Pull Request resolved: https://github.com/facebook/react-native/pull/35344
Test Plan: `yarn jest react-native-codegen` passed
Reviewed By: rshest
Differential Revision: D41304475
Pulled By: cipolleschi
fbshipit-source-id: caab8e458d83f9850c5c28b67cc561a764738372
Summary:
There are other 3 packages which have unreleased changes on main:
```
babel-plugin-codegen/
eslint-plugin-specs/
eslint-config-react-native-community/
```
I'm bumping them in order to be able to publish them to NPM.
Changelog:
[Internal] [Changed] - Bump further patch packages to unblock nightly as they have unreleased changes on main
Reviewed By: hoxyq
Differential Revision: D41874749
fbshipit-source-id: 0b8cd69cab6fcb116f2635c964490927f4fb20be
Summary:
After adding `<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>` on my `AndroidManifest.xml`, I expected to use `PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS` but `POST_NOTIFICATIONS` is `undefined` and is named `POST_NOTIFICATION` instead.
Every other Android permission is 1:1 in spelling except this one where it lacks `S`.
Not sure if this is a welcome change since this can be breaking. Or maybe we can include both with and without `S` to not be a breaking change. Or just keep it as is and close this PR.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Android] [Changed] - Rename `POST_NOTIFICATION` to `POST_NOTIFICATIONS`
Pull Request resolved: https://github.com/facebook/react-native/pull/35533
Test Plan: `PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS` should not be `undefined`.
Reviewed By: cortinico
Differential Revision: D41705866
Pulled By: philIip
fbshipit-source-id: a0328b174f0196421565f0cd2b2f1eb509428553
Summary:
Nightlies are currently broken on main. That's because nightlies rely on packages that got
re-scoped under `react-native`. We need to publish them to NPM.
In order to do so, I'm bumping versions for the one that have changes on main so that they
can be published to NPM to unblock nightlies.
Changelog:
[Internal] [Changed] - Bump all the react-native/ packages to publish on main
Reviewed By: hoxyq
Differential Revision: D41840985
fbshipit-source-id: 45b691611e33668df0922d4ff753738a773f162c
Summary:
`AlertIOS` was deprecated and removed long ago (https://github.com/facebook/react-native/commit/e2bd7db732602b2c477fe040f2946bd8293df297) but there continues to be a test page with the name `AlertIOS` in RN-Tester. `AlertIOSExample.js` contains valid examples of how to use `Alert.prompt()` so it's worth keeping them around. Let's move those into `AlertExample.js` and remove `AlertIOSExample.js`. While we're here, let's do some extra fixes to the test page:
- Remove `showsIndividualExamples = true`. For whatever reason, I needed to remove this to show the examples properly...
- Convert all uses of `<TouchableHighlight>` with `<Pressable>`. The latter replaces the former, so I thought that made sense..
Some extra context:
In React Native macOS, we had forked `AlertIOS` into `AlertMacOS`, with a corresponding example page. This PR was made while working on removing those (https://github.com/microsoft/react-native-macos/pull/1548/).
## Changelog
[INTERNAL] [CHANGED] - Moved `Alert.prompt` examples into common rn-tester test page
Pull Request resolved: https://github.com/facebook/react-native/pull/35586
Test Plan:
Test page shows up fine on iOS .

Reviewed By: lunaleaps
Differential Revision: D41825889
Pulled By: NickGerleman
fbshipit-source-id: 82e4405b1f3a1ccb558b5a5038a90416e7a32c29
Summary:
We have the expected module name available as part of the codegen schema, so we can remove the need for developers to implement the `getName` method as part of their module implementation.
Note that this method is not actually used when the TurboModules infra is used, as the moduleName from the turbo module manager is passed through to the TurboModule base class instead. Moving the method to codegen will make it easier to remove this method altogether once the old architecture is fully removed.
Changelog: [Android][Added] Support generating `getName` in react-native-codegen for Java TurboModules
Reviewed By: mdvacca
Differential Revision: D41615387
fbshipit-source-id: 6b117645fa39e5e9ab014b21198496a52f6f2ae2
Summary:
This diff adds type parameters to all uses of `new Array`.
Changelog: [internal]
Reviewed By: SamChou19815
Differential Revision: D41746116
fbshipit-source-id: 8aa2777dd13ef4cd9f8613adaa3509d3573d4446
Summary:
Followup to D41654962 (https://github.com/facebook/react-native/commit/59ee57352738f030b41589a450209e51e44bbb06), it looks like the default parser here is something different, so not all newer JS syntax is correctly recognixed. Set the parser for JSX to babel/eslint-parser explicitly.
Changelog:
[General][Fixed] - Explicitly set parser for jsx in ESLint config
Reviewed By: motiz88
Differential Revision: D41708672
fbshipit-source-id: 362716ab0aadb7c9cf5fc9f1175b69168372df88
Summary:
`findPackageJsonFile` always returns a path even though `package.json` does not exist. This causes issues in libraries whose repo setups look like:
```
react-native-webview
├── android
│ └── build.gradle
├── example <-- Note the lack of `package.json` here
│ └── App.tsx
├── ios
│ └── RNCWebView.xcodeproj
├── macos
│ └── RNCWebView.xcodeproj
├── package.json
└── src
```
When `newArchEnabled=true`, running `yarn android` will fail with the following:
```
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:generateCodegenArtifactsFromSchema'.
> Could not create task ':app:generateCodegenSchemaFromJavaScript'.
> /~/react-native-webview/example/package.json (No such file or directory)
```
## Changelog
[Android] [Fixed] - `findPackageJsonFile` should return `null` if `package.json` does not exist
Pull Request resolved: https://github.com/facebook/react-native/pull/35566
Test Plan:
```
git clone https://github.com/react-native-webview/react-native-webview.git
cd react-native-webview
git checkout new-arch-ios
yarn
cd example/android
./gradlew clean assembleDebug
```
Reviewed By: NickGerleman
Differential Revision: D41739176
Pulled By: cortinico
fbshipit-source-id: cab0f1f717db160df244c9bb2769e345d6e19917