Summary:
**History:** This component was originally introduced into React Native core in D52712758, to replace UIManagerModule.showPopupMenu().
**Problem:** But, React Native core should be lean. Adding this component to React Native bloats the core.
**Changes:** So, this diff pulls PopupMenuAndroid out into its own package in the react-native GitHub repository.
In the future, this will be migrated to a community package!
Changelog: [Android][Removed] Move PopupMenu out of React Native core
Reviewed By: NickGerleman
Differential Revision: D53328110
fbshipit-source-id: 469d8dc3e756c06040c72e08fa004aafa1bd6e18
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: rshest
Differential Revision: D54027183
fbshipit-source-id: b87e3931642abaa22b84fd48f0504f36e9c3621f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43162
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: javache
Differential Revision: D54027181
fbshipit-source-id: af9f022d36a2e60788d6790525736d1b6cfdf6fa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43161
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future
changelog: [internal] internal
bypass-github-export-checks
Reviewed By: javache
Differential Revision: D54027187
fbshipit-source-id: a25024ba7f7d4893a2b7d083e2ba10c5f2e3a035
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future
changelog: [internal] internal
bypass-github-export-checks
Reviewed By: javache
Differential Revision: D54027182
fbshipit-source-id: 946dbf484119890658c68767916fcbf7c66996bc
Summary:
UIManagerListener interface is unstable and not recommended to be consumed externally, this API is likely to change in the future
changelog: [internal] internal
Reviewed By: cortinico
Differential Revision: D54028407
fbshipit-source-id: c8601451f117226f9e5a4d291307f4a0ac04a10f
Summary:
Those files should not stay in the root `/app` folder but inside the `/app/gradle/wrapper` folder.
I've noticed this in the Upgrade Helper UI hence I'm removing them.
Changelog:
[Internal] [Changed] - Remove accidental files included inside the template
Reviewed By: mdvacca
Differential Revision: D54122995
fbshipit-source-id: 8873a91ffbea20f609c7aabd428a815c77a38db5
Summary:
RN-Tester is currently instacrashing on fast-refresh (pressing r on Metro) as it ends up on `onJSBundleLoadedFromServer`
which throws an exception on Bridgeless mode. I'm fixing it by following the same logic as `onReloadWithJSDebugger`.
Changelog:
[Android] [Fixed] - Do not crash on onJSBundleLoadedFromServer when fast-refreshing on bridgeless mode
Reviewed By: huntie
Differential Revision: D54121838
fbshipit-source-id: 82d98ec0c5b2295f5751525368c956574dd7f3a0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43133
I noticed inconsistent handling of terminating newlines in D54006327@V1, and had also been noticing `yarn build` reformatting unrelated sections of `package.json` files.
For now, this logic isn't moved to a shared util, since there will likely be a higher level abstraction for the release scripts in the next batch of improvements.
Changelog: [Internal]
Reviewed By: lunaleaps, cipolleschi
Differential Revision: D54007565
fbshipit-source-id: 74d58362a85be4fae2f9e058b6c6622a026ff0a0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43157
IViewGroupManager is NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: rshest
Differential Revision: D54034058
fbshipit-source-id: ad317c73d45fdd801aeee65d5308400e2e1c8552
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43156
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future
changelog: [internal] internal
Reviewed By: javache
Differential Revision: D54027185
fbshipit-source-id: f3c337def2d42cf1f6fed2e2eb4938a84a51f8d4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43155
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future
changelog: [internal] internal
Reviewed By: arushikesarwani94
Differential Revision: D54027178
fbshipit-source-id: 37940ecec4d42f9f5ae7784a865564b0ef80f4a7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43159
Changelog: [internal]
This modifies the default `RCTAppDelegate` for iOS apps in OSS to provide an implementation for the C++ native module for feature flags.
In a following diff I'll replace the `React-featureflagsnativemodule.podspec` file with one that includes all built-in C++ native modules.
Reviewed By: RSNara
Differential Revision: D54082349
fbshipit-source-id: 8c4ed7499c6fd35916ba105edcae0e2c85961e1c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43152
Now that 0.74 has been cut, we can drop this warning and let the exception bubble up.
In https://github.com/facebook/react-native/pull/41509 we stopped masking this.
Changelog: [Android][Changed] Throwing IllegalArgumentException from ReactPackage is no longer suppressed
Reviewed By: cortinico, cipolleschi
Differential Revision: D54068429
fbshipit-source-id: c2f780ccfefabf2334c94b632bca93242af86008
Summary:
This diff renames React-Codegen to ReactCodegen. This way we'll no longer have to try both
```
#include <React-Codegen/MyModule.h>
```
and additionally
```
#include <React_Codegen/MyModule.h>
```
for cases with `use_frameworks`.
Changelog: [iOS][Breaking] - Rename React-Codegen to ReactCodegen
Reviewed By: cipolleschi
Differential Revision: D54068492
fbshipit-source-id: dab8ea2034d299266482929061caa14397421445
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43149
Changelog: [internal]
At the moment we're silently falling back to default values when trying to use common feature flags from JS when the native module isn't available. This could lead to unexpected behaviors and it's not immediately obvious, so this logs an error when it happens.
Reviewed By: javache
Differential Revision: D54063391
fbshipit-source-id: 5886754958930b88ef63c24d77a9e8486d92c731
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43135
This change makes the New Architecture the default on both iOS and Android.
This means that new application will be created using the New Architecture by default.
It is still possible to opt out from it.
## Changelog
[General][Changed] - Make the new architecture the default
Reviewed By: cortinico, sammy-SC, dmytrorykun
Differential Revision: D54006751
fbshipit-source-id: bd7de0814925b65ab180105e18c1f6f275ba2672
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43094
Merge the internal `cxxcdp-tester` project into `jsinspector-modern/tests`.
Note: These tests still use RN default feature flags and therefore test against the legacy CDP registry - that's addressed in the next diff.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D53766994
fbshipit-source-id: eec144124b20a4500e28398e98763febaed52748
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43143
AsyncCallback allows storing SyncCallback and invoking it from any thread.
However, there are cases where if you have a mix of sync and async callbacks - you might want to invoke them together in one go, instead of spreading them out across thread invocations.
For those cases - allow invoking any AsyncCallback as a sync one, prefixing it with "unsafe", because it's inherently not a safe operation to perform.
Changelog:
[General][Changed] - Allow invoking the AsyncCallback synchronously to allow for tight performance optimization.
Reviewed By: s-rws
Differential Revision: D54028850
fbshipit-source-id: f6729819f791f1d58d2ca655d4082547f18bdd2d
Summary:
`ndkVersion` is unset when building from source using this guide: https://reactnative.dev/contributing/how-to-build-from-source
## Changelog:
[ANDROID] [FIXED] - Fix `ndkVersion` is unset when building from source
Pull Request resolved: https://github.com/facebook/react-native/pull/43131
Test Plan:
```
git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version nightly
yarn
# Manually apply the patch in node_modules/react-native/ReactAndroid/build.gradle.kts
# Enable building from source
sed -i '' 's/#react.buildFromSource/react.buildFromSource/' example/android/gradle.properties
# Build
cd example/android
./gradlew assembleDebug
```
Reviewed By: christophpurrer
Differential Revision: D54006425
Pulled By: cortinico
fbshipit-source-id: 9ede64bc14af4cf609b7a4c12c5a1082bbc31f09
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43129
## Changelog:
[Internal] -
C++ side expects "source" property to be an up to date, correctly resolved Image source inside `ImageProps`.
Incidentally, it wasn't the case when:
* we build for an Android platform
* the asset is a "packager asset", i.e. bundled by Metro and included in APK
It hasn't been an issue in the case of "pure" Android platform, as it instead uses "src" prop, instead of source on the Java implementation side, ignoring "source" completely, so the fact that "source" wasn't propagated correctly to C++ in some cases didn't affect Android.
However, there are some new use cases where we'd like to have correct "source" value in C++ as well (and ultimately align this between all the platforms, so it's "source" everywhere, but this is a matter of a separate discussion).
Differential Revision: D54000899
fbshipit-source-id: 9bfb9e7c157cf19ddf396c141b03b75f3b2022e8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43130
Various fixes/tweaks to the `test-e2e-local` script, impacted by recent changes, found during the release process:
- Fix typo in variable name for `circleciToken` arg.
- Relocate erroneously positioned `process.exit` call (a force exit around Verdaccio, which we will remove in future).
- Add notice on exit around Verdaccio server not being killed successfully (to do in T179377112).
- Switch from Yarn to npm for test project installation — Yarn 3 is not respecting `npmRegistryServer`, see https://github.com/yarnpkg/yarn/issues/2508.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D53951606
fbshipit-source-id: f6e29ef6c9ab33ebf60124757576fcb54219f339
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43118
While debugging issues with precompiled_headers in Instagram, it became apparent that these RN files don't correctly import the necessary files to make them build on their own. Fix that!
Changelog: [iOS][Fixed] Fixed missing header imports
Reviewed By: fkgozali
Differential Revision: D53963676
fbshipit-source-id: 74e9758153f6176133475e45d27f7644d1a6dece
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43023
Unused mobile config, and is not consistently used across all the many places we can initialize a Hermes instance.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D53761942
fbshipit-source-id: a3e1adae87e41142c337a27b33750f82774cf92c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43114
Changelog: [iOS][Breaking]
PR#42628 introduced new behavior on how the react native infra tracks local notifications that start the app. in this PR, we are officially deleting the old implementation.
Reviewed By: ingridwang
Differential Revision: D52931617
fbshipit-source-id: 3b77479b0aacf239e45cfcc7d7c4b20e82e0b786
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43113
Changelog: [Internal]
Renames the "Page" concept in the modern CDP backend to "Host". Now all the Target types we have are named consistently after React Native concepts (ReactHost, ReactInstance, JSI Runtime) rather than CDP/browser concepts (Page).
Reviewed By: robhogan
Differential Revision: D53945333
fbshipit-source-id: 90e8b914ba8b4927806cbdd072ca36c78fd2093f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43049
This connects the OnLoad.cpp file used by OSS apps with the `rncli_cxxModuleProvider`.
This method is created by the CLI and takes care of querying all the TM CXX Modules discovered and returning them.
This PR is currently waiting on https://github.com/react-native-community/cli/pull/2296
Changelog:
[Internal] [Changed] - Hook the default-app-setup OnLoad.cpp file with the cxxModuleProvider from RNCLI
Reviewed By: cipolleschi
Differential Revision: D53812109
fbshipit-source-id: 47bc0ea699516993070cfa0127de97853acf8890
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43111
When mounting views in the interop layer, we register them in an array `reactSubview` that is added to `UIView`. However, when unmounting them, we were just removing them from the parent view.
This worked fine while the view we were adding to reactSubview was the same that we were adding to hierarchy. However, there are instances where libraries might wrap those views in some custom wrappers. This break the assumption that the same view we are adding to the UI hierarchy is the same view we will remove.
With this change, we make sure to use the same semantic when we add some view and when we remove it.
This also fixes a crash that happens with Mobile home when navigating away from the Ride's Map, using Fabric.
## Changelog
[internal] - Remove views from hierarchy using the view that is added to the `reactSubviews`
Reviewed By: sammy-SC
Differential Revision: D53943728
fbshipit-source-id: 56e669c14db74b6af683384b6ca72ad3f5cfdafe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43099
In all methods of FabricUIManager we check whether it's been destroyed before doing any logic, but we don't in this asynchronous method we're scheduling to report mounts.
This adds the check in that case as well to potentially fix some crashes we're seeing in current experiments for mount hooks on Android.
Changelog: [internal]
Reviewed By: sammy-SC
Differential Revision: D53920863
fbshipit-source-id: 3cc18cf5237d4866940739de80cc00604bcd0fb6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43070
**Context**
The `codegenNativeComponent` function is a hint for the codegen that the file that contains it is a Native Component spec. Static ViewConfig codegen overwrites this function call by the generated ViewConfig.
If this function is not overwritten by the codegen, it has runtime behaviour that falls back to `requireNativeComponent`. At the time when this system was built `requireNativeComponent` was not supported in Bridgeless mode because it is relied on some Bridge-only functionality. That's why it outputs error in Bridgeless mode.
---
This is not the case any more, we now have interop layers which provide the functionality needed by `requireNativeComponent`.
The SVC codegen is implemented as [Babel plugin](https://github.com/facebook/react-native/tree/main/packages/babel-plugin-codegen). The are scenarios when it is not run for the native component specs:
- If the plugin is not used for whatever reason.
- If Babel is not used for whatever reason.
In order to not to regress the DevX for such cases, we've turned the error into the warning.
**Note:** we use `console.info('⚠️...` instead of `console.warn('...`. That's because `console.warn` also prints a stack trace in the console, and we didn't want to create too much noise.
Changelog: [General][Changed] - codegenNativeComponent show warning and not error if not code generated at build time.
Reviewed By: huntie, rshest
Differential Revision: D53761805
fbshipit-source-id: c924c7668e6d2e45b920672b8a309221be767a73
Summary:
De-duplicate the logic for counting attachments.
This is a minor improvement in the context of my multi-PR work on https://github.com/react-native-community/discussions-and-proposals/issues/695.
## 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] [CHANGE] - De-duplicate the logic for counting attachments
Pull Request resolved: https://github.com/facebook/react-native/pull/42596
Reviewed By: rshest
Differential Revision: D53917281
Pulled By: cipolleschi
fbshipit-source-id: cdb9bc834bddd7deffc60f33578464733982fedf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43105
This is a quality of like improvement for the project we create for the final users.
Codegen generates code in `rncore`, within `node_modules`. This is not the perfect approach but it is working so far.
To make it more robust, we added a small script in React-Fabric podspec to check that codegen run properly when building.
In this way, if a user run `yarn install` and, for any reason, react-native is regenerated, we can provide a better DevX to our users with an actionable message on how to fix the build problem.
##Changelog
[iOS][Added] - Add error message if codegen has not run properly
Reviewed By: cortinico
Differential Revision: D53927788
fbshipit-source-id: a01a33086e4a0a1b0ada6c83283a5fd3fb5ee3eb