Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35028
**This Diff require a bump in the react-native-codegen (including this [commit](https://github.com/facebook/react-native/commit/7680bdeb4f96a8092393372a59c77a9d7b729cae)) to work**
This diff sets up iOS and Android to pass their platform to the codegen so that we can have platform-specific specs.
## Changelog
[General][Added] - Enable platform-specific Codegen Specs
Reviewed By: cortinico
Differential Revision: D40516395
fbshipit-source-id: 0624f0bfb93c90f78131a605a4847e780783bbaf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35154
This diff bumps the codegen to v0.71.1, preparing it for the branch cut.
## Changelog
[General][Changed] - Bump codegen version
Reviewed By: dmytrorykun
Differential Revision: D40852498
fbshipit-source-id: ba1dc87f3726bc27cbd176f160c62a0bdc291433
Summary:
## Summary
This PR extracts the content of the codegen case `'Float'` into a single `emitFloat` function inside the `parsers-primitives.js` file and uses it in both Flow and TypeScript parsers as requested on https://github.com/facebook/react-native/issues/34872. This also adds unit tests to the new `emitFloat` function.
## Changelog
[Internal] [Changed] - Extract the content of the case 'Float' into a single emitFloat function
Pull Request resolved: https://github.com/facebook/react-native/pull/35124
Test Plan:
Run `yarn jest react-native-codegen` and ensure CI is green

Reviewed By: rshest
Differential Revision: D40828746
Pulled By: cipolleschi
fbshipit-source-id: 9c7cecf7268f16aaef29065c1983ad9a4dd18dbe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35094
Currently the build on console is firing this warning:
```
> Task :app:processDebugMainManifest
package="com.androidtemplateproject" found in source AndroidManifest.xml: /tmp/AndroidTemplateProject/android/app/src/main/AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.
```
This diff fixes it so users won't see it anymore on 0.71
Changelog:
[Android] [Fixed] - Sets the namespace via Gradle and not via AndroidManifest
Reviewed By: cipolleschi
Differential Revision: D40724654
fbshipit-source-id: 9b01748a22e9993b60e17bf25acbc68ba8e4eb77
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35117
This mimics some behavior we have in Android that allow uesers to turn on selectively TM and Fabric.
Notice that if fabric is enabled, TM must be enabled as well, otherwise the app won't work
## Changelog
[iOS][Added] - Added the possibility to selectively enable TM and Fabric with the new Architecture
Reviewed By: cortinico
Differential Revision: D40794328
fbshipit-source-id: b7fc7bb819d05566dcd335832cab224f80b23346
Summary:
This PR is a task from https://github.com/facebook/react-native/issues/34872:
> Extract the UnsupportedFunctionParamTypeAnnotationParserError in its own throwing function (if it does not exists already) and reuse that function passing a proper type. Then, refactor the code using a dictionary and avoiding the three different ifs in both parsers.
## 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
-->
[Internal] [Changed] - Extract the UnsupportedFunctionParamTypeAnnotationParserError in its own throwing function in error-utils
Pull Request resolved: https://github.com/facebook/react-native/pull/35057
Reviewed By: lunaleaps
Differential Revision: D40721099
Pulled By: cipolleschi
fbshipit-source-id: af5e4cd275d0049047d35660559b94a27e660e40
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35108
I've rewritten the comment in the android/app/build.gradle.
They were really old, contained wrong links and most of the people ignored it.
I've also moved the enabling of Hermes to the `gradle.properties` file.
RNGP still supports the old method, but we must be sure that we notify
library authors if they were reading project.ext.react.enableHermes in the past
(also the website needs to be updated).
I've also cleaned up the CircleCI setup as now we can specify Hermes enabled/disabled
via the CLI (this will also make easier to do e2e testing).
Changelog:
[Android] [Changed] - Cleanup the template documentation after RNGP & hermesEnabled to gradle.properties
Reviewed By: cipolleschi
Differential Revision: D40762872
fbshipit-source-id: 2c09245e0a923faac53cc6c8a89e99788ae47f8a
Summary:
Just bumping RNGP to make the new sources avialable to the template.
Changelog:
[Internal] [Changed] - Bump RNGP to 0.71.7
Reviewed By: cipolleschi
Differential Revision: D40760927
fbshipit-source-id: 909c88377a231ea6678c6af14c5594fdc4830b79
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35095
This change will make sure that we load the correct JS engine at runtime,
by using the BuildConfig flag that RNGP sets for us.
This will solve a lot of noise in adb logcat for users seeing
stacktraces mentioning failing to load `jscexecutor` library.
This is also a breaking change, but as the API was not widely used nor
advertised in the template, we should be fine by just mentioning this in the release notes.
Changelog:
[Android] [Changed] - Update the template to load the correct JS engine at runtime
Reviewed By: cipolleschi
Differential Revision: D40710597
fbshipit-source-id: d59a7a52b22a9bf273ea89094c6620c3ecf6eb00
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35101
Those CMake variables are effectively unused now. They're raising a warning on CMake builds
of templates + let's not expose them as we haven't released RNGP yet, before libraries
or other tools start relying on them.
Changelog:
[Internal] [Changed] - RNGP - Do not set GENERATED_SRC_DIR and REACT_ANDROID_BUILD_DIR
Reviewed By: cipolleschi
Differential Revision: D40751998
fbshipit-source-id: 13f54a6247e4734c21c263f8b1e6b4b9e8ba406c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35100
That's just a minor bump of AGP before the branch cut.
Changelog:
[Android] [Changed] - Bump AGP to 7.3.1
allow-large-files
Reviewed By: cipolleschi
Differential Revision: D40752006
fbshipit-source-id: 4856bc7ca275cf46d3afcc7c24928c5f1d5e6e33
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35092
As we're close to the cut of the 0.71 branch, I'll take the opportunity to polish
our Gradle public API.
We're exposing a mixture of Path (String) and File (java.io.File or RegularFileProperty).
Here I've moved everything to use File as it's more configurable for the users,
specifically if they're using monorepos or other setup.
This also allows us to remove the resolution logic for the cliPath.
Changelog:
[Internal] [Changed] - RNGP - Use the File Api to specify cliPath and remove ComposeSourceMap path
Reviewed By: cipolleschi
Differential Revision: D40710595
fbshipit-source-id: a17095eebae5123b70fd2b8e3d512656817006ca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35091
This diff refines the DefaultNewArchitectureEntryPoint to make it easier for user to
either turn on Fabric, TurboModules or both.
Changelog:
[Internal] [Changed] - Make it easier for user to toggle only Fabric or TurboModules in New Architecture
Reviewed By: cipolleschi
Differential Revision: D40710596
fbshipit-source-id: 236060b2ebccb1bf25e7f5c0fc15f54c5ce5f608
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35093
It turns out that using the Artifacts API to manipulate the APK to remove
.so has unintended side effects and is causing the `installDebug` and `installRelease`
commands to fail.
I've resorted to register a packaging option for each variant to make sure we include only
the correct artifacts we want.
This should fix the current startup crash that is experienced on main.
Changelog:
[Android] [Fixed] - RNGP - Do the .so cleanup using pickFirst and exclude
Reviewed By: cipolleschi
Differential Revision: D40722285
fbshipit-source-id: 982e1e9c474522fc4419c969ede5ee14e5404f3a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35083
We don't need to `enableCodegenInApps` keys but we can instead rely on the
existence of the `codegenConfig` key inside the `package.json` to decide if
Codegen should run in App modules or not.
Changelog:
[Internal] [Changed] - RNGP - Remove enableCodegenInApps and infer it from package.json
Reviewed By: cipolleschi
Differential Revision: D40687079
fbshipit-source-id: cd4a6c67caa19c1d199ae75388a0551339f876a0
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872.
This PR contains two changes, extracting the visitor object and then factoring out the `getConfigType()` function to the `parsers/utils.js` file. Then we can reuse the same function in both flow and typescript by passing the extracted visitor object.
## Changelog
[Internal] [Changed] - Extract visitor object in the same file and factor out `getConfigType()` to `parsers/utils.js`.
Pull Request resolved: https://github.com/facebook/react-native/pull/35035
Test Plan: Output of `yarn jest react-native-codegen` ensures all passed test cases
Reviewed By: cortinico
Differential Revision: D40548855
Pulled By: cipolleschi
fbshipit-source-id: 310b8565322a4e4800a3fffc67479a9dfa45d620
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35089
Changelog:
[General][Fixed] - Back out "Add enum example to Android/iOS rn-tester TurboModule"
This broke the rn-tester adding due to an invalid flow-enum setup. Needs further investigation
Reviewed By: cipolleschi
Differential Revision: D40714320
fbshipit-source-id: 9831276762f90df0ffaca3304382fe5925009343
Summary:
This pull request migrates the activity indicator example to using React Hooks.
## Changelog
[General] [Changed] - RNTester: Migrate ActivityIndicator to hooks
Pull Request resolved: https://github.com/facebook/react-native/pull/35071
Test Plan: The animation works exactly as it did as when it was a class component
Reviewed By: jacdebug
Differential Revision: D40698379
Pulled By: NickGerleman
fbshipit-source-id: 08b275fcc4e3a10b5872e0031fa2ecce5360a7b9
Summary:
fd91748146 added a condition not to pump an extra message when we didn't see symbolication warnings (which do not seem to show up in a stock internal build), but I missed that the test specific to RCTLogLevelError checked for string containment instead of equality, and the last assertion we process on log level is incorrect in OSS as a result.
Changelog:
[Internal][Fixed] - Fix RCTLoggingTests in OSS
Pull Request resolved: https://github.com/facebook/react-native/pull/35085
Test Plan:
`test_ios-Hermes` passes again in OSS: https://github.com/facebook/react-native/pull/35085 (JSC and Android failures look unrelated)
RCTLoggingTests still pass running `buck test //xplat/js/react-native-github/packages/rn-tester:RNTesterIntegrationTests`
Reviewed By: rshest
Differential Revision: D40699773
Pulled By: NickGerleman
fbshipit-source-id: 5acc8ec2b26a1f9acac2f070b85f1d65ee15a011
Summary:
Without this, the CocoaPods output would display multiple "Building RNTester..." logs. With these changes, we make it clear that these are separate targets that are being configured.
Changelog: [internal]
Reviewed By: mdvacca, cipolleschi
Differential Revision: D40656813
fbshipit-source-id: a317112e804d08b9e64e2d62e8b27e4045b317b0
Summary:
Some portions of continuous test runs RNTesterIntegrationTests will hang for an hour when running in Sandcastle without outputting anything. Locally debugging, I see a deadlock waiting on a semaphore, where the test assumed an extraneous symbolication warning would be fired.
This change makes it so that we only look for the extraneous messages if we haven't already seen the target message, since they do not seem to show up in local testing. I also added assertions per semaphore that the log statement is propagated within a still very gracious 10 seconds. This means we still can see what tests are running/failing if this test has issues, instead of a deadlocked test runner with no output.
Changelog:
[Internal][Fixed] - Fix deadlock in RCTLoggingTests
Reviewed By: cipolleschi
Differential Revision: D40667275
fbshipit-source-id: ab78f3c2ef47e2fd740b1dad2a65912e9542301d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35075
This diff updates the New App template for Android to use the React Native Gradle Plugin.
With this we can:
1. Get rid of all the C++ code.
2. Remove a lot of New Architecture logic in the build.gradle
3. Reuse the prebuilts of React Native/Hermes via prefab
Changelog:
[Android] [Changed] - Update the template to use RNGP
Reviewed By: cipolleschi
Differential Revision: D40673732
fbshipit-source-id: 70935248993d1e24904c982e75f12ad580faa9d8
Summary:
The `typeof X` type annotation now respects the initialization state of `X`: if `X` hasn't been declared it will be an error to get its type.
Changelog: [Internal]
Reviewed By: jbrown215
Differential Revision: D40638870
fbshipit-source-id: 57459dec30ec5b87397365a709f2d846c87e378a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35036
This diff is the base to create a polimorphic behavior for TypeScript and Flow parser. This type will allow to share a lot of code between the parsers and also to keep their differences a part.
It will be the base diff/PR for further tasks in the Codegen umbrella Issue
## Changelog:
[General][Added] - Parser interface to divide parser logic.
Reviewed By: cortinico
Differential Revision: D40548707
fbshipit-source-id: e632ba52b00b43e50306e3a792a841e72e8c07f4
Summary:
Bumping RNGP to make sure all the changes are available for 0.71
I've also removed the caret from react-native's package.json as
I don't want .5 to be used by template tests yet.
The Android template needs to be updated in order to use
that version of the Gradle plugin.
Changelog:
[Internal] [Changed] - Bump react-native-gradle-plugin to 0.71.5
Reviewed By: cipolleschi
Differential Revision: D40642114
fbshipit-source-id: 70359efc3d2300e9c04c1b361c45061fd1c2931b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35067
I accidentally broke test_android by landing a diff without waiting for
the full CI output.
Changelog:
[Internal] [Fixed] - Unbreak test_android by passing the correct file to hermesc
Reviewed By: cipolleschi
Differential Revision: D40638239
fbshipit-source-id: 1d03106f3b144f537265910df095a6023b181d85
Summary:
As pointed out by necolas on https://github.com/facebook/react-native/issues/34424#issuecomment-1261482517 we forgot we add the `role` prop mapping to the `Text` component. This PR adds a new `role` prop to `Text`, mapping the web `role` values to the already existing `accessibilityRole` prop and moves the `roleToAccessibilityRoleMapping` to a common file that can be imported by both the `Text` and `View` components as requested on https://github.com/facebook/react-native/issues/34424. This PR also updates the RNTester AcessebilityExample to include a test using this new prop.
## Changelog
[General] [Added] - Add role prop to Text component
Pull Request resolved: https://github.com/facebook/react-native/pull/34976
Test Plan:
1. Open the RNTester app and navigate to the Accessibility Example page
2. Test the `role` prop through the `Text with role = heading` section
Reviewed By: yungsters
Differential Revision: D40596039
Pulled By: jacdebug
fbshipit-source-id: f72f02e8bd32169423ea517ad18b598b52257b17
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35063
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.
Here I'm add Variant support to RNGP via the Variant API from AGP 7.x
A short summary of changes:
- I've pushed a number of breaking changes to ReactExtension (we should document them in the release notes). Specifically I've removed properties which I believe were unnecessary and confusing
- I've removed all the extra logic to do the .so cleanups and use the new tasks that use the Artifacts API
- I've introduced only a `debuggableVariants` to make all the decisions for the bundling and minification which should be sufficient for users
- I've removed all the funcional interfaces are replaced them with lists as they're easy to handle and understand for users.
Changelog:
[Android] [Changed] - Added Flavor Support to React Native Gradle Plugin (RNGP)
Reviewed By: cipolleschi
Differential Revision: D40335028
fbshipit-source-id: d9ac1437de8a27db2e93df15b13772b221e036b2
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.
I'm extending RNGP to do autoconfiguration of dependencies for React Native and Hermes Engine using the Utils classes which were introduced before.
Changelog:
[Internal] [Changed] - RNGP - Automatically Configure Dependencies for ReactNative & Hermes
Reviewed By: cipolleschi
Differential Revision: D40633487
fbshipit-source-id: d4240987a9400fff2ec2aff2d13afc5b24778598
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.
Historically we used to enable the codegen only for library modules. This is not working well for apps like RN Tester which don't have library modules but are running the codegen.
Therefore I'm introducing the `enableCodegenInApps` that is allowing apps to turn off the codegen if needed.
Changelog:
[Internal] [Changed] - RNGP - Introduce enableCodegenInApps
Reviewed By: cipolleschi
Differential Revision: D40633106
fbshipit-source-id: dc2ae9bbfe5b7940f9e9fe505ab2198a42c8a3f6
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.
Here I'm renaming the top level property to enable hermes from `enableHermes` to `hermesEnabled`. We have a bunch of other properties which are called *Enabled. This one was following a different convention.
I'm retaining the backward compatibility for users using `project.ext.react.enableHermes` so this is not going to be a breakign change.
Changelog:
[Internal] [Changed] - RNGP - Top level property enableHermes -> hermesEnabled
Reviewed By: cipolleschi
Differential Revision: D40633109
fbshipit-source-id: 9d7efad6cb3bb382d1beb56966795a3f42bdaae6
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.
Here I'm creating a new task BundleAndHermesCTask that is variant-aware.
Historically we had problems with the Bundle and the Hermes task being separated and overriding their own output. Consolidating those two steps in a single one will make it easier to support seaprate variants.
I'm going to use this task in a subsequent diff.
Changelog:
[Internal] [Changed] - RNGP - Introduce the BundleAndHermesCTask
Reviewed By: cipolleschi
Differential Revision: D40633108
fbshipit-source-id: 89f6d32ef219626ed5d4c5a0b8ac804c6704b2d6