Summary:
This diff refactors performance memory API and the RN Tester example.
- The returned value from C++ is number, so no need to cast
- Reuse `MemoryInfo` in RNTester example
Changelog:
[General][Internal] - Code refactor for performance memory API implementation
Reviewed By: rubennorte
Differential Revision: D43523878
fbshipit-source-id: 37d1f6a829a8eac45f7e3791ad36be0c199c6041
Summary:
Reland of https://github.com/facebook/react-native/issues/35319 with a fix for custom pull to refresh components.
Custom pull to refresh component in fabric will need to conform to the `RCTCustomPullToRefreshViewProtocol` protocol, this way we know that the view is a pull to refresh and not the content view.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[IOS] [ADDED] - Add fabric support for maintainVisibleContentPosition on iOS
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/36095
Test Plan:
This will need to be tested internally in the product the crash happened.
Take a local build of Wilde open Marketplace.
Reviewed By: jacdebug
Differential Revision: D43128163
Pulled By: cipolleschi
fbshipit-source-id: 6cf8ddff92aeb446072a3d847434e21b9e38af61
Summary:
This is a change we have implemented in React Native macOS that I am now upstreaming: https://github.com/microsoft/react-native-macos/pull/1257
The library `ocMock` is currently imported as a checked in binary by RN-Tester to help run unit tests on iOS. That binary is only compiled for x86 on macOS, which meant we could not run tests on M1 / M2 Macs. Switching it so that we import from source as a pod should make maintenance easier for both iOS and macOS! :)
Original change notes:
>Previously, we've been unable to test RNTester for macOS on an M1 machine. This is because we were using a framework that was prebuilt for Intel architecture, so the test components would fail to build.
>
> The fix is to build OCMock from source directly instead of using a prebuilt version.
>
> This is only necessary on macOS. The iOS version is already built for ARM architecture, as iOS devices have been running exclusively on ARM for a while now.
## Changelog
[INTERNAL] [CHANGED] - Import OCMock as a pod
Pull Request resolved: https://github.com/facebook/react-native/pull/36239
Test Plan: CI should pass as it did before.
Reviewed By: dmytrorykun
Differential Revision: D43732219
Pulled By: cipolleschi
fbshipit-source-id: 028b5a7f384042145bf1966c8c2730d7437940ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36360
This change is the iOS equivalent of D43731219 (https://github.com/facebook/react-native/commit/ab55e123da8749d982964f2aee6ce6b0bffdc7fc), but only for what concerns the RNTester example as the interop layer was already present in the codebase and exposed to the OSS.
## Changelog
[internal] - Add example on how to consume a Legacy component in Fabric with the interop layer
Reviewed By: cortinico
Differential Revision: D43735699
fbshipit-source-id: 6cb5a3591e7e4a606c274566226025af91849c16
Summary:
This diff adds the `performance.reactNativeStartupTiming` API to the performance global object for RN. This property does not exist in web, and we are free to make up our own list of properties in the startup metrics to track RN app startup process. In our case, we have the following six properties to begin with (we may extend and add more to this list in the future):
```
- `(start|end)Time`: The time ‘zero’ for the startup timing and the end of app startup. RN has no knowledge of app start time, which will be provided by the platform. The `endTime` will be the time when the first JS bundle finishes executing (Note that RN supports multiple JS bundles, which can be loaded async)
- `executeJavaScriptBundleEntryPoint(Start|End)`: The time for RN to execute the JS entry point (and finish all sync job)
```
Changelog:
[General][Added] - Add new JS performance API to support getting RN app startup timings
Reviewed By: rshest
Differential Revision: D43326564
fbshipit-source-id: 7b4c7cae70ff64ba1714a1630cd5e183df6c06b0
Summary:
Part of Umbrella https://github.com/facebook/react-native/issues/34872
> [**Codegen 84** - assigned to Pranav-yadav] It depends on [Codegen 83] export the parseModuleName anonymous function (Flow, TypeScript) in a common parseModuleName function in the parsers-commons.js file.
- merged Parse Module-Name _**anon**_ fn of `Flow` & `TS` parsers; into a common `parseModuleName` fn in the `parsers-commons.js`
- added **tests** for `parseModuleName` fn from `parsers-commons.js`
- added `callExpressionTypeParameters` method to **_parsers_**
- added **tests** for `callExpressionTypeParameters` method of _parsers_
- used `parser.callExpressionTypeParameters` method in `parseModuleName` fn
PS: fixed merge conflicts several times :(
Overall :)
## Changelog
[INTERNAL] [CHANGED] - Merge Parse-Module-Name anon fn of `Flow` & `TS` and add `callExpressionTypeParameters` method to **_parsers_**
Pull Request resolved: https://github.com/facebook/react-native/pull/36297
Test Plan: - `yarn lint && yarn run flow && yarn test react-native-codegen` ==> ✅
Reviewed By: rshest
Differential Revision: D43694563
Pulled By: cipolleschi
fbshipit-source-id: 99cf40ada0a567cd9ff91078f66fd4ac3684f7cc
Summary:
This will publish several changes we have pending on main, specifically changes to React Native Gradle Plugin which are needed to unblock nightlies.
#publish-packages-to-npm
## Changelog
[INTERNAL] - Bumping all the changes we have on main
Pull Request resolved: https://github.com/facebook/react-native/pull/36355
Test Plan: n/a
Reviewed By: hoxyq
Differential Revision: D43733634
Pulled By: cortinico
fbshipit-source-id: 9c041f7557cd8e494dfc942ae89e13e55353bb48
Summary:
This adds the `UnstableReactLegacyComponentDescriptor`, part of the Fabric Interop Layer for Android.
Summary of the changes are:
* Expose a new `rrc_legacyviewmanagerinterop` native module via prefab
* Extend default App Cmake setup so `rrc_legacyviewmanagerinterop` is exposed by default
* Add a sample legacy component inside RN Tester
Changelog:
[Internal] [Changed] - Expose UnstableReactLegacyComponentDescriptor inside react/renderer/core
Reviewed By: cipolleschi
Differential Revision: D43731219
fbshipit-source-id: ee26d7e9d7eff5ef6a3e22853f8ea363b9198567
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36344
This adds the `UnstableReactLegacyComponentDescriptor`, part of the Fabric Interop Layer,
inside the `react/renderer/components/legacyviewmanagerinterop` module so that it can be included by the user externally.
If we wish to place it somewhere else, I'm more than happy to move it around.
Changelog:
[Internal] [Changed] - Expose UnstableReactLegacyComponentDescriptor inside react/renderer/components/legacyviewmanagerinterop
Reviewed By: mdvacca, cipolleschi
Differential Revision: D43500868
fbshipit-source-id: acfcd89efc42ff7a4ee6cb0a1cbd71d69f79721f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36341
See https://github.com/react-native-community/discussions-and-proposals/issues/602 for more context.
TL;DR: this flag is used for an edge case. We should not expose it to every users but move it to a guide.
I'll publish a guide on the website on how to achieve the same feature.
Changelog:
[Android] [Changed] - Remove the enableSeparateBuildPerCPUArchitecture from the template entirely
Reviewed By: cipolleschi
Differential Revision: D43695574
fbshipit-source-id: a4f2df755f1d7bd0319a8e418c4ce96b541009ed
Summary:
VirtualizedList refactoring moved [a call of `_updateViewableItems`](https://www.internalfb.com/code/fbsource/[a9d4ad3cf149][history][blame]/xplat/js/react-native-github/Libraries/Lists/VirtualizedList.js?lines=1431-1447) to the inside of a state update.
This call may trigger an `onViewableItemsChanged`, which is normally not an issue (minus changing timing), but creates problems if the users callback then calls imperative methods on the VirtualizedList, since the batched state update may be in the process of changing the props/state the imperative method is reading. See https://github.com/facebook/react-native/issues/36329 for what I suspect is an example of this.
This moves the `_updateViewableItems` call to before the state update, like the previous version of VirtualizedList.
Changelog:
[General][Fixed] - Avoid VirtualizedList viewability updates during state updates
Reviewed By: javache
Differential Revision: D43665606
fbshipit-source-id: 9398273c5209e371e69aafb02bac173c69874273
Summary:
This PR is task 74 from https://github.com/facebook/react-native/issues/34872:
> Move getTypes functions from utils.js to specific Parsers. Right now we have two Parser classes that takes care of the language specific details and two utils files that contains similar logic. We would like to move everything under the Parsers classes for better OOP architecture and to encourage code-reuse.
## 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] - Replace getTypes functions with parser specific methods
Pull Request resolved: https://github.com/facebook/react-native/pull/36225
Test Plan: I tested using Jest and Flow commands.
Reviewed By: rshest
Differential Revision: D43453454
Pulled By: cipolleschi
fbshipit-source-id: 0eebcb55e1af3319e2c35bb462980046329a2c09
Summary:
Changelog: [Internal] - Remove all imports back to CJS for changelog in 0.72
We are reverting these imports as it may regress perf as we don't have a recommended inlining solution for ES modules at the current time.
Reviewed By: NickGerleman
Differential Revision: D43630911
fbshipit-source-id: ff3bb80009f327c4d51dad21f2cd287ce46d5964
Summary:
This is just a minor bump before 0.72 and it brings AGP up to date
with the latest stable.
allow-large-files
Changelog:
[Internal] [Changed] - AGP to 7.4.2
Reviewed By: cipolleschi
Differential Revision: D43659180
fbshipit-source-id: d57ea8fb6ae902412b542e0125d3b15168d0e123
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36321
This change bumps Cocoapods to 1.12.0. This last release fixes a bug for which cocoapods was not working with Ruby 3.2.0
## Changelog
[iOS][Changed] - Bumbed version of Cocoapods to support Ruby 3.2.0
Reviewed By: blakef
Differential Revision: D43655787
fbshipit-source-id: 6954ac8271daa7894e57f6d6104ed4d549490695
Summary:
## Changelog:
[Internal] - Refactor Android/iOS/C++ TurboModule examples
~~This makes sure that both native and pure C++ (NativeCxx) TurboModule examples could be run from the Catalyst app.~~
EDIT: See the discussion - this removes the `Playground (NativeModules)` app from Catalyst, as it's already available from the `RNTester Browser` and doesn't provide the C++ counterpart.
Also, there are some tweaks and code factoring in styles, to make it all fit on the screen nicely.
Reviewed By: javache
Differential Revision: D43605250
fbshipit-source-id: 44ee694660f3ad524b8362149ebe617ee495225e
Summary:
Both Android and iOS allow you to set application specific user interface style, which is useful for applications that support both light and dark mode.
With the newly added `Appearance.setColorScheme`, you can natively manage the application's user interface style rather than keeping that preference in JavaScript. The benefit is that native dialogs like alert, keyboard, action sheets and more will also be affected by this change.
Implemented using Android X [AppCompatDelegate.setDefaultNightMode](https://developer.android.com/reference/androidx/appcompat/app/AppCompatDelegate#setDefaultNightMode(int)) and iOS 13+ [overrideUserInterfaceStyle](https://developer.apple.com/documentation/uikit/uiview/3238086-overrideuserinterfacestyle?language=objc)
```tsx
// Lets assume a given device is set to **dark** mode.
Appearance.getColorScheme(); // `dark`
// Set the app's user interface to `light`
Appearance.setColorScheme('light');
Appearance.getColorScheme(); // `light`
// Set the app's user interface to `unspecified`
Appearance.setColorScheme(null);
Appearance.getColorScheme() // `dark`
```
## Changelog
[GENERAL] [ADDED] - Added `setColorScheme` to `Appearance` module
Pull Request resolved: https://github.com/facebook/react-native/pull/36122
Test Plan:
Added a RNTester for the feature in the Appearance section.
Three buttons for toggling all set of modes.
Reviewed By: lunaleaps
Differential Revision: D43331405
Pulled By: NickGerleman
fbshipit-source-id: 3b15f1ed0626d1ad7a8266ec026e903cd3ec46aa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36269
This bumps our project to build on Gradle 8.x
All the necessary issues have already been resolved so everything should be green.
Gradle version has been bumped also inside the template and RNGP.
Changelog:
[Android] [Changed] - Bump Gradle to 8.x
allow-large-files
Reviewed By: cipolleschi
Differential Revision: D43534184
fbshipit-source-id: ca1fd6799ff6d776743de2b2d809fc54bc533440
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36311
Currently, we get the apiVersion/languageVersion for Kotlin that Gradle carries over.
So what happens is that on older version of Gradle, we try to compile RNGP with older versions of Kotlin.
There we have some functions missing (like `.uppercase()`) and the user will fail to build because of this.
Here I'm setting `apiVersion` and `languageVersion` to Kotlin 1.5. Even if we compile with Kotlin 1.7,
the compiler will make sure our code is compatible to be executed in a Kotlin 1.5 environment.
Fixes#36246
Changelog:
[Internal] [Changed] - RNGP - Add apiVersion/languageVersion to 1.5
Reviewed By: cipolleschi
Differential Revision: D43621083
fbshipit-source-id: d74700ff7ef7ac9691965626c2bd0128459fec9b
Summary:
This change updates the Offline mirrors so that the `react-native-oss-ios` jobs pass.
It also updates the legocastle script so that it won't check for a specific version of Ruby as right now we decided to support multiple versions.
allow-large-files
## Changelog
[internal] - update iOS mirrors and legocastle
Reviewed By: cortinico, rshest
Differential Revision: D43619512
fbshipit-source-id: dcd95318de72e0dca159da98ead0ef0f375197c1
Summary:
This PR fixes the initialization path of RNTester when it is run with the Old Arch and Fabric enabled
## Changelog
[iOS][Fixed] - Make sure to initialize the contextContainer in the Old Arch with Fabric enabled
Pull Request resolved: https://github.com/facebook/react-native/pull/36283
Test Plan:
Tested manually on RNTester
CircleCI is green
Reviewed By: sammy-SC
Differential Revision: D43568205
Pulled By: cipolleschi
fbshipit-source-id: cddba97629b542a044191da14221f3300a9d879f
Summary:
Task from https://github.com/facebook/react-native/issues/34872
> [Codegen 82] Move isModuleInterface function (Flow, TypeScript) to the Flow and TypeScript parsers.
## Changelog
[INTERNAL] [CHANGED] - Moved isModuleInterface function to to the Flow and TypeScript parsers.
Pull Request resolved: https://github.com/facebook/react-native/pull/36268
Test Plan: ` yarn test react-native-codegen`
Reviewed By: christophpurrer
Differential Revision: D43535948
Pulled By: rshest
fbshipit-source-id: 7a2db05008783499168b0ce3fa58fedbac2b4e79
Summary:
Add performance API example to RN tester, start with the `performance.memory` API.
- Update `RNTesterList` file for both android and ios
Changelog:
[General][Internal] - Add `performance.memory` API example to RNTester
Reviewed By: rshest
Differential Revision: D43326565
fbshipit-source-id: adeb18ce9f1f90d9e9ecf66b533307028bc02df8
Summary:
changelog: [internal]
Move initialisation to `init` function. This allows subclasses of `RCTAppDelegate` to use new architecture when overriding `didFinishLaunchingWithOptions`
Reviewed By: cipolleschi
Differential Revision: D43535602
fbshipit-source-id: 32adb5416e67a63ad168f0ed2480287bf178a6a6
Summary:
Opts `fbsource//xplat/js/react-native-github/packages/rn-tester:RNTesterIntegrationTests` out of Buck2 runs as the target fails in the analysis stage due to some flavor issues.
I did experiment with just resolving the flavor issues but several more nontrivial issues show up in the build graph the deeper you go and I think this target is going to require a bit more of a deep dive, so just disabling it to unblock buck2 CI rollout for now.
Reviewed By: bujar
Differential Revision: D43505883
fbshipit-source-id: 672dc6aea345a8c0396f6a0e3d549016fe1f7c45
Summary:
When developing the changes to support `use_frameworks!`, I may have forgotten to update the script that generate the `FabricComponentProvider` for the open source (and I may have changed directly that file manually to make everything work).
This change restore the generator, using the right `#import statement`
allow-large-files
## Changelog
[internal] - Update plugin generator
Reviewed By: arushikesarwani94
Differential Revision: D43504184
fbshipit-source-id: a89455b62115f6dc2054f804241fd3834056f1b3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36253
Another build warning that got converted into a failure in Gradle 8.x
Specifically here as we're running 4 native builds in parallel for RN Tester, but they all originate
from 2 CMake intermediates files (one set for Debug and one for Release), Gradle raises a warning.
Here I'm fixing this warning by specifying an explicit ordering between those tasks.
Changelog:
[Internal] [Changed] - Gradle 8.x prep - specify task dependency between mergeNativeLibs and external native builds
Reviewed By: cipolleschi
Differential Revision: D43501128
fbshipit-source-id: bb40ae902157ce97683f42124ec65f2bc0d73405
Summary:
I'm widening the exclude for GenerateCodegenSchemaTask input files.
This is needed before we can migrate to Gradle 8.x as one of the build warning we have is
now converted to a build failure.
The reason why this is needed is because GenerateCodegenSchemaTask ends up picking up a file that
gets generated by `react-native bundle`. While the file is ignored by the Codegen, Gradle
detects a clash between the two tasks.
This solves the issue completely.
Changelog:
[Internal] [Changed] - RNGP - GenerateCodegenSchemaTask should exclude all of `**/build/[generated|intermediate]**`
Reviewed By: cipolleschi
Differential Revision: D43501129
fbshipit-source-id: 49311b833d6b59d4e67e87c535a424a1db1321e6
Summary:
I noticed this stale directory and snapshot tests for RN-Tester. We might as well just remove them.
## Changelog
[INTERNAL] [REMOVED] - Remove more tvos remnants
Pull Request resolved: https://github.com/facebook/react-native/pull/36240
Test Plan: CI should pass.
Reviewed By: cipolleschi
Differential Revision: D43495264
Pulled By: cortinico
fbshipit-source-id: 7286cf6805e12249db5d71bcaa9a91bc947102ca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36227
This is needed for the next Gradle major (8.x) and re-aligns us with the
Kotlin version in fbsource
Changelog:
[Android] [Changed] - Kotlin to 1.7.22 for Gradle
allow-large-files
Reviewed By: rybalkinsd
Differential Revision: D43445999
fbshipit-source-id: 85be1bbb4b5ac1664b5090688b688a4e50c3d80a
Summary:
This adds a series of examples for TextInput styles to screenshot test, specifically the ones which are projected to Android as spans. This will be used in refactoring to verify we do not change visual output.
Changelog:
[Internal][Added] - Add "Text Styles" TextInput Example
Reviewed By: cortinico
Differential Revision: D43158004
fbshipit-source-id: adaecf0e37941e66e280db282e2631a95b08b27a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36232
Seems like RN Tester is crashing for JSC debug/release.
This happens because RN Tester ends up fetching JSC from Maven Central which contains older versions
of the artifacts (r17) which are not compatible with our setup AND are missing `libjsc.so`.
This is happening as our file layout is a bit different than a regular NPM project so
the repository declaration for JSC, being `../jsc-android/dist` from React Native root ends
in the wrong folder.
In this specifically I:
- Add an excludeModule for "org.webkit:android-jsc" on Maven Central inside RNGP
- Remove the allproject{repositories{}} block which was overriding RNGP configuration
- Add a specific repository declaration inside RN Tester to point to where JSC effectively lives
Changelog:
[Internal] [Changed] - RNGP - Fix RNTester crashing for JSC and safeguard against fetching JSC from Maven Central
Reviewed By: sshic
Differential Revision: D43462015
fbshipit-source-id: db830d7567bbf7dd91412df417418aa61a0ca8fe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36209
ThisChange automatically enable the RuntimeScheduler when the new architecture is enabled, both on RNester and in the Template app.
Note that no migration steps are required.
## Changelog
[iOS][Changed] - Automatically install the RuntimeScheduler
Reviewed By: sammy-SC
Differential Revision: D43392059
fbshipit-source-id: 609ded9bdc3db13a0d54ff44d0d4687dfc8617a5
Summary:
> [Codegen 85] The parses/flow/components/schema.js and parses/typescript/components/schema.js are the same. Move the schema.js from the one of the two folders to the parsers common root. Delete the other. Update the references to use the shared file.
Part of the Codegen ☂️ Issue https://github.com/facebook/react-native/issues/34872
## 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] - Consolidated the schema.js files for parses/flow/components and parses/typescript/components to a common root.
Pull Request resolved: https://github.com/facebook/react-native/pull/36219
Test Plan: Run ```yarn jest react-native-codegen```
Reviewed By: christophpurrer
Differential Revision: D43444666
Pulled By: cipolleschi
fbshipit-source-id: 24d791fd3a8110730d3f6054497ea3a31549a5a5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36210
One of the circular dependencies we have in OSS was between React-Codegen and React-Fabric.
React-Codegen generates component which has to depends on React-Fabric because they need to use the files contained in the `react/renderer/view` folder.
React-Fabric contains some components that depends on RNCore, which was generated inside the React-Codegen folder.
This change generates the RNCore components inside the `ReactCommon/react/renderer/components/rncore` folder, breaking the dependency as `rncore` folder is now contained by React-Fabric itself.
**Fun Fact:** That's how it always should have been. There was already a line in the `.gitignore` to exclude the content of `ReactCommon/react/renderer/components/rncore` folder. I guess that with some of the refactoring/previous projects on Codegen, this requirements has slipped.
## Changelog:
[iOS][Breaking] - generates RNCore components inside the ReactCommon folder and create a new pod for platform-specific ImageManager classes
Reviewed By: sammy-SC, dmytrorykun
Differential Revision: D43304641
fbshipit-source-id: ebb5033ce73dbcd03f880c3e204511fdce04b816