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:
In [this commit](e6cba99744), we renamed `Geometry.h` to `Vector.h`.
This is the last change of a series of updates that progressively altered the shape of `Geometry.h` from its [original version](https://github.com/facebook/react-native/blob/0.71-stable/ReactCommon/react/renderer/graphics/Geometry.h).
This is a breaking change as several libraries in the OSS are depending on Geometry.h and we removed it without deprecating it.
This change aims to put the file back, with a deprecation message, so that we can safely remove it in the next version.
## Changelog
[General][Fixed] - Restore Geometry.h to avoid breaking change
Reviewed By: cortinico
Differential Revision: D43621983
fbshipit-source-id: 96b976901f7ec337f2ec64c592e4b4d19d89ab11
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:
Pull Request resolved: https://github.com/facebook/react-native/pull/36258
This fixes a few instances where YogaLayoutableShadowNode (or general shadownode casting) could offer better memory safety.
1. The reference form of traitCast() now terminates on invalid cast, instead of debug assert, since it is better to crash in production than to corrupt memory (which will crash somewhere later, in a much more confusing way).
2. We use traitCast() in more places where we previously would static_cast. This means needing to formally add a mutable version.
3. We bounds-check yoga children access in a single place by using `std::vector` `at()` instead of `[]`.
4. Removed `Trait::UnreservedTrait1` API, since multiple libraries using it can collide and we lose the memory safety benefits of `traitCast`.
This change is in response to a bug where `YogaLayoutableShadowNode` may perform an invalid `static_cast` of `RawTextShadowNode` if a text or number is rendered directly inside of a `<View>` (instead of a `<Text>` element).
This does not yet fix the underlying logic of YogaLayoutableShadowNode to act gracefully when a RawTextShadowNode makes its way into children. We just terminate, instead of corrupting memory.
Changelog:
[General][Breaking] - Better Fabric ShadowNode Memory Safety (Removes `Trait::UnreservedTrait` API)
Reviewed By: javache
Differential Revision: D43271779
fbshipit-source-id: 727c1230f72664bf4d261871c66ca61ddf0d5ffa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36310
As part of the preparation for 0.72, this reduces the amount of breaking changes we expose in the template for the user.
Specifically it re-introduces the 4 param ctor for `DefaultReactActivityDelegate` and marking it with Deprecated,
so the build log and the IDE will instruct the user to move away from it (if they forgot to follow the upgrade helper).
Changelog:
[Internal] [Changed] - Reduce breaking changes with DefaultReactActivityDelegate
Reviewed By: cipolleschi
Differential Revision: D43619184
fbshipit-source-id: a98f7c67201a2860e7c2221e646f45f1ebec4678
Summary:
add print yoga node AllEdge value when debug mode, the old logic just print four edgeValue including top left bottom and right
but when we set the same value to these edge, we use YGAllEdge, this will be more convenient debug code
so I open this pull request to add it
X-link: https://github.com/facebook/yoga/pull/948
Reviewed By: cortinico
Differential Revision: D43525328
Pulled By: NickGerleman
fbshipit-source-id: 59dde363e6ee8433d10ecf27e440ea7d54000bc1
Summary:
This backs out https://github.com/facebook/react-native/pull/36241 for causing screenshot failures in an app still using Paper.
Changelog:
[iOS][Removed] - Back out "[react-native][PR] feat: Add iOS Paper implementation of inset logical properties"
Reviewed By: motiz88, rshest
Differential Revision: D43621612
fbshipit-source-id: 0fc01d6c6ae5c5bfb2813bd60b25e9315e42e3c3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36307
[Changelog][Internal]
Noticed some JS linter warnings during CircleCI tests being run, this disturbed my OCD, so here's a fix for them.
Reviewed By: cipolleschi
Differential Revision: D43619403
fbshipit-source-id: 779a1d2e197298275d06a2597cfef7554017016f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36280
[Changelog][Internal]
As a follow-up to adding `ReactContext.emitDeviceEvent` (D43534174 (a8f0a4dc62)) this makes it used in the OSS part of RN.
Reviewed By: NickGerleman
Differential Revision: D43494167
fbshipit-source-id: c3d56bde53fb1ce1297a48597b97470ff10f4dc0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36305
This change automate settings some search paths for 3rd parties libraries that are not using our `install_modules_dependencies` helper.
This will make the `use_frameworks!` changes less breaking.
## Changelog:
[iOS][Changed] - Automatically update Search Path on pods
Reviewed By: dmytrorykun
Differential Revision: D43596808
fbshipit-source-id: 9c5d7ff60a1e4cf73afbfd70b2499f03825cd764
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:
Original commit changeset: 43c4e4f1ae6b
Original Phabricator Diff: D43275024 (c5bc3f1373)
D43587488 reverted D43275024 (c5bc3f1373), but it was only committed to the fbobjc/releases/release-fbios-2023.03.01 branch (v404).
We still aren't seeing successful fbios-pika-iphoneos-release builds for v405 (https://fburl.com/mobile/7zac3b5w). This is preventing QA and employee dogfooding of v405 (S325502).
(Note: this ignores all push blocking failures!)
Reviewed By: abashyam
Differential Revision: D43609260
fbshipit-source-id: d411294ad8cdb22ff9e812bf0689d9b7bdff8d2e
Summary:
This Change remove the need to have a specific version of Ruby installed. We are now supporting a wider range of Ruby versions, starting from Ruby 2.6.10 (the ruby installed on MacOS by default).
We are still using a Gemfile to control the version of cocoapods that needs to be installed.
## Changelog
[IOS] [CHANGED] - Remove `.ruby-version` and update Gemfile to support a wider range of Ruby versions
Pull Request resolved: https://github.com/facebook/react-native/pull/36281
Test Plan:
- Tested locally on RNTester and an app from template, switch across different versions of Ruby
- CircleCI is green on the commit
Reviewed By: cortinico
Differential Revision: D43567660
Pulled By: cipolleschi
fbshipit-source-id: e7edfe5806a898a83ba39cb58b1318ebde56a57c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36237
This changes the data parameter type for `getItemLayout` from a mutable array (too lenient, even before), to `ArrayLike`, which is now the most constrained subset of data which may be passed to a FlatList.
We could do something more exact by adding another generic parameter to FlatList, but that would be likely be noticeably more breaking, since during testing I couldn't manage a pattern that both kept the same minimum number of generic arguments while keeping inference working.
Changelog:
[General][Breaking] - Constrain data type in `getItemLayout` callback
Reviewed By: javache
Differential Revision: D43466967
fbshipit-source-id: 7a1ce717e7d5cc96a58b8d3ad9def6cf6250871f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36236
D38198351 (d574ea3526) addedd a guard to FlatList, to no-op if passed `data` that was not an array. This broke functionality where Realm had documented using `Realm.Results` with FlatList. `Real.Results` is an array-like JSI object, but not actually an array, and fails any `Array.isArray()` checks.
This change loosens the FlatList contract, to explicitly allow array-like non-array entities. The requirement align to Flow `ArrayLike`, which allows both arrays, and objects which provide a length and indexer. Flow `$ArrayLike` currently also requires an iterator, but this is seemingly a mistake in the type definition, and not enforced.
Though `Realm.Results` has all the methods of TS `ReadonlyArray`, RN has generally assumes its array inputs will pass `Array.isArray()`. This includes any array props still being checked [via prop-types](044efd7a10/factoryWithTypeCheckers.js (L548)).
This change intentionally does not yet change the parameter type of `getItemLayout()`, which is already too loose (allowing mutable arrays). Changing this is a breaking change, that would be disruptive to backport, so we separate it into a different commit that will be landed as part of 0.72 (see next diff in the stack).
Changelog:
[General][Changed] - Make FlatList permissive of ArrayLike data
Reviewed By: yungsters
Differential Revision: D43465654
fbshipit-source-id: 3ed8c76c15da680560d7639b7cc43272f3e46ac3
Summary:
This PR adds Paper support to `inset` logical properties on iOS 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`.
Android changes are in a separate PR to facilitate code review https://github.com/facebook/react-native/pull/36242
## Changelog
[IOS] [ADDED] - Add Paper implementation of inset logical properties
Pull Request resolved: https://github.com/facebook/react-native/pull/36241
Test Plan:
1. Open the RNTester app and navigate to the `View` page
2. Test the new style properties through the `Insets` section
![image](https://user-images.githubusercontent.com/11707729/220512607-a1d89dbe-64db-4140-9fdb-f9d7897fe3bd.png)
Reviewed By: lunaleaps
Differential Revision: D43525110
Pulled By: NickGerleman
fbshipit-source-id: b70b0ef183dcf192b2c3547422bbe161b7bdba50
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:
Pull Request resolved: https://github.com/facebook/react-native/pull/36282
RN Tester is currently red as `TraceUpdateOverlay` is not registered in the Fabric Core Component Registry.
Changelog:
[Internal] [Changed] - Add TraceUpdateOverlayComponentDescriptor to CoreComponentsRegistry
Reviewed By: cipolleschi
Differential Revision: D43567915
fbshipit-source-id: ceb4b9b674a969f260caf810eade30ae23ce2ce8
Summary:
While testing `use_frameworks! :linkage => :static`, I encountered nullability warnings that were previously suppressed because we always build with `-Werror`. I'm not sure why the suppressions no longer work, but they should just be fixed.
## Changelog
[IOS] [FIXED] - Fix nullability warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/36247
Test Plan: iOS build should succeed.
Reviewed By: cipolleschi
Differential Revision: D43531887
Pulled By: javache
fbshipit-source-id: cae0617a20c8d215042cf4c5be2cbb17c801bb41
Summary:
We don't support Lambda in OSS yet, Lambdas were introduced as root of a stack of diffs, so we need to revert the whole stack
## Changelog:
[internal] - revert changes that broke CircleCI
Reviewed By: GijsWeterings
Differential Revision: D43566129
fbshipit-source-id: feae3c3065ed83463c9d887d7ff488c29993e0ae
Summary:
We don't support Lambda in OSS yet, Lambdas were introduced as root of a stack of diffs, so we need to revert the whole stack
## Changelog:
[internal] - revert changes that broke CircleCI
Reviewed By: GijsWeterings
Differential Revision: D43566121
fbshipit-source-id: 5c4fe8272ca220d8914eb64b3ab395589c007198
Summary:
We don't support Lambda in OSS yet, Lambdas were introduced as root of a stack of diffs, so we need to revert the whole stack
## Changelog:
[internal] - revert changes that broke CircleCI
Reviewed By: GijsWeterings
Differential Revision: D43566086
fbshipit-source-id: 95b8ed404edd6f711fbbb5ae3913010c653a2c28
Summary:
The previous fix for -DNDEBUG required to install the pods with PRODUCTION=1 in order to add the flag. The flag was added also to Debug configurations, which is not ideal.
With this change, we remove the requirement of running `PRODUCTION=1 pod install` and we install the -DNDEBUG flag to all the release configurations.
## Changelog:
[iOS][Changed] - Install the -DNDEBUG flag on Release configurations, without requiring PRODUCTION=1 flag
Reviewed By: cortinico
Differential Revision: D43535620
fbshipit-source-id: af97bef06f267dddd5ce13a466bbc8d9a5eb2b0b
Summary:
While looking into android code i noticed a bug removing the incorrect key from a map.
changelog: [internal] internal
Reviewed By: RSNara
Differential Revision: D43544499
fbshipit-source-id: 15224e90cc46af358fb822e85accfae9aa9f7d11
Summary:
We can now use Java 8, this diff i'm replacing old callbacks by lambdas
changelog: [internal] internal
Reviewed By: RSNara
Differential Revision: D43544498
fbshipit-source-id: 4c5ab8473b3d9d512853c02e81652fdce1838a48
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:
Adding automatic RN version checking github workflow, which will verify the version of RN listed on all new issues filed in the repository.
Additionally, this change refactors the existing labeler workflow to make it re-usable by the version check workflow. The change also creates a logical place to add future automatic detection checks, like auto-verification of repro, template, etc.
This is technically not new functionality, as the react-native-bot does this _sometimes_, but this should be a lot more reliable.
The logic for valid release checking follows what is listed in the documentation - valid versions are current and N-2 minors, with the highest available patches.
## Changelog
[INTERNAL] [FIXED] - Made the automated RN version checking workflow more reliable
Pull Request resolved: https://github.com/facebook/react-native/pull/36075
Test Plan:
I have verified a variety of different versions on issues here: https://github.com/SlyCaptainFlint/react-native/issues
I have also re-verified all the tags that were previously handled by the labeler workflow, since I have refactored it. Please take a look at both the open and closed issues in the linked repo for examples.
Reviewed By: cortinico
Differential Revision: D43089150
Pulled By: SlyCaptainFlint
fbshipit-source-id: 7da67f5cb2a4875f22e1f9e46d7ca07d43f3e135
Summary:
Changelog:
[Android][Internal] - Fix EventAnimationDriverMatchSpec to match against the view that generated the event for non-bubbling pointer events. This should have no effect if you are not using PointerEvents
Reviewed By: mdvacca
Differential Revision: D43413771
fbshipit-source-id: 31ac751b3d3d55eb44d3a9ab54e5fb387dcaa9b3
Summary:
After reviewing the doc [`Image`](https://reactnative.dev/docs/image), the typescript compiler doesn't know the following properties:
- src
- srcSet
- referrerPolicy
- tintColor
- objectFit
But after reviewing the source code and this [`commit`](b2452ab216), the `objectFit` property isn't one related to the Image component but to the `style` props, making the official doc outdated. So, an [`issue in the react-native-website repo`](https://github.com/facebook/react-native-website/issues/3579) have been created and I decided to not include the objectFit prop in this PR.
So, this PR includes those properties: sec, secSet, referrerPolicy and tintColor
## Changelog
[GENERAL][FIXED] Add src, srcSet, referrerPolicy, tintColor to Image.d.ts declaration file
Pull Request resolved: https://github.com/facebook/react-native/pull/36214
Reviewed By: NickGerleman
Differential Revision: D43437894
Pulled By: rshest
fbshipit-source-id: 497426490134aba0a474c49bf8bab9131f2e5845
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36177
react_native_assert calls C `assert()`, where XCode does not have a built-in breakpoint navigator to hook to assertion failures (though you can add a symbolic breakpoint to "abort()" to get the effect). This changes the Apple implemented of `react_native_assert()` to use `NSCAssert` under the hood. This is safe to use in C functions, but will be trapped by the default XCode exceptions breakpoint navigator.
Changelog:
[iOS][Fixed] - Use NSCAssert() in react_native_assert instead of C assert()
Reviewed By: cipolleschi
Differential Revision: D43275024
fbshipit-source-id: 43c4e4f1ae6b99f32634d4b1880bce712c3ae8f6
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:
This diff is a retry of shipping D43180893 (89ef5bd6f9), which got backed out in D43350025 (1f151e0d2f) due to issues in iOS RN apps.
I've exclude iOS apps in this diff. I am planning to have the iOS implementation for the TraceUpdateOverlay native component to fill the gap with lower priority.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D43409501
fbshipit-source-id: fe8bb5654862f0b5e9054a97ae1f4cde573bb3e0
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've just tested the nightly and the build from source is broken as the `repositories{}` block is missing.
Normally RNGP will take care of setting repositories for everyone, but this is triggered by the app-module.
When building from source, the app module of the user is isolated from the included build of React Native,
therefore the repositories{} definitions are not passed over.
Without this, the build fails with:
```
Cannot resolve external dependency ... because no repositories are defined
```
Changelog:
[Internal] [Changed] - Re-add repositories{} block to allow for build-from-source
Reviewed By: cipolleschi
Differential Revision: D43501011
fbshipit-source-id: b41c56c62839163ad210e7e303940dec0a9001da
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: Changelog: [Android][Fixed] Resolved bug with Text components in new arch losing text alignment state.
Reviewed By: mdvacca
Differential Revision: D34108943
fbshipit-source-id: 3992e9406345be919b5e3595fc1f9e61cf67a699