Summary:
Event merging or "coalescing" is done on Java side from Android, but Fabric also includes some Cxx logic to merge those events. Although Android doesn't need this logic in particular, it is important to follow this path to ensure these events (e.g. scroll) are dispatched as "continuous", allowing for correct prioritization in Concurrent Mode.
`dispatchModernV2` selects between `dispatch` and `dispatchUnique` based on the `canBeCoalesced` parameter of the event, which is exactly what we need. The logic is only used in the "new" event dispatcher at the moment, so I wrapped it with feature flag to validate it doesn't cause any regressions.
Changelog:
[Android][Internal] - Try dispatching coalescing events as unique to Fabric
Reviewed By: sammy-SC
Differential Revision: D31272585
fbshipit-source-id: 6b67b61bd13fbff019d9eb8c5172bdd814a7b5b8
Summary:
Assuming this method was deprecated to mean experimental.
This execution path is used by overwhelming majority of events and it seems as stable as it can be.
Changelog:
[Android][Changed] Removed experimental deprecation from `dispatchModern`
Reviewed By: cortinico
Differential Revision: D31270721
fbshipit-source-id: 5a7e50455ab2850adf9bc86a248773b170bf0ab9
Summary:
We forgot to make ClipboardModule TurboModule compatible. I think this was most likely because our codemods targeted all Java classes that extended ReactContextBaseJavaModule. The ClipboardModule extends ContextBaseJavaModule instead.
There are no other NativeModules that extend ContextBaseJavaModule.
Changelog: [Internal]
Reviewed By: sshic
Differential Revision: D31291293
fbshipit-source-id: cf5d21898101699f8c349b013a77e8329339a8d3
Summary:
Pressability previously was filtering which events get forwarded through the PerformanceEventEmitter, but this causes issues for native telemetry systems which won't know which events Pressability has skipped (or why).
Also, the "delay ms" no longer has any meaning because the native timestamps and Date.now() have a different time-basis entirely.
Changelog: [Internal]
Differential Revision: D31251300
fbshipit-source-id: f097047ac150e8dddb0f3857d9f375bae2318681
Summary:
Original commit changeset: ab1e842b60c5
Changelog:
[Internal] [Changed] - Back out "[RN][Android] Make react-native depend on react-native-gradle-plugin"
Reviewed By: fkgozali
Differential Revision: D31310547
fbshipit-source-id: 46c4c1e41b0f5432bc24975f754e0852e7180769
Summary:
Similarly to what we did for react-native-codegen, I'm introducing
a dependency between RN and the Gradle plugin, to be processed upon OSS bumps.
Changelog:
[General] [Added] - Make react-native depend on react-native-gradle-plugin
Reviewed By: fkgozali
Differential Revision: D31206303
fbshipit-source-id: ab1e842b60c51d0dce272892a30be2e27350f9bb
Summary:
When we were iterating on the Fabric renderer, animated components went through some iteration to ensure that animated shadow nodes were not flattened away. At the time, `collapsable` was not supported on iOS, even in Fabric, because the legacy renderer would not publish the `collapsable` prop on the view config.
This has since been fixed and `collapsable` is supported on both Android and iOS. We no longer need the `nativeID` workaround to prevent view flattening.
For use cases of the JavaScript driver and legacy renderers, this change will cause views which used to be flattened to no longer be flattened. This seems like an appropriate change considering the direction that we are moving (in which everything is eventually transitioned to using the Fabric renderer).
Changelog:
[Android][Changed] - Native views backing Animated.View (w/ JavaScript-driven animations) will no longer be flattened; this should be a transparent change.
Reviewed By: lunaleaps, mdvacca
Differential Revision: D31223031
fbshipit-source-id: 48dc63471eef406f4c215bfea0b3ef82a05d4b24
Summary:
Add examples for Switch component in RN Tester app for:
- ios_backgroundColor
- onChange
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[General] [Added] - Added examples to Switch component
Pull Request resolved: https://github.com/facebook/react-native/pull/30611
Test Plan: ![SwitchExample](http://g.recordit.co/FvniuL2yLl.gif)
Reviewed By: lunaleaps
Differential Revision: D25680480
Pulled By: sota000
fbshipit-source-id: 91202a0d8699554b0535f1a91875fd9fc664d54d
Summary:
Expands the building of npm tarballs to include branches that match the /^(\d+)\.(\d+)-stable$/ regexp.
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D31272377
fbshipit-source-id: a536a0b5e14812ece8266f3c83497071405a164a
Summary:
changelog: [internal]
This code assured that view preallocation is only triggered if ShadowNode is cloned from revision 0 to revision 1 (first time ShadowNode is cloned).
Node can go from virtual to view forming in subsequent clones, not just the first one. This is more of a case in Concurrent React where the node can be cloned many times before it is first mounted.
Reviewed By: mdvacca
Differential Revision: D31237719
fbshipit-source-id: 13fe6d10fdc815dbdae785d1d9d86d1c8fd36be4
Summary:
Updates event category deduction to match iOS implementation.
The event priority is used by concurrent mode to prioritize certain events, where Cxx part already assigns the correct priority based on the `ContinuousStart` -> `ContinuousEnd` spans. These spans can be deduced from the touch events, which we do in this implementation.
All events that can be "coalesced" (dispatched through `invokeUnique`) are assigned `Continuous` by default in Fabric core, so scroll/slider change events will never be discrete.
Changelog:
[Internal] Add category deduction to Android touch events
Reviewed By: mdvacca
Differential Revision: D31233233
fbshipit-source-id: f5b039aa137f1b4d2e2b15578bfc29ab6903a081
Summary:
For iOS, event category deduction is done from the C++ code, but the touch events are handled on Java layer in Android. This change exposes the category parameter through the `EventEmitterWrapper` called from Java, allowing to define category for events in the future.
Changelog:
[Internal] - Expose event category through JNI
Reviewed By: mdvacca
Differential Revision: D31205587
fbshipit-source-id: f2373ce18464b01ac08eb87df8f421b33d100be2
Summary:
Removes `metro-babel-register` as a runtime dependency of the `react-native` package, where it is only used as a dev dependency (in the Jest preprocessor).
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D31177424
fbshipit-source-id: bf7b7216116744a3234beea089d0028c0bfe4d1e
Summary:
Fix Image defaultSource not showing on iOS.
This bug was introduced somewhere between RN 0.63 and 0.65. On iOS, defaultSource does not show while the image is being downloaded, only if it fails or there's no internet.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[iOS] [Fixed] - Fix Image defaultSource not showing on iOS
Pull Request resolved: https://github.com/facebook/react-native/pull/32172
Test Plan: Ran both debug and release builds on an iPhone 12 pro (iOS 14.6)
Reviewed By: sammy-SC
Differential Revision: D30822805
Pulled By: lunaleaps
fbshipit-source-id: c4ef18723a8311ef3be1d7ae25ff3c205e8fff62
Summary:
This diff extends the current implementation of ScrollView.snapToAlignments from RN Android to reach feature parity with RNiOS
changelog: [Android][Changed] Implement ScrollView.snapToAlignments in RN Android
Reviewed By: javache
Differential Revision: D31206398
fbshipit-source-id: b6534965c476a0a4745ac98b419cbe05dc5c746e
Summary:
This diff implements the SnapToAlignment functionality in ReactScrollView for RN Android.
In order to use SnapToAlignment, the pagingEnabled prop should be set
Based on the documentation the behavior implemented in this diff is more "advanced" than the one implemendted in RNiOS, because it let you snap without specifying any interval nor offset (it calculates the intervals in real time based on the size of its content)
I still need to verify how different RNiOS and RN Android behaviors are
changelog: [Android][Added] Implement SnapToAlignment in ReactScrollView
Reviewed By: JoshuaGross
Differential Revision: D31182786
fbshipit-source-id: a9b55d9c00326ae21ca9b89575e79c60bf9edcca
Summary:
This diff adds the new snapToAlignment into ReactScrollViewManager
changelog: [Android][Added] Implement snapToAlignment into ReactScrollViewManager
Reviewed By: JoshuaGross
Differential Revision: D31182787
fbshipit-source-id: 8049ceb462461a11f184dbc1b40ca8079a3e8b60
Summary:
This diff implements the SnapToAlignment functionality in ReactHorizontalScrollView for RN Android.
In order to use SnapToAlignment, the pagingEnabled prop should be set
Based on the documentation the behavior implemented in this diff is more "advanced" than the one implemendted in RNiOS, because it let you snap without specifying any interval nor offset (it calculates the intervals in real time based on the size of its content)
I still need to verify how different RNiOS and RN Android behaviors are
changelog: [Android][Added] Implement SnapToAlignment in ReactHorizontalScrollView
Reviewed By: JoshuaGross
Differential Revision: D31174544
fbshipit-source-id: 204a82f55e3b7598124ce2528d8ad7d854c0ac77
Summary:
This diff adds the new snapToAlignment into ReactHorizontalScrollViewManager
changelog: [Android][Added] Implement snapToAlignment into ReactHorizontalScrollViewManager
Reviewed By: JoshuaGross
Differential Revision: D31174545
fbshipit-source-id: c56bfca207980428be98dd21a5387a0ff6bcd296
Summary:
Add a new -v or --to-version argument to the bump-oss-version script.
When the bump-oss-version script runs, it will use the version string that is passed in, instead of trying to infer it from the current commit. This fixes a bug in the last nightly release where the bump script used a different version string than what the publish script expected.
Nightlies now run at 20:00 hours UTC.
Changelog: [Internal]
Reviewed By: fkgozali, TheSavior
Differential Revision: D31261829
fbshipit-source-id: a9341f93c3c7bf0379aa3c5e7f345182df70f846
Summary:
Bump the version of Xcode used in internal and external iOS tests, as well as the CocoaPods version used in RNTester (and therefore, the internal CocoaPods offline mirror).
New versions used:
* Xcode 13.0.0
* CocoaPods 1.11.2
See Circle CI Xcode 13.0.0 macOS Container Software manifest: https://circle-macos-docs.s3.amazonaws.com/image-manifest/v6052/index.html
* Xcode 13.0 Build version 13A233
* CocoaPods 1.11.2
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D31253170
fbshipit-source-id: c85f3ee12fa708d9e54fef1200f3124810211d2f
Summary:
Previous iterations of this diff that were reverted: D30678341 (800945982f), D30868627 (abd0f387cd),
D31024459 (0a46e5efad), D31147242 (92c1bee5f9).
With the power of selects, we can move the base AppleTVOS flags into the regular
base Apple flags.
Changelog: [Internal]
skip-frl-buck-targeting
Reviewed By: mzlee
Differential Revision: D31216242
fbshipit-source-id: 93ee2afda41af06fe210ba6a4a5459a438d6c3f8
Summary:
Since Apple released its own silicon M1, an ARM64, the react-native build is broken or at least not as effective as it should.
This PR stops excluding `arm64` simulator (this is not needed on the M1 neither on Intel devices) and removes the problematic `$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)` from `LIBRARY_SEARCH_PATHS`, since on Xcode 12.5 and 13.0 this folder contains only `i386/x86_64` binaries and will fail compilation.
Instead this PR forces `$(SDKROOT)/usr/lib/swift` while it removes the incorrect directory. Ideally we could just remove `LIBRARY_SEARCH_PATHS` altogether if `$(inherited)` and `$(SDKROOT)/usr/lib/swift` were the only entries, but it would require us a **newer CocoaPods**, since that was fixed with `1.11` (see 6985cbf7de). Since we don't enforce that, lets keep the `$(SDKROOT)/usr/lib/swift` and call it done.
Last but not least, deprecate the `__apply_Xcode_12_5_M1_post_install_workaround()` as it's not needed anymore, at least with recent versions of the dependencies, no patching is required with RCT-Folly, neither we need to force `IPHONEOS_DEPLOYMENT_TARGET=11.0`
## Changelog
[iOS] [Fixed] - Xcode 12.5+ build of iPhone Simulator on Apple M1
[iOS] [Changed] - Do not exclude the arm64 iphonesimulator
[iOS] [Deprecated] - __apply_Xcode_12_5_M1_post_install_workaround()
Pull Request resolved: https://github.com/facebook/react-native/pull/32284
Test Plan:
* Build `packages/rn-tester` on M1 and see it still works properly
* Run `pod install` on x86_64 and arm64 (m1) and see the `project.pbxproj` is not changed
## References:
* Closes https://github.com/facebook/react-native/issues/31480
* The initial fix ac4ddec542
* Upgrading CocoaPods to 1.11 would bring us 6985cbf7de and we could avoid adding `$(SDKROOT)/usr/lib/swift` ourselves
Reviewed By: lunaleaps
Differential Revision: D31248460
Pulled By: fkgozali
fbshipit-source-id: 5a0d69593e889e296a2ba2e7b4387ecbd56fc08d
Summary:
Package a npm tarball for react-native on pull-request commits, for ease of testing during development.
Ensure npm/github secrets are not exposed on pull-request builds (e.g. Circle CI will only grab the CIRCLE_NPM_TOKEN and GITHUB_TOKEN on jobs triggered by tagged commits or commits on main)
Renames Circle CI `publish_npm_package` job to `build_and_release_npm_package`, and uses `build_npm_package` for dry runs (e.g. commitlies).
Changelog: [internal]
Reviewed By: fkgozali
Differential Revision: D31243726
fbshipit-source-id: 2907febac3286a1504984c2f14e84dec1d819858
Summary:
This diff introduces a new interface named `SurfaceDelegate`. The interface abstracts the API for interacting with a surface, which is required for platforms other than mobile to implement how it wants to show and hide a surface. For existing Mobile use cases, the `LogBoxDialogSurfaceDelegate` is provided as a fallback solution so everything still works.
Changelog:
[Android][Added] - Add SurfaceDelegate abstraction to support interaction in multiple platforms and provide default implementation in LogBoxModule
Reviewed By: mdvacca
Differential Revision: D31132285
fbshipit-source-id: 13315a8bc5b7bcaee9b5e53ef5c6f6cc8cb01f31
Summary:
Fixed typo in Share component docs
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[Internal] [Fixed] - Fix typo in Share component docs
Pull Request resolved: https://github.com/facebook/react-native/pull/31295
Test Plan: N/A
Reviewed By: yungsters
Differential Revision: D31152173
Pulled By: charlesbdudley
fbshipit-source-id: 831252f24876986fd053ff5e9875fef1132fa957
Summary:
Original commit changeset: 9ccfb4b6d477 / D30015799 (6e903b07fa)
The diff caused a redbox/error in some products. Reverting now and will try it again.
Changelog: Backing out PR: 31402
Differential Revision: D31238961
fbshipit-source-id: b2ccd3d3ab9d7e764e41fb54d8a7e60882d1405f
Summary:
Nightlies will be tagged with the commit they are based off and a timestamp.
> Example: `react-native-0.0.0-084a8b5f0-20210928-054053`
Commitlies now use the proper name on Circle CI for their job: `build_commit_package`.
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D31224640
fbshipit-source-id: d1742a1d475aaf60d7b4c0708e30a5c5b205182d
Summary:
Scheme names may contain whitespace characters is used as path of the
path for various files during build time. This means any path that
includes the scheme name in it needs to be surrounded by quotes.
You can see the generated command below for a project with a scheme
called `Some Scheme`:
node ./node_modules/react-native/cli.js bundle \
--entry-file index.js \
--platform ios \
--dev false \
--reset-cache \
--bundle-output './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle' \
--assets-dest './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app' \
--sourcemap-output ./ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle.map
`--bundle-output` and `--assets-dest` are properly quoted, but
`--sourcemap-output` is not.
This changes `$EXTRA_ARGS` to an array of strings so that we can
propertly quote `$PACKAGER_SOURCEMAP_FILE` when passing it to the
`--sourcemap-output` argument. When running the bundle command, this
array is unwrapped and all its elements passed as individual arguments.
It also applies the same unwrapping to `$EXTRA_PACKAGER_ARGS` so that
users can also pass an array of options when arguments containing spaces
are needed.
It's important to note that these changes ARE backwards compatible: if
`$EXTRA_PACKAGER_ARGS` is defined as a simple string, instead of an
array of strings, the command won't break, as it will still expand
correctly.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[iOS] [Fixed] - Source map path for schemes containing whitespaces
Pull Request resolved: https://github.com/facebook/react-native/pull/31587
Test Plan:
With the new change, the generated command becomes:
node ./node_modules/react-native/cli.js bundle \
--entry-file index.js \
--platform ios \
--dev false \
--reset-cache \
--bundle-output './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle' \
--assets-dest './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app' \
--sourcemap-output './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle.map'
Reviewed By: yungsters
Differential Revision: D30911631
Pulled By: charlesbdudley
fbshipit-source-id: 0c2d98746b365285fe693bcc867a24d3fc649f50
Summary:
About asdf-vm: https://asdf-vm.com/
This PR add [asdf-vm](https://asdf-vm.com/) support to `find-node.sh` for `scripts/react-native-xcode.sh` in `Bundle React Native code and images` build phrase and potentially other scripts using `find-node.sh` to get executable nodejs
## Changelog
[iOS] [Added] - add asdf-vm support in find-node.sh
Pull Request resolved: https://github.com/facebook/react-native/pull/30111
Test Plan: Xcode is able to complete `Bundle React Native code and images` build phrase without errors when node is installed by asdf-vm
Reviewed By: yungsters
Differential Revision: D31064080
Pulled By: charlesbdudley
fbshipit-source-id: aa73620fc39027c58c9cdfbb554cd5698b917850
Summary:
Update the showcase url to the right url.
When I did check out the repository and I was about to navigate to showcase. I found out the url was wrong.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[General] [Changed] - Changed the showcase URL
Pull Request resolved: https://github.com/facebook/react-native/pull/32277
Reviewed By: lunaleaps
Differential Revision: D31206326
Pulled By: cortinico
fbshipit-source-id: a4092e9bb74d9a9cc68d7252aa131083dd38b6ca
Summary:
Changelog: [Internal]
Some environments that use codegen don't have Haste enabled, breaking the `require('NativeComponentRegistry')` call in generated view configs. Here we change it to reference an explicit path relative to `react-native`.
Reviewed By: JoshuaGross
Differential Revision: D31166063
fbshipit-source-id: cebc23d0d95b5cde76d0f8473eabc03ca82a862e
Summary:
Previous iterations of this diff that were reverted: D30678341 (800945982f), D30868627 (abd0f387cd),
D31024459 (0a46e5efad).
With the power of selects, we can move the base AppleTVOS flags into the regular
base Apple flags.
Changelog: [Internal]
Reviewed By: mzlee
Differential Revision: D31147242
fbshipit-source-id: deef1f1b39eb21772ab7ddd2ef1f19814e1f72d5
Summary:
Before we can publish `0.0.1` of `react-native-gradle-plugin`, we
need to write a README file for it.
Changelog:
[Internal] [Changed] - Add a README before publishing the react-native-gradle-plugin
Reviewed By: ShikaSD
Differential Revision: D31206204
fbshipit-source-id: 0168298d04d4619dde931eb75d9555982f50fffe
Summary:
Removing the App postfix from the plugin as that is
a result of the merging. This aligns the plugin ID to the plugin
class name.
Changelog:
[Internal] [Changed] - Renamed Gradle Plugint to `React`
Reviewed By: ShikaSD
Differential Revision: D31205318
fbshipit-source-id: 23cd24c91fa8526137045e8537f03f560be939cb